From 8972b734c34b49b21f830323b8c37d755a4ace2c Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 30 Nov 2022 11:00:55 +0200 Subject: [PATCH 1/2] README: Usage before installation --- README.rst | 122 ++++++++++++++++++++++++++--------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/README.rst b/README.rst index c07f67a..d710d27 100644 --- a/README.rst +++ b/README.rst @@ -17,67 +17,6 @@ pypinfo: View PyPI download statistics with ease. pypinfo is a simple CLI to access `PyPI`_ download statistics via Google's BigQuery. -Installation ------------- - -pypinfo is distributed on `PyPI`_ as a universal wheel and is available on -Linux/macOS and Windows and supports Python 3.7+. - -This is relatively painless, I swear. - -**Create project** - -1. Go to ``_. -2. Sign up if you haven't already. The first TB of queried data each month - is free. Each additional TB is $5. - -3. Go to ``_ and click - CREATE PROJECT if you don't already have one: - - .. image:: https://user-images.githubusercontent.com/1324225/47172949-6f4ea880-d315-11e8-8587-8b8117efeae9.png - -4. This takes you to ``_. Fill out - the form and click CREATE. Any name is fine, but I recommend you choose something to - do with PyPI like pypinfo. This way you know what the project is designated for: - - .. image:: https://user-images.githubusercontent.com/1324225/47173020-986f3900-d315-11e8-90ab-4b2ecd85b88e.png - -5. The next page should show your new project. If not, reload the page and select from - the top menu: - - .. image:: https://user-images.githubusercontent.com/1324225/47173170-0b78af80-d316-11e8-879e-01f34e139b80.png - -**Enable BigQuery API** - -6. Go to ``_ - and make sure the correct project is chosen using the drop-down on top. Click - the ENABLE button: - - .. image:: https://user-images.githubusercontent.com/1324225/47173408-a6718980-d316-11e8-94c2-a17ff54fc389.png - -7. After enabling, click CREATE CREDENTIALS: - - .. image:: https://user-images.githubusercontent.com/1324225/47173432-bc7f4a00-d316-11e8-8152-6a0e6cfab70f.png - -8. Choose the "BigQuery API" and "No, I'm not using them": - - .. image:: https://user-images.githubusercontent.com/1324225/47173510-ec2e5200-d316-11e8-8508-2bfbb8f6b02f.png - -9. Fill in a name, and select role "BigQuery User" (if the "BigQuery" is not an option - in the list, wait 15-20 minutes and try creating the credentials again), and select a - JSON key: - - .. image:: https://user-images.githubusercontent.com/1324225/47173576-18e26980-d317-11e8-8bfe-e4775d965e32.png - -10. Click continue and the JSON will download to your computer. Note the download - location. Move the file wherever you want: - - .. image:: https://user-images.githubusercontent.com/1324225/47173614-331c4780-d317-11e8-9ed2-fc76557a2bf6.png - -11. ``pip install pypinfo`` -12. ``pypinfo --auth path/to/your_credentials.json``, or set an environment variable - ``GOOGLE_APPLICATION_CREDENTIALS`` that points to the file. - Usage ----- @@ -367,6 +306,67 @@ We can also use it to query stats on an exact version: | 3.10 | 1.23.0rc3 | 8.33% | 5 | | Total | | | 60 | +Installation +------------ + +pypinfo is distributed on `PyPI`_ as a universal wheel and is available on +Linux/macOS and Windows and supports Python 3.7+. + +This is relatively painless, I swear. + +**Create project** + +1. Go to ``_. +2. Sign up if you haven't already. The first TB of queried data each month + is free. Each additional TB is $5. + +3. Go to ``_ and click + CREATE PROJECT if you don't already have one: + + .. image:: https://user-images.githubusercontent.com/1324225/47172949-6f4ea880-d315-11e8-8587-8b8117efeae9.png + +4. This takes you to ``_. Fill out + the form and click CREATE. Any name is fine, but I recommend you choose something to + do with PyPI like pypinfo. This way you know what the project is designated for: + + .. image:: https://user-images.githubusercontent.com/1324225/47173020-986f3900-d315-11e8-90ab-4b2ecd85b88e.png + +5. The next page should show your new project. If not, reload the page and select from + the top menu: + + .. image:: https://user-images.githubusercontent.com/1324225/47173170-0b78af80-d316-11e8-879e-01f34e139b80.png + +**Enable BigQuery API** + +6. Go to ``_ + and make sure the correct project is chosen using the drop-down on top. Click + the ENABLE button: + + .. image:: https://user-images.githubusercontent.com/1324225/47173408-a6718980-d316-11e8-94c2-a17ff54fc389.png + +7. After enabling, click CREATE CREDENTIALS: + + .. image:: https://user-images.githubusercontent.com/1324225/47173432-bc7f4a00-d316-11e8-8152-6a0e6cfab70f.png + +8. Choose the "BigQuery API" and "No, I'm not using them": + + .. image:: https://user-images.githubusercontent.com/1324225/47173510-ec2e5200-d316-11e8-8508-2bfbb8f6b02f.png + +9. Fill in a name, and select role "BigQuery User" (if the "BigQuery" is not an option + in the list, wait 15-20 minutes and try creating the credentials again), and select a + JSON key: + + .. image:: https://user-images.githubusercontent.com/1324225/47173576-18e26980-d317-11e8-8bfe-e4775d965e32.png + +10. Click continue and the JSON will download to your computer. Note the download + location. Move the file wherever you want: + + .. image:: https://user-images.githubusercontent.com/1324225/47173614-331c4780-d317-11e8-9ed2-fc76557a2bf6.png + +11. ``pip install pypinfo`` +12. ``pypinfo --auth path/to/your_credentials.json``, or set an environment variable + ``GOOGLE_APPLICATION_CREDENTIALS`` that points to the file. + Credits ------- From 663597691771dd266979200b13edb8db335816ac Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 30 Nov 2022 15:41:28 +0200 Subject: [PATCH 2/2] Add table of contents --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index d710d27..28bb2e8 100644 --- a/README.rst +++ b/README.rst @@ -17,6 +17,10 @@ pypinfo: View PyPI download statistics with ease. pypinfo is a simple CLI to access `PyPI`_ download statistics via Google's BigQuery. +* `Usage <#usage>`_ +* `Installation <#installation>`_ +* `Credits <#credits>`_ + Usage -----