Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci field: show how many installs were from a CI #157

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading