diff --git a/.github/workflows/release_helper.yml b/.github/workflows/release_helper.yml index ecbce1e..873a87a 100644 --- a/.github/workflows/release_helper.yml +++ b/.github/workflows/release_helper.yml @@ -68,7 +68,7 @@ jobs: inv dist - uses: actions/upload-artifact@v2 with: - name: delphi_epidata + name: epidatpy - name: Upload Release Asset uses: AButler/upload-release-assets@v2.0 with: diff --git a/README.md b/README.md index 79d012c..f0f025e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Delphi Epidata Python Client +# Delphi Epidata Python Client `epidatpy` [![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] @@ -11,7 +11,13 @@ For a short-term fix, the package can be used with the old name by installing wi Install latest version: ```sh -pip install -e "git+https://github.com/cmu-delphi/delphi-epidata-py.git#egg=delphi_epidata" +pip install -e "git+https://github.com/cmu-delphi/epidatpy.git#egg=epidatpy" +``` + +old name version + +```sh +pip install -e "git+https://github.com/cmu-delphi/epidatpy.git@delphi_epidata-before-rename#egg=delphi_epidata" ``` ## Usage @@ -46,20 +52,20 @@ inv release # upload the current version to pypi The release consists of multiple steps which can be all done via the GitHub website: -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. -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) +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. +1. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/epidatpy/pulls) 1. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully 1. Once approved and merged, another GitHub action job starts which automatically will 1. create a git tag - 1. create another [Pull Request](https://github.com/cmu-delphi/delphi-epidata-py/pulls) to merge the changes back to the `dev` branch - 1. create a [GitHub release](https://github.com/cmu-delphi/delphi-epidata-py/releases) with automatically derived release notes + 1. create another [Pull Request](https://github.com/cmu-delphi/epidatpy/pulls) to merge the changes back to the `dev` branch + 1. create a [GitHub release](https://github.com/cmu-delphi/epidatpy/releases) with automatically derived release notes 1. Done [mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg [mit-url]: https://opensource.org/licenses/MIT -[github-actions-image]: https://github.com/cmu-delphi/delphi-epidata-py/workflows/ci/badge.svg -[github-actions-url]: https://github.com/cmu-delphi/delphi-epidata-py/actions -[pypi-image]: https://img.shields.io/pypi/v/delphi-epidata -[pypi-url]: https://pypi.python.org/pypi/delphi-epidata/ -[docs-image]: https://readthedocs.org/projects/delphi-epidata/badge/?version=latest -[docs-url]: https://delphi-epidata.readthedocs.io/en/latest/?badge=latest +[github-actions-image]: https://github.com/cmu-delphi/epidatpy/workflows/ci/badge.svg +[github-actions-url]: https://github.com/cmu-delphi/epidatpy/actions +[pypi-image]: https://img.shields.io/pypi/v/epidatpy +[pypi-url]: https://pypi.python.org/pypi/epidatpy/ +[docs-image]: https://readthedocs.org/projects/epidatpy/badge/?version=latest +[docs-url]: https://epidatpy.readthedocs.io/en/latest/?badge=latest diff --git a/docs/conf.py b/docs/conf.py index 593597c..8d506e1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,17 +12,18 @@ # import os import sys -sys.path.insert(0, os.path.abspath('..')) -sys.path.insert(0, os.path.abspath('../delphi_epidata')) + +sys.path.insert(0, os.path.abspath("..")) +sys.path.insert(0, os.path.abspath("../epidatpy")) # -- Project information ----------------------------------------------------- -project = 'Delphi Epidata API client' -copyright = '2021, Delphi research group' # pylint: disable=redefined-builtin -author = 'Delphi research group' +project = "Delphi Epidata API client" +copyright = "2021, Delphi research group" # pylint: disable=redefined-builtin +author = "Delphi research group" # The full version, including alpha/beta/rc tags -release = '1.0.0' +release = "1.0.0" # -- General configuration --------------------------------------------------- @@ -31,29 +32,29 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx_autodoc_typehints', + "sphinx.ext.autodoc", + "sphinx_autodoc_typehints", # 'matplotlib.sphinxext.plot_directive' ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] add_module_names = False -autoclass_content = 'class' -autodoc_typehints = 'description' +autoclass_content = "class" +autodoc_typehints = "description" # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = "alabaster" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -63,7 +64,7 @@ html_theme_options = { "extra_nav_links": { "Delphi group": "https://delphi.cmu.edu/", - "Delphi Epidata API": "https://cmu-delphi.github.io/delphi-epidata" + "Delphi Epidata API": "https://cmu-delphi.github.io/delphi-epidata", } } diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 41acba0..bc66233 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -16,7 +16,7 @@ Basic examples To obtain all available sources of epidemiological data, we can use the following command: ->>> from delphi_epidata.request import CovidcastEpidata, EpiRange +>>> from epidatpy.request import CovidcastEpidata, EpiRange >>> epidata = CovidcastEpidata() >>> print(list(epidata.source_names)) ['chng-cli', 'chng-covid', 'covid-act-now', 'doctor-visits', 'fb-survey', 'google-symptoms', 'hhs', 'hospital-admissions', 'indicator-combination-cases-deaths', 'jhu-csse', 'quidel-covid-ag', 'safegraph-weekly', 'usa-facts', 'ght', 'google-survey', 'indicator-combination-nmf', 'quidel-flu', 'safegraph-daily', 'nchs-mortality'] @@ -26,7 +26,7 @@ To obtain smoothed estimates of COVID-like illness from our symptom survey, distributed through Facebook (`fb-survey`), for every county in the United States between 2020-05-01 and 2020-05-07: ->>> from delphi_epidata.request import EpiRange +>>> from epidatpy.request import EpiRange >>> apicall = epidata[("fb-survey", "smoothed_cli")].call( ... 'county', "*", EpiRange(20200501, 20200507), ... ) diff --git a/docs/index.rst b/docs/index.rst index cc56da1..6fc903c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,12 +2,12 @@ Delphi Epi Data =============== This package provides Python access to the `Delphi Epidata API -`_ published by +`_ published by the `Delphi group `_ at `Carnegie Mellon University `_. The package source code and bug tracker can be found `on GitHub -`_. +`_. .. note :: **You should consider subscribing** to the `API mailing list @@ -29,12 +29,12 @@ Installation ------------ This package is available on PyPI as `covidcast -`_, and can be installed using ``pip`` or +`_, and can be installed using ``pip`` or your favorite Python package manager: .. code-block:: sh - pip install delphi-epidata + pip install epidatpy The package requires `pandas `_ and `requests `_; these should be installed diff --git a/docs/signals_covid.rst b/docs/signals_covid.rst index 78878bc..87fef9a 100644 --- a/docs/signals_covid.rst +++ b/docs/signals_covid.rst @@ -24,7 +24,7 @@ Metadata Many data sources and signals are available, so one can also obtain a data frame of all signals and their associated metadata: ->>> from delphi_epidata.request import CovidcastEpidata +>>> from epidatpy.request import CovidcastEpidata >>> covid_ds = CovidcastEpidata() >>> df_source = covid_ds.source_df >>> df_signal = covid_ds.signal_df @@ -34,12 +34,12 @@ which has the property ``source_df`` and ``signal_df``, two data frames containi the information of all available sources and signals. More details of the two data frames are listed below. -.. autoclass:: delphi_epidata.request.CovidcastDataSources() +.. autoclass:: epidatpy.request.CovidcastDataSources() :members: More metadata statistics can also be obtained as follows: ->>> from delphi_epidata.request import Epidata +>>> from epidatpy.request import Epidata >>> df = Epidata.covidcast_meta().df() -.. autofunction:: delphi_epidata.request.Epidata.covidcast_meta() \ No newline at end of file +.. autofunction:: epidatpy.request.Epidata.covidcast_meta() \ No newline at end of file diff --git a/delphi_epidata/__init__.py b/epidatpy/__init__.py similarity index 100% rename from delphi_epidata/__init__.py rename to epidatpy/__init__.py diff --git a/delphi_epidata/_constants.py b/epidatpy/_constants.py similarity index 61% rename from delphi_epidata/_constants.py rename to epidatpy/_constants.py index f72a93a..cf1b857 100644 --- a/delphi_epidata/_constants.py +++ b/epidatpy/_constants.py @@ -4,6 +4,6 @@ __version__: Final = "1.0.0" -HTTP_HEADERS: Final = {"User-Agent": f"delphi_epidata/{__version__}"} +HTTP_HEADERS: Final = {"User-Agent": f"epidatpy/{__version__}"} BASE_URL: Final = "https://delphi.cmu.edu/epidata/" diff --git a/delphi_epidata/_covidcast.py b/epidatpy/_covidcast.py similarity index 100% rename from delphi_epidata/_covidcast.py rename to epidatpy/_covidcast.py diff --git a/delphi_epidata/_endpoints.py b/epidatpy/_endpoints.py similarity index 100% rename from delphi_epidata/_endpoints.py rename to epidatpy/_endpoints.py diff --git a/delphi_epidata/_model.py b/epidatpy/_model.py similarity index 100% rename from delphi_epidata/_model.py rename to epidatpy/_model.py diff --git a/delphi_epidata/_parse.py b/epidatpy/_parse.py similarity index 100% rename from delphi_epidata/_parse.py rename to epidatpy/_parse.py diff --git a/delphi_epidata/async_request.py b/epidatpy/async_request.py similarity index 100% rename from delphi_epidata/async_request.py rename to epidatpy/async_request.py diff --git a/delphi_epidata/request.py b/epidatpy/request.py similarity index 100% rename from delphi_epidata/request.py rename to epidatpy/request.py diff --git a/pyproject.toml b/pyproject.toml index 495e3fc..5cc4f12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,4 @@ [tool.black] line-length = 120 target-version = ['py38'] -include = 'delphi_epidata' +include = 'epidatpy' diff --git a/setup.cfg b/setup.cfg index 3398f84..6e7cb2c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ current_version = 1.0.0 commit = False tag = False -[bumpversion:file:delphi_epidata/_version.py] +[bumpversion:file:epidatpy/_version.py] [bumpversion:file:docs/conf.py] [bdist_wheel] diff --git a/setup.py b/setup.py index 7bc9672..97e0211 100644 --- a/setup.py +++ b/setup.py @@ -3,14 +3,14 @@ setuptools.setup( - name="delphi_epidata", + name="epidatpy", version="1.0.0", author="Alex Reinhart", author_email="areinhar@stat.cmu.edu", description="A programmatic interface to Delphi's Epidata API.", - long_description=pathlib.Path('README.md').read_text(), + long_description=pathlib.Path("README.md").read_text(), long_description_content_type="text/markdown", - url="https://github.com/cmu-delphi/delphi-epidata-py", + url="https://github.com/cmu-delphi/epidatpy", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3", @@ -20,7 +20,7 @@ "Natural Language :: English", "Topic :: Scientific/Engineering :: Bio-Informatics", ], - python_requires='>=3.6', - install_requires=[f.strip() for f in pathlib.Path('requirements.txt').read_text().split('\n') if f], - # package_data={'delphi_epidata': []} + python_requires=">=3.6", + install_requires=[f.strip() for f in pathlib.Path("requirements.txt").read_text().split("\n") if f], + # package_data={'epidatpy': []} ) diff --git a/smoke_covid_test.py b/smoke_covid_test.py index 4fe5230..88e216d 100644 --- a/smoke_covid_test.py +++ b/smoke_covid_test.py @@ -1,4 +1,4 @@ -from delphi_epidata.request import CovidcastEpidata, EpiRange +from epidatpy.request import CovidcastEpidata, EpiRange epidata = CovidcastEpidata() print(list(epidata.source_names)) diff --git a/smoke_test.py b/smoke_test.py index 0e15310..081f7b0 100644 --- a/smoke_test.py +++ b/smoke_test.py @@ -1,5 +1,5 @@ from datetime import date -from delphi_epidata.request import Epidata, EpiRange +from epidatpy.request import Epidata, EpiRange apicall = Epidata.covidcast("fb-survey", "smoothed_cli", "day", "nation", EpiRange(20210405, 20210410), "us") diff --git a/smoke_test_async.py b/smoke_test_async.py index 7bafb6b..b26e09c 100644 --- a/smoke_test_async.py +++ b/smoke_test_async.py @@ -1,5 +1,5 @@ from asyncio import get_event_loop -from delphi_epidata.async_request import Epidata +from epidatpy.async_request import Epidata async def main() -> None: diff --git a/tasks.py b/tasks.py index 4753459..4cde5ba 100644 --- a/tasks.py +++ b/tasks.py @@ -17,7 +17,7 @@ ROOT_DIR = Path(__file__).parent SETUP_FILE = ROOT_DIR.joinpath("setup.py") TEST_DIR = ROOT_DIR.joinpath("tests") -SOURCE_DIR = ROOT_DIR.joinpath("delphi_epidata") +SOURCE_DIR = ROOT_DIR.joinpath("epidatpy") TOX_DIR = ROOT_DIR.joinpath(".tox") COVERAGE_FILE = ROOT_DIR.joinpath(".coverage") COVERAGE_DIR = ROOT_DIR.joinpath("htmlcov") diff --git a/tests/test_constants.py b/tests/test_constants.py index 4fe1aae..51fc325 100644 --- a/tests/test_constants.py +++ b/tests/test_constants.py @@ -1,4 +1,4 @@ -from delphi_epidata import __version__ +from epidatpy import __version__ def test_version() -> None: diff --git a/tests/test_model.py b/tests/test_model.py index 6835e5c..a8412cd 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -1,4 +1,4 @@ -from delphi_epidata._model import EpiRange, format_item, format_list +from epidatpy._model import EpiRange, format_item, format_list def test_epirange() -> None: