Skip to content

Commit

Permalink
Add ci field: show how many installs were from a CI (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Feb 25, 2024
1 parent 7a1c53c commit 0720138
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,22 @@ Estimated cost: $0.01
| Total | | | 60 |
```

Check how many downloads came from continuous integration servers:

```console
pypinfo --percent --days 5 pillow ci
Served from cache: False
Data processed: 384.22 MiB
Data billed: 385.00 MiB
Estimated cost: $0.01

| ci | percent | download_count |
| ----- | ------- | -------------- |
| None | 79.37% | 11,963,127 |
| True | 20.63% | 3,109,931 |
| Total | | 15,073,058 |
```

</details>

## Installation
Expand Down
4 changes: 3 additions & 1 deletion pypinfo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
OpenSSLVersion,
Distro,
DistroVersion,
CI,
CPU,
Libc,
LibcVersion,
Expand Down Expand Up @@ -67,6 +68,7 @@
'system-release': SystemRelease,
'distro': Distro,
'distro-version': DistroVersion,
'ci': CI,
'cpu': CPU,
'libc': Libc,
'libc-version': LibcVersion,
Expand Down Expand Up @@ -121,7 +123,7 @@ def pypinfo(
"""Valid fields are:\n
project | version | file | pyversion | percent3 | percent2 | impl | impl-version |\n
openssl | date | month | year | country | installer | installer-version |\n
setuptools-version | system | system-release | distro | distro-version | cpu |\n
setuptools-version | system | system-release | distro | distro-version | ci | cpu |\n
libc | libc-version
"""
if auth:
Expand Down
1 change: 1 addition & 0 deletions pypinfo/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
SystemRelease = Field('system_release', 'details.system.release')
Distro = Field('distro_name', 'details.distro.name')
DistroVersion = Field('distro_version', 'details.distro.version')
CI = Field('ci', 'details.ci')
CPU = Field('cpu', 'details.cpu')
Libc = Field('libc_name', 'details.distro.libc.lib')
LibcVersion = Field('libc_version', 'details.distro.libc.version')
Expand Down

0 comments on commit 0720138

Please sign in to comment.