Skip to content

Commit baaf548

Browse files
committed
Merge branch 'dev' into rzatserkovnyi/client-release-decouple
2 parents 9122bc0 + e423cb4 commit baaf548

File tree

7 files changed

+107
-85
lines changed

7 files changed

+107
-85
lines changed

.github/workflows/release-helper.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ jobs:
7676
- name: Install build dependencies
7777
run: |
7878
python -m pip install --upgrade pip
79-
pip install wheel twine
79+
pip install build wheel twine
8080
- name: Prepare package
8181
run: |
8282
cp src/client/*.py src/client/packaging/pypi/delphi_epidata/
8383
- name: Create release
8484
working-directory: src/client/packaging/pypi
8585
run: |
86-
python setup.py sdist bdist_wheel
86+
python -m build --sdist --wheel
8787
- uses: actions/upload-artifact@v2
8888
with:
8989
name: delphi_epidata_py
@@ -99,8 +99,8 @@ jobs:
9999
with:
100100
user: __token__
101101
password: ${{ secrets.DELPHI_PYPI_PROD_TOKEN }}
102-
packages_dir: src/client/packaging/pypi/dist/
103-
skip_existing: true
102+
packages-dir: src/client/packaging/pypi/dist/
103+
skip-existing: true
104104
# repository_url: https://test.pypi.org/legacy/
105105

106106
release_js_client:

docs/api/client_libraries.md

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,83 +6,81 @@ nav_order: 1
66

77
# Epidata API Client Libraries
88

9+
To access Delphi Epidata programmatically, we recommend our client libraries:
10+
11+
- R: [epidatr](https://cmu-delphi.github.io/epidatr/),
12+
- Python: [delphi-epidata](https://pypi.org/project/delphi-epidata/) (soon to be replaced with [epidatpy](https://github.com/cmu-delphi/epidatpy)),
13+
- Javascript: [delphi-epidata](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js).
14+
915
For anyone looking for COVIDCast data, please visit our [COVIDCast Libraries](covidcast_clients.md).
1016

11-
A full-featured Epidata client for R is available at
12-
[epidatr](https://github.com/cmu-delphi/epidatr) and
13-
[also on CRAN](https://cran.r-project.org/web/packages/epidatr/index.html).
14-
15-
We are currently working on a new full-featured Epidata client for Python. It is not ready
16-
for release yet, but you can track our development progress and help us test it out at
17-
[epidatpy](https://github.com/cmu-delphi/epidatpy).
18-
19-
In the meantime, minimalist Epidata clients remain available for
20-
[Python](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.py),
21-
[JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js),
22-
and
23-
[R (legacy)](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.R).
24-
The following samples show how to import the library and fetch Delphi's COVID-19
25-
Surveillance Streams from Facebook Survey CLI for county 06001, and days
17+
The following samples show how to import the library and fetch Delphi's
18+
COVID-19 Surveillance Streams from Facebook Survey CLI for county 06001 and days
2619
`20200401` and `20200405-20200414` (11 days total).
2720

2821
### R
2922

30-
````R
31-
# [Optional] configure your API key, if desired
32-
# Interactive. See https://cmu-delphi.github.io/epidatr/articles/epidatr.html#api-keys for details.
23+
Install [`epidatr` from CRAN](https://cran.r-project.org/package=epidatr)
24+
with `install.packages("epidatr")`.
25+
26+
```R
27+
# Configure API key interactively, if needed. See
28+
# https://cmu-delphi.github.io/epidatr/articles/epidatr.html#api-keys for details.
3329
#save_api_key()
34-
# Import
3530
library(epidatr)
36-
# Fetch data
3731
res <- pub_covidcast('fb-survey', 'smoothed_cli', 'county', 'day', geo_values = '06001',
3832
time_values = c(20200401, 20200405:20200414))
3933
cat(res)
40-
````
34+
```
4135

4236
### Python
4337

44-
Optionally install the [package from PyPI](https://pypi.org/project/delphi-epidata/) using pip(env):
45-
````bash
46-
pip install delphi-epidata
47-
````
38+
Install [`delphi-epidata` from PyPI](https://pypi.org/project/delphi-epidata/) with
39+
`pip install delphi-epidata`.
4840

49-
Otherwise, place
50-
[`delphi_epidata.py`](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.py)
51-
in the same directory as your Python script.
52-
53-
````python
54-
# Import
41+
```python
5542
from delphi_epidata import Epidata
56-
# [Optional] configure your API key, if desired
43+
# Configure API key, if needed.
5744
#Epidata.auth = ('epidata', <your API key>)
58-
# Fetch data
5945
res = Epidata.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401, Epidata.range(20200405, 20200414)], '06001')
6046
print(res['result'], res['message'], len(res['epidata']))
61-
````
47+
```
6248

6349
### JavaScript (in a web browser)
6450

65-
The minimalist JavaScript client does not currently support API keys. If you need API key support in JavaScript, contact [email protected].
51+
The minimalist JavaScript client does not currently support API keys.
52+
If you need API key support in JavaScript, contact [email protected].
6653

67-
````html
68-
<!-- Imports -->
54+
```html
6955
<script src="delphi_epidata.js"></script>
70-
<!-- Fetch data -->
7156
<script>
72-
EpidataAsync.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401, EpidataAsync.range(20200405, 20200414)], '06001').then((res) => {
73-
console.log(res.result, res.message, res.epidata != null ? res.epidata.length : 0);
57+
EpidataAsync.covidcast(
58+
"fb-survey",
59+
"smoothed_cli",
60+
"day",
61+
"county",
62+
[20200401, EpidataAsync.range(20200405, 20200414)],
63+
"06001"
64+
).then((res) => {
65+
console.log(
66+
res.result,
67+
res.message,
68+
res.epidata != null ? res.epidata.length : 0
69+
);
7470
});
7571
</script>
76-
````
72+
```
7773

7874
### R (legacy)
7975

76+
The old Delphi Epidata R client is available
77+
[here](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R),
78+
but its use is discouraged.
79+
8080
```R
81-
# [Optional] configure your API key, if desired
81+
# Configure API key, if needed.
8282
#option('epidata.auth', <your API key>)
83-
# Import
8483
source('delphi_epidata.R')
85-
# Fetch data
8684
res <- Epidata$covidcast('fb-survey', 'smoothed_cli', 'day', 'county', list(20200401, Epidata$range(20200405, 20200414)), '06001')
8785
cat(paste(res$result, res$message, length(res$epidata), "\n"))
8886
```

docs/api/covidcast_clients.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ nav_order: 1
66

77
# COVIDcast Libraries
88

9-
Dedicated COVIDcast access and analysis libraries are available for several languages:
9+
To access COVIDcast data, we recommend using the following client libraries:
1010

11-
* R: [covidcast](https://cmu-delphi.github.io/covidcast/covidcastR/)
12-
* Python: [covidcast](https://cmu-delphi.github.io/covidcast/covidcast-py/html/)
11+
- R: [epidatr](https://cmu-delphi.github.io/epidatr/),
12+
- Python: [covidcast](https://cmu-delphi.github.io/covidcast/covidcast-py/html/) (soon to be replaced with [epidatpy](https://github.com/cmu-delphi/epidatpy)).
1313

1414
These packages provide a convenient way to obtain COVIDcast data as a data frame
15-
ready to be used in further analyses and provide convenient mapping and
16-
analysis functions. For installation instructions and examples, consult their
17-
respective webpages.
15+
ready to be used in further analyses and provide convenient mapping and analysis
16+
functions. For installation instructions and examples, consult their respective
17+
webpages.
1818

19-
20-
To access Epidata datasets on other diseases, visit our [Epidata API Client Libraries)](client_libraries.md) documentation.
19+
To access Epidata datasets on other diseases, visit our
20+
[Epidata API Client Libraries](client_libraries.md) documentation.

src/client/packaging/pypi/.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ tag = False
55

66
[bumpversion:file:../../delphi_epidata.py]
77

8-
[bumpversion:file:setup.py]
8+
[bumpversion:file:pyproject.toml]

src/client/packaging/pypi/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable future changes to the `delphi_epidata` python client will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/).
55

6+
## [4.1.24] - 2024-06-06
7+
8+
### Includes
9+
- https://github.com/cmu-delphi/delphi-epidata/pull/1470
10+
11+
### Changed
12+
- Replaced `setup.py` with `pyproject.toml` for package metadata and build configuration.
13+
614
## [4.1.23] - 2024-05-31
715

816
### Includes
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This file was derived from the PyPA Sample Project
2+
# https://github.com/pypa/sampleproject
3+
4+
# Guide (user-friendly):
5+
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
6+
7+
# Specification (technical, formal):
8+
# https://packaging.python.org/en/latest/specifications/pyproject-toml/
9+
10+
11+
# Choosing a build backend:
12+
# https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend
13+
[build-system]
14+
# A list of packages that are needed to build your package:
15+
requires = ["setuptools"] # REQUIRED if [build-system] table is used
16+
# The name of the Python object that frontends will use to perform the build:
17+
build-backend = "setuptools.build_meta" # If not defined, then legacy behavior can happen.
18+
19+
[project]
20+
name = "delphi_epidata" # REQUIRED, is the only field that cannot be marked as dynamic.
21+
version = "4.1.23"
22+
description = "A programmatic interface to Delphi's Epidata API."
23+
readme = "README.md"
24+
license = { file = "LICENSE" }
25+
authors = [{ name = "David Farrow", email = "[email protected]" }]
26+
maintainers = [
27+
{ name = "Delphi Support", email = "[email protected]" },
28+
]
29+
# For a list of valid classifiers, see https://pypi.org/classifiers/
30+
classifiers = [
31+
"License :: OSI Approved :: MIT License",
32+
"Programming Language :: Python",
33+
"Programming Language :: Python :: 2",
34+
"Programming Language :: Python :: 3",
35+
"Operating System :: OS Independent",
36+
"Intended Audience :: Science/Research",
37+
"Natural Language :: English",
38+
"Topic :: Scientific/Engineering :: Bio-Informatics",
39+
]
40+
dependencies = ["aiohttp", "delphi-utils", "requests>=2.7.0", "tenacity"]
41+
42+
[project.urls]
43+
"Homepage" = "https://github.com/cmu-delphi/delphi-epidata"
44+
"Changelog" = "https://github.com/cmu-delphi/delphi-epidata/blob/main/src/client/packaging/pypi/CHANGELOG.md"

src/client/packaging/pypi/setup.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)