Skip to content

Commit 0720138

Browse files
authored
Add ci field: show how many installs were from a CI (#157)
1 parent 7a1c53c commit 0720138

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,22 @@ Estimated cost: $0.01
296296
| Total | | | 60 |
297297
```
298298

299+
Check how many downloads came from continuous integration servers:
300+
301+
```console
302+
pypinfo --percent --days 5 pillow ci
303+
Served from cache: False
304+
Data processed: 384.22 MiB
305+
Data billed: 385.00 MiB
306+
Estimated cost: $0.01
307+
308+
| ci | percent | download_count |
309+
| ----- | ------- | -------------- |
310+
| None | 79.37% | 11,963,127 |
311+
| True | 20.63% | 3,109,931 |
312+
| Total | | 15,073,058 |
313+
```
314+
299315
</details>
300316

301317
## Installation

pypinfo/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
OpenSSLVersion,
3838
Distro,
3939
DistroVersion,
40+
CI,
4041
CPU,
4142
Libc,
4243
LibcVersion,
@@ -67,6 +68,7 @@
6768
'system-release': SystemRelease,
6869
'distro': Distro,
6970
'distro-version': DistroVersion,
71+
'ci': CI,
7072
'cpu': CPU,
7173
'libc': Libc,
7274
'libc-version': LibcVersion,
@@ -121,7 +123,7 @@ def pypinfo(
121123
"""Valid fields are:\n
122124
project | version | file | pyversion | percent3 | percent2 | impl | impl-version |\n
123125
openssl | date | month | year | country | installer | installer-version |\n
124-
setuptools-version | system | system-release | distro | distro-version | cpu |\n
126+
setuptools-version | system | system-release | distro | distro-version | ci | cpu |\n
125127
libc | libc-version
126128
"""
127129
if auth:

pypinfo/fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
SystemRelease = Field('system_release', 'details.system.release')
2929
Distro = Field('distro_name', 'details.distro.name')
3030
DistroVersion = Field('distro_version', 'details.distro.version')
31+
CI = Field('ci', 'details.ci')
3132
CPU = Field('cpu', 'details.cpu')
3233
Libc = Field('libc_name', 'details.distro.libc.lib')
3334
LibcVersion = Field('libc_version', 'details.distro.libc.version')

0 commit comments

Comments
 (0)