Skip to content

Commit aa05f2b

Browse files
authored
Merge branch 'package-intro' into lee14257/package-eval
2 parents 447a791 + 8659609 commit aa05f2b

23 files changed

+61
-57
lines changed

.github/workflows/release_helper.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
inv dist
6969
- uses: actions/upload-artifact@v2
7070
with:
71-
name: delphi_epidata
71+
name: epidatpy
7272
- name: Upload Release Asset
7373
uses: AButler/[email protected]
7474
with:

README.md

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
# Delphi Epidata Python Client
1+
# Delphi Epidata Python Client `epidatpy`
22

33
[![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url] [![PyPi][pypi-image]][pypi-url] [![Read the Docs][docs-image]][docs-url]
44

55
## Install
66

7-
Install from PyPi:
7+
**RENAME NOTICE (2022-08-05):** This package will be renamed to `epidatpy`.
8+
Please adjust all references to the package name accordingly.
9+
For a short-term fix, the package can be used with the old name by installing with `ref="delphi_epidata-before-rename"`.
10+
11+
Install latest version:
812

913
```sh
10-
pip install delphi-epidata
14+
pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy"
1115
```
1216

13-
latest version
17+
old name version
1418

1519
```sh
16-
pip install -e "git+https://github.com/cmu-delphi/delphi-epidata-py.git#egg=delphi_epidata"
20+
pip install -e "git+https://github.com/cmu-delphi/epidatpy.git@delphi_epidata-before-rename#egg=delphi_epidata"
1721
```
1822

1923
## Usage
@@ -48,20 +52,20 @@ inv release # upload the current version to pypi
4852

4953
The release consists of multiple steps which can be all done via the GitHub website:
5054

51-
1. Go to [create_release GitHub Action](https://github.com/cmu-delphi/delphi-epidata-py/actions/workflows/create_release.yml) and click the `Run workflow` button. Enter the next version number or one of the magic keywords (patch, minor, major) and hit the green `Run workflow` button.
52-
1. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/delphi-epidata-py/pulls)
55+
1. Go to [create_release GitHub Action](https://github.com/cmu-delphi/epidatpy/actions/workflows/create_release.yml) and click the `Run workflow` button. Enter the next version number or one of the magic keywords (patch, minor, major) and hit the green `Run workflow` button.
56+
1. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/epidatpy/pulls)
5357
1. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully
5458
1. Once approved and merged, another GitHub action job starts which automatically will
5559
1. create a git tag
56-
1. create another [Pull Request](https://github.com/cmu-delphi/delphi-epidata-py/pulls) to merge the changes back to the `dev` branch
57-
1. create a [GitHub release](https://github.com/cmu-delphi/delphi-epidata-py/releases) with automatically derived release notes
60+
1. create another [Pull Request](https://github.com/cmu-delphi/epidatpy/pulls) to merge the changes back to the `dev` branch
61+
1. create a [GitHub release](https://github.com/cmu-delphi/epidatpy/releases) with automatically derived release notes
5862
1. Done
5963

6064
[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
6165
[mit-url]: https://opensource.org/licenses/MIT
62-
[github-actions-image]: https://github.com/cmu-delphi/delphi-epidata-py/workflows/ci/badge.svg
63-
[github-actions-url]: https://github.com/cmu-delphi/delphi-epidata-py/actions
64-
[pypi-image]: https://img.shields.io/pypi/v/delphi-epidata
65-
[pypi-url]: https://pypi.python.org/pypi/delphi-epidata/
66-
[docs-image]: https://readthedocs.org/projects/delphi-epidata/badge/?version=latest
67-
[docs-url]: https://delphi-epidata.readthedocs.io/en/latest/?badge=latest
66+
[github-actions-image]: https://github.com/cmu-delphi/epidatpy/workflows/ci/badge.svg
67+
[github-actions-url]: https://github.com/cmu-delphi/epidatpy/actions
68+
[pypi-image]: https://img.shields.io/pypi/v/epidatpy
69+
[pypi-url]: https://pypi.python.org/pypi/epidatpy/
70+
[docs-image]: https://readthedocs.org/projects/epidatpy/badge/?version=latest
71+
[docs-url]: https://epidatpy.readthedocs.io/en/latest/?badge=latest

docs/conf.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212
#
1313
import os
1414
import sys
15-
sys.path.insert(0, os.path.abspath('..'))
16-
sys.path.insert(0, os.path.abspath('../delphi_epidata'))
15+
16+
sys.path.insert(0, os.path.abspath(".."))
17+
sys.path.insert(0, os.path.abspath("../epidatpy"))
1718

1819
# -- Project information -----------------------------------------------------
1920

20-
project = 'Delphi Epidata API client'
21-
copyright = '2021, Delphi research group' # pylint: disable=redefined-builtin
22-
author = 'Delphi research group'
21+
project = "Delphi Epidata API client"
22+
copyright = "2021, Delphi research group" # pylint: disable=redefined-builtin
23+
author = "Delphi research group"
2324

2425
# The full version, including alpha/beta/rc tags
25-
release = '1.0.0'
26+
release = "1.0.0"
2627

2728

2829
# -- General configuration ---------------------------------------------------
@@ -31,29 +32,29 @@
3132
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3233
# ones.
3334
extensions = [
34-
'sphinx.ext.autodoc',
35-
'sphinx_autodoc_typehints',
35+
"sphinx.ext.autodoc",
36+
"sphinx_autodoc_typehints",
3637
# 'matplotlib.sphinxext.plot_directive'
3738
]
3839

3940
# Add any paths that contain templates here, relative to this directory.
40-
templates_path = ['_templates']
41+
templates_path = ["_templates"]
4142

4243
# List of patterns, relative to source directory, that match files and
4344
# directories to ignore when looking for source files.
4445
# This pattern also affects html_static_path and html_extra_path.
45-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
46+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4647

4748
add_module_names = False
48-
autoclass_content = 'class'
49-
autodoc_typehints = 'description'
49+
autoclass_content = "class"
50+
autodoc_typehints = "description"
5051

5152
# -- Options for HTML output -------------------------------------------------
5253

5354
# The theme to use for HTML and HTML Help pages. See the documentation for
5455
# a list of builtin themes.
5556
#
56-
html_theme = 'alabaster'
57+
html_theme = "alabaster"
5758

5859
# Add any paths that contain custom static files (such as style sheets) here,
5960
# relative to this directory. They are copied after the builtin static files,
@@ -63,7 +64,7 @@
6364
html_theme_options = {
6465
"extra_nav_links": {
6566
"Delphi group": "https://delphi.cmu.edu/",
66-
"Delphi Epidata API": "https://cmu-delphi.github.io/delphi-epidata"
67+
"Delphi Epidata API": "https://cmu-delphi.github.io/delphi-epidata",
6768
}
6869
}
6970

docs/getting_started.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ An ``EpiRange`` object can be also used to construct a range of epiweeks or date
168168

169169
Basic examples
170170
--------------
171+
171172
**COVIDcast**
172173

173174
To obtain smoothed estimates of COVID-like illness from our symptom survey,
174175
distributed through Facebook, for every county in the United States between
175176
2020-05-01 and 2020-05-07:
176177

177-
>>> from datetime import date
178-
>>> from delphi_epidata.request import Epidata, EpiRange
178+
>>> from epidatpy.request import Epidata, EpiRange
179179
>>> apicall = Epidata.covidcast("fb-survey", "smoothed_cli",
180180
... "day", "county",
181181
... EpiRange(20200501, 20200507), "*")
@@ -194,7 +194,7 @@ column. The ``value`` is the requested signal - the smoothed
194194
estimate of the percentage of people with COVID-like illness based on the
195195
symptom surveys. The ``issue`` column indicates when this data was reported; in this case, the survey estimates for
196196
May 1st were updated on September 3rd based on new data, giving a ``lag`` of 125 days.
197-
See the :py:func:`delphi_epidata.request.Epidata.covidcast` documentation for further details on the returned
197+
See the :py:func:`epidatpy.request.Epidata.covidcast` documentation for further details on the returned
198198
columns.
199199

200200
In the above code, the ``.df()`` function on the ``apicall`` variable generated a Pandas DataFrame. We can use
@@ -259,7 +259,6 @@ command:
259259
.
260260
}]
261261

262-
Below are some other examples utilizing other Epidata endpoints and data sources.
263262

264263
|
265264

docs/index.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ Delphi Epidata
22
===============
33

44
This package provides Python access to the `Delphi Epidata API
5-
<https://cmu-delphi.github.io/delphi-epidata/api>`_ published by
5+
<https://cmu-delphi.github.io/delphi-epidata/>`_ published by
66
the `Delphi group <https://delphi.cmu.edu>`_ at `Carnegie Mellon University
77
<https://www.cmu.edu>`_.
88

99
The package source code and bug tracker can be found `on GitHub
10-
<https://github.com/cmu-delphi/delphi-epidata-py>`_.
10+
<https://github.com/cmu-delphi/epidatpy>`_.
1111

1212

1313
.. note :: **You should consider subscribing** to the `API mailing list
@@ -29,12 +29,12 @@ Installation
2929
------------
3030

3131
This package is available on PyPI as `covidcast
32-
<https://pypi.org/project/delphi-epidata/>`_, and can be installed using ``pip`` or
32+
<https://pypi.org/project/epidatpy/>`_, and can be installed using ``pip`` or
3333
your favorite Python package manager:
3434

3535
.. code-block:: sh
3636
37-
pip install delphi-epidata
37+
pip install epidatpy
3838
3939
The package requires `pandas <https://pandas.pydata.org/>`_ and `requests
4040
<https://requests.readthedocs.io/en/master/>`_; these should be installed

docs/signals_covid.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ More on COVIDcast (TODO)
105105
Many data sources and signals are available, so one can also obtain a data frame
106106
of all signals and their associated metadata:
107107

108-
>>> from delphi_epidata.request import CovidcastEpidata
108+
>>> from epidatpy.request import CovidcastEpidata
109109
>>> covid_ds = CovidcastEpidata()
110110
>>> df_source = covid_ds.source_df
111111
>>> df_signal = covid_ds.signal_df
@@ -115,12 +115,12 @@ which has the property ``source_df`` and ``signal_df``, two data frames containi
115115
the information of all available sources and signals.
116116
More details of the two data frames are listed below.
117117

118-
.. autoclass:: delphi_epidata.request.CovidcastDataSources()
118+
.. autoclass:: epidatpy.request.CovidcastDataSources()
119119
:members:
120120

121121
More metadata statistics can also be obtained as follows:
122122

123-
>>> from delphi_epidata.request import Epidata
123+
>>> from epidatpy.request import Epidata
124124
>>> df = Epidata.covidcast_meta().df()
125125

126-
.. autofunction:: delphi_epidata.request.Epidata.covidcast_meta()
126+
.. autofunction:: epidatpy.request.Epidata.covidcast_meta()
File renamed without changes.

delphi_epidata/_constants.py renamed to epidatpy/_constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
__version__: Final = "1.0.0"
55

66

7-
HTTP_HEADERS: Final = {"User-Agent": f"delphi_epidata/{__version__}"}
7+
HTTP_HEADERS: Final = {"User-Agent": f"epidatpy/{__version__}"}
88

99
BASE_URL: Final = "https://delphi.cmu.edu/epidata/"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
[tool.black]
33
line-length = 120
44
target-version = ['py38']
5-
include = 'delphi_epidata'
5+
include = 'epidatpy'

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ current_version = 1.0.0
33
commit = False
44
tag = False
55

6-
[bumpversion:file:delphi_epidata/_version.py]
6+
[bumpversion:file:epidatpy/_version.py]
77
[bumpversion:file:docs/conf.py]
88

99
[bdist_wheel]

setup.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44

55
setuptools.setup(
6-
name="delphi_epidata",
6+
name="epidatpy",
77
version="1.0.0",
88
author="Alex Reinhart",
99
author_email="[email protected]",
1010
description="A programmatic interface to Delphi's Epidata API.",
11-
long_description=pathlib.Path('README.md').read_text(),
11+
long_description=pathlib.Path("README.md").read_text(),
1212
long_description_content_type="text/markdown",
13-
url="https://github.com/cmu-delphi/delphi-epidata-py",
13+
url="https://github.com/cmu-delphi/epidatpy",
1414
packages=setuptools.find_packages(),
1515
classifiers=[
1616
"Programming Language :: Python :: 3",
@@ -20,7 +20,7 @@
2020
"Natural Language :: English",
2121
"Topic :: Scientific/Engineering :: Bio-Informatics",
2222
],
23-
python_requires='>=3.6',
24-
install_requires=[f.strip() for f in pathlib.Path('requirements.txt').read_text().split('\n') if f],
25-
# package_data={'delphi_epidata': []}
23+
python_requires=">=3.6",
24+
install_requires=[f.strip() for f in pathlib.Path("requirements.txt").read_text().split("\n") if f],
25+
# package_data={'epidatpy': []}
2626
)

smoke_covid_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from delphi_epidata.request import CovidcastEpidata, EpiRange
1+
from epidatpy.request import CovidcastEpidata, EpiRange
22

33
epidata = CovidcastEpidata()
44
print(list(epidata.source_names))

smoke_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datetime import date
2-
from delphi_epidata.request import Epidata, EpiRange
2+
from epidatpy.request import Epidata, EpiRange
33

44
apicall = Epidata.covidcast("fb-survey", "smoothed_cli", "day", "nation", EpiRange(20210405, 20210410), "us")
55

smoke_test_async.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from asyncio import get_event_loop
2-
from delphi_epidata.async_request import Epidata
2+
from epidatpy.async_request import Epidata
33

44

55
async def main() -> None:

tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ROOT_DIR = Path(__file__).parent
1818
SETUP_FILE = ROOT_DIR.joinpath("setup.py")
1919
TEST_DIR = ROOT_DIR.joinpath("tests")
20-
SOURCE_DIR = ROOT_DIR.joinpath("delphi_epidata")
20+
SOURCE_DIR = ROOT_DIR.joinpath("epidatpy")
2121
TOX_DIR = ROOT_DIR.joinpath(".tox")
2222
COVERAGE_FILE = ROOT_DIR.joinpath(".coverage")
2323
COVERAGE_DIR = ROOT_DIR.joinpath("htmlcov")

tests/test_constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from delphi_epidata import __version__
1+
from epidatpy import __version__
22

33

44
def test_version() -> None:

tests/test_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from delphi_epidata._model import EpiRange, format_item, format_list
1+
from epidatpy._model import EpiRange, format_item, format_list
22

33

44
def test_epirange() -> None:

0 commit comments

Comments
 (0)