Skip to content

Commit 4aae618

Browse files
authored
Rename files and library to pymetrics (#28)
* renamed repo * renamed repo * renamed repo * rename folder
1 parent 32a3e43 commit 4aae618

23 files changed

+71
-71
lines changed

.github/workflows/daily_collection.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uv pip install .
4141
- name: Collect PyPI Downloads
4242
run: |
43-
uv run download-analytics collect-pypi \
43+
uv run pymetrics collect-pypi \
4444
--verbose \
4545
--max-days ${{ inputs.max_days_pypi || 30 }} \
4646
--add-metrics \
@@ -50,7 +50,7 @@ jobs:
5050
BIGQUERY_CREDENTIALS: ${{ secrets.BIGQUERY_CREDENTIALS }}
5151
- name: Collect Anaconda Downloads
5252
run: |
53-
uv run download-analytics collect-anaconda \
53+
uv run pymetrics collect-anaconda \
5454
--output-folder gdrive://1UnDYovLkL4gletOF5328BG1X59mSHF-Z \
5555
--max-days ${{ inputs.max_days_anaconda || 90 }} \
5656
--verbose
@@ -72,6 +72,6 @@ jobs:
7272
uv pip install -U pip
7373
uv pip install -e .[dev]
7474
- name: Slack alert if failure
75-
run: uv run python -m download_analytics.slack_utils -r ${{ github.run_id }} -c ${{ github.event.inputs.slack_channel || 'sdv-alerts' }}
75+
run: uv run python -m pymetrics.slack_utils -r ${{ github.run_id }} -c ${{ github.event.inputs.slack_channel || 'sdv-alerts' }}
7676
env:
7777
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}

.github/workflows/daily_summarize.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uv pip install .
3131
- name: Run Summarize
3232
run: |
33-
uv run download-analytics summarize \
33+
uv run pymetrics summarize \
3434
--output-folder gdrive://10QHbqyvptmZX4yhu2Y38YJbVHqINRr0n
3535
env:
3636
PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }}
@@ -67,7 +67,7 @@ jobs:
6767
uv pip install .[dev]
6868
- name: Slack alert if failure
6969
run: |
70-
uv run python -m download_analytics.slack_utils \
70+
uv run python -m pymetrics.slack_utils \
7171
-r ${{ github.run_id }} \
7272
-c ${{ github.event.inputs.slack_channel || 'sdv-alerts' }} \
7373
-m 'Summarize Analytics build failed :fire: :dumpster-fire: :fire:'

.github/workflows/dryrun.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uv pip install .
2929
- name: Collect PyPI Downloads - Dry Run
3030
run: |
31-
uv run download-analytics collect-pypi \
31+
uv run pymetrics collect-pypi \
3232
--verbose \
3333
--max-days 30 \
3434
--add-metrics \
@@ -39,7 +39,7 @@ jobs:
3939
BIGQUERY_CREDENTIALS: ${{ secrets.BIGQUERY_CREDENTIALS }}
4040
- name: Collect Anaconda Downloads - Dry Run
4141
run: |
42-
uv run download-analytics collect-anaconda \
42+
uv run pymetrics collect-anaconda \
4343
--output-folder gdrive://1UnDYovLkL4gletOF5328BG1X59mSHF-Z \
4444
--max-days 90 \
4545
--verbose \
@@ -48,7 +48,7 @@ jobs:
4848
PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }}
4949
- name: Summarize - Dry Run
5050
run: |
51-
uv run download-analytics summarize \
51+
uv run pymetrics summarize \
5252
--verbose \
5353
--output-folder gdrive://10QHbqyvptmZX4yhu2Y38YJbVHqINRr0n \
5454
--dry-run

.github/workflows/manual.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uv pip install .
3737
- name: Collect Downloads Data
3838
run: |
39-
uv run download-analytics collect-pypi \
39+
uv run pymetrics collect-pypi \
4040
--verbose \
4141
--projects ${{ github.event.inputs.projects }} \
4242
${{ github.event.inputs.max_days && '--max-days ' || '' }} \

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Download Analytics
1+
# PyMetrics
22

3-
The Download Analytics project allows you to extract download metrics for Python libraries published on [PyPI](https://pypi.org/) and [Anaconda](https://www.anaconda.com/).
3+
The PyMetrics project allows you to extract download metrics for Python libraries published on [PyPI](https://pypi.org/) and [Anaconda](https://www.anaconda.com/).
44

55
The DataCebo team uses these scripts to report download counts for the libraries in the [SDV ecosystem](https://sdv.dev/) and other libraries.
66

77
## Overview
8-
The Download Analytics project is a collection of scripts and tools to extract information
8+
The PyMetrics project is a collection of scripts and tools to extract information
99
about OSS project downloads from different sources and to analyze them to produce user
1010
engagement metrics.
1111

docs/COLLECTED_DATA.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Data collected by Download Analytics
1+
# Data collected by PyMetrics
22

3-
The Download Analytics project collects data about downloads from multiple sources.
3+
The PyMetrics project collects data about downloads from multiple sources.
44

55
This guide explains the exact data that is being collected from each source, as well as
66
the aggregations metrics that are computed on them.
77

88
## PyPI Downloads
99

10-
Download Analytics collects information about the downloads from PyPI by making queries to the
10+
PyMetrics collects information about the downloads from PyPI by making queries to the
1111
[public PyPI download statistics dataset on BigQuery](https://console.cloud.google.com/bigquery?p=bigquery-public-data&d=pypi&page=dataset)
1212
by running the following query:
1313

@@ -51,7 +51,7 @@ the given time period, with the following columns:
5151

5252
## Aggregation Metrics
5353

54-
If the `--add-metrics` option is passed to `download-analytics`, a spreadsheet with aggregation
54+
If the `--add-metrics` option is passed to `pymetrics`, a spreadsheet with aggregation
5555
metrics will be created alongside the raw PyPI downloads CSV file for each individual project.
5656

5757
The aggregation metrics spreasheets contain the following tabs:

docs/DEVELOPMENT.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
# Download Analytics Development Guide
1+
# PyMetrics Development Guide
22

3-
This guide covers how to download and install **Download Analytics** to run it locally and
3+
This guide covers how to download and install **PyMetrics** to run it locally and
44
modify its code.
55

66
## Install
77

8-
**Download Analytics** is not released to any public Python package repository, so the only
8+
**PyMetrics** is not released to any public Python package repository, so the only
99
way to run it is to download the code from Github and install from source.
1010

11-
1. Clone the [github repository](https://github.com/datacebo/download-analytics)
11+
1. Clone the [github repository](https://github.com/datacebo/pymetrics)
1212

1313
```bash
14-
git clone [email protected]:datacebo/download-analytics
14+
git clone [email protected]:datacebo/pymetrics
1515
```
1616

1717
2. Create a `virtualenv` (or `conda` env) to host the project and its dependencies. The example
1818
below covers the creation of a `virtualenv` using `virtualenvwrapper` with Python 3.8.
1919

2020
```bash
21-
mkvirtualenv download-analytics -p $(which python3.8)
21+
mkvirtualenv pymetrics -p $(which python3.8)
2222
```
2323

2424
3. Enter the project folder and install the project:
2525

2626
```bash
27-
cd download-analytics
27+
cd pymetrics
2828
make install
2929
```
3030

3131
For development, run `make install-develop` instead.
3232

3333
## Command Line Interface
3434

35-
After the installation, a new `download-analytics` command will have been registered inside your
35+
After the installation, a new `pymetrics` command will have been registered inside your
3636
`virtualenv`. This command can be used in conjunction with the `collect-pypi` action to collect
3737
downloads data from BigQuery and store the output locally or in Google Drive.
3838

3939
Here is the entire list of arguments that the command line has:
4040

4141
```bash
42-
$ download-analytics collect-pypi --help
43-
usage: download-analytics collect-pypi [-h] [-v] [-l LOGFILE] [-o OUTPUT_FOLDER] [-a AUTHENTICATION_CREDENTIALS]
42+
$ pymetrics collect-pypi --help
43+
usage: pymetrics collect-pypi [-h] [-v] [-l LOGFILE] [-o OUTPUT_FOLDER] [-a AUTHENTICATION_CREDENTIALS]
4444
[-c CONFIG_FILE] [-p [PROJECTS [PROJECTS ...]]] [-s START_DATE]
4545
[-m MAX_DAYS] [-d] [-f] [-M]
4646

@@ -73,7 +73,7 @@ and store the downloads data into a Google Drive folder alongside the correspond
7373
metric spreadsheets would look like this:
7474
7575
```bash
76-
$ download-analytics collect-pypi --verbose --projects sdv ctgan --start-date 2021-01-01 \
76+
$ pymetrics collect-pypi --verbose --projects sdv ctgan --start-date 2021-01-01 \
7777
--add-metrics --output-folder gdrive://10QHbqyvptmZX4yhu2Y38YJbVHqINRr0n
7878
```
7979
@@ -83,7 +83,7 @@ have a look at the [COLLECTED_DATA.md](COLLECTED_DATA.md) document.
8383
## Python Interface
8484
8585
The Python entry point that is equivalent to the CLI explained above is the function
86-
`download_analytics.main.collect_downloads`.
86+
`pymetrics.main.collect_downloads`.
8787
8888
This function has the following interface:
8989

docs/SETUP.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Download Analytics Setup
1+
# PyMetrics Setup
22

3-
The Download Analytics project requires privileged access to the following resources:
3+
The PyMetrics project requires privileged access to the following resources:
44
- Google Drive, which is accessed via the `PyDrive` library.
55
- Google Big Query, which is accessed via the `google-cloud-bigquery` library.
66

@@ -31,10 +31,10 @@ if contains the application KEY which should never be made public.
3131
3232
Once the file is created, you can follow these steps:
3333
34-
1. Run the `download-analytics collect-pypi` command. If the `settings.yaml` file has been properly
34+
1. Run the `pymetrics collect-pypi` command. If the `settings.yaml` file has been properly
3535
created, this will **open a new tab on your web browser**, where you need to authenticate.
3636

37-
| ![pydrive-collect](imgs/pydrive-collect.png "Run the `download-analytics collect-pypi` Command") |
37+
| ![pydrive-collect](imgs/pydrive-collect.png "Run the `pymetrics collect-pypi` Command") |
3838
| - |
3939

4040
2. Click on the Google account which you which to authenticate with. Notice that the account that
@@ -67,7 +67,7 @@ be provided to you by a privileged admin.
6767
Once you have this JSON file, you have two options:
6868

6969
1. Pass the path to the authentication file with the `-a` or `--authentication-credentials`
70-
argument to the `download-analytics collect-pypi` command.
70+
argument to the `pymetrics collect-pypi` command.
7171

7272
| ![bigquery-a](imgs/bigquery-a.png "Pass the credentials on command line") |
7373
| - |
@@ -80,12 +80,12 @@ Once you have this JSON file, you have two options:
8080

8181
## Github Actions Setup
8282

83-
When using Download Analytics via Github Actions, the authentication credentials for Google
83+
When using PyMetrics via Github Actions, the authentication credentials for Google
8484
Drive and Big Query must be passed as repository `secrets`, which will later on be declared
8585
as environment variables.
8686

87-
1. Open the [Settings page of the Download Analytics repository](
88-
https://github.com/datacebo/download-analytics/settings/secrets/actions) and click on `Secrets`.
87+
1. Open the [Settings page of the PyMetrics repository](
88+
https://github.com/datacebo/pymetrics/settings/secrets/actions) and click on `Secrets`.
8989

9090
| ![secrets](imgs/secrets.png "Open the secrets page of the repository") |
9191
| - |

docs/WORKFLOWS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Download Analytics Workflows
1+
# PyMetrics Workflows
22

33
This document describes how to perform the two most common workflows:
44

@@ -65,13 +65,13 @@ after it is merged, the downloads of the new library will start to be added to t
6565

6666
## One Shot - Collecting data over a specific period.
6767

68-
Download Analytics is prepared to collect data for one or more libraries over a specific period
69-
using a [GitHub Actions Workflow](https://github.com/datacebo/download-analytics/actions/workflows/manual.yaml).
68+
PyMetrics is prepared to collect data for one or more libraries over a specific period
69+
using a [GitHub Actions Workflow](https://github.com/datacebo/pymetrics/actions/workflows/manual.yaml).
7070

7171
In order to do this, you will need to follow these steps:
7272

73-
1. Enter the [GitHub Actions Section of the repository](https://github.com/datacebo/download-analytics/actions)
74-
and click on the [Manual Collection Workflow](https://github.com/datacebo/download-analytics/actions/workflows/manual.yaml).
73+
1. Enter the [GitHub Actions Section of the repository](https://github.com/datacebo/pymetrics/actions)
74+
and click on the [Manual Collection Workflow](https://github.com/datacebo/pymetrics/actions/workflows/manual.yaml).
7575

7676
| ![manual-collection](imgs/manual-collection.png "Manual Collection Workflow") |
7777
| - |

0 commit comments

Comments
 (0)