Skip to content

Commit b092dad

Browse files
committed
doc: iterate on all documentation pages, README
* switch default venv from env to .venv for uv * update gitignore
1 parent f7195ea commit b092dad

13 files changed

+342
-346
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ __pycache__
88
dist/
99
build/
1010
docs/_build
11-
env/
12-
venv/
11+
.venv/

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
.PHONY = venv, lint, test, clean, release
22

33
venv:
4-
python3.8 -m venv env
4+
python3.8 -m venv .venv
55

66
install: venv
7-
env/bin/python -m pip install --upgrade pip
8-
env/bin/pip install -e ".[dev]"
7+
.venv/bin/python -m pip install --upgrade pip
8+
.venv/bin/pip install -e ".[dev]"
99

1010
lint_ruff:
11-
env/bin/ruff check epidatpy tests
11+
.venv/bin/ruff check epidatpy tests
1212

1313
lint_mypy:
14-
env/bin/mypy epidatpy tests
14+
.venv/bin/mypy epidatpy tests
1515

1616
lint_pylint:
17-
env/bin/pylint epidatpy tests
17+
.venv/bin/pylint epidatpy tests
1818

1919
lint: lint_ruff lint_mypy lint_pylint
2020

2121
format:
22-
env/bin/ruff format epidatpy tests
22+
.venv/bin/ruff format epidatpy tests
2323

2424
test:
25-
env/bin/pytest .
25+
.venv/bin/pytest .
2626

2727
doc:
2828
@pandoc --version >/dev/null 2>&1 || (echo "ERROR: pandoc is required (install via your platform's package manager)"; exit 1)
29-
env/bin/sphinx-build -b html docs docs/_build
30-
env/bin/python -m webbrowser -t "docs/_build/index.html"
29+
.venv/bin/sphinx-build -b html docs docs/_build
30+
.venv/bin/python -m webbrowser -t "docs/_build/index.html"
3131

3232
clean_doc:
3333
rm -rf docs/_build
@@ -45,7 +45,7 @@ clean_python:
4545
clean: clean_doc clean_build clean_python
4646

4747
release: clean lint test
48-
env/bin/python -m build --sdist --wheel
48+
.venv/bin/python -m build --sdist --wheel
4949

5050
upload: release
51-
env/bin/twine upload dist/*
51+
.venv/bin/twine upload dist/*

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

5-
A Python client for the [Delphi Epidata API](https://cmu-delphi.github.io/delphi-epidata/). Still in development.
5+
The Python client for the [Delphi Epidata API](https://cmu-delphi.github.io/delphi-epidata/).
66

77
## Install
88

@@ -18,7 +18,23 @@ pip install epidatpy
1818

1919
## Usage
2020

21-
TODO
21+
```py
22+
from epidatpy import CovidcastEpidata, EpiDataContext, EpiRange
23+
24+
# All calls using the `epidata` object will now be cached for 7 days
25+
epidata = EpiDataContext(use_cache=True, cache_max_age_days=7)
26+
27+
# Obtain a DataFrame of the most up-to-date version of the smoothed covid-like illness (CLI)
28+
# signal from the COVID-19 Trends and Impact survey for the US
29+
epidata.pub_covidcast(
30+
data_source="jhu-csse",
31+
signals="confirmed_cumulative_num",
32+
geo_type="nation",
33+
time_type="day",
34+
geo_values="us",
35+
time_values=EpiRange(20210405, 20210410),
36+
).df()
37+
```
2238

2339
## Development
2440

@@ -35,8 +51,8 @@ make release # upload the current version to pypi
3551
make clean # clean build and docs artifacts
3652
```
3753

38-
Building the documentation additionally requires the Pandoc package. These commands can be used
39-
to install the package on common platforms (see the
54+
Building the documentation additionally requires the Pandoc package. These
55+
commands can be used to install the package on common platforms (see the
4056
[official documentation](https://pandoc.org/installing.html) for more options):
4157

4258
```sh

docs/conf.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@
3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3333
# ones.
34-
extensions = [
35-
"sphinx.ext.autodoc",
36-
"sphinx_autodoc_typehints",
37-
# 'matplotlib.sphinxext.plot_directive'
38-
"nbsphinx"
39-
]
34+
extensions = ["sphinx.ext.autodoc", "sphinx_autodoc_typehints", "nbsphinx"]
4035

4136
# Add any paths that contain templates here, relative to this directory.
4237
templates_path = ["_templates"]

docs/epidatpy.rst

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ epidatpy Reference
44
.. toctree::
55
:maxdepth: 4
66

7-
Submodules
8-
----------
9-
10-
Module contents
11-
---------------
12-
13-
.. automodule:: epidatpy
14-
:members:
15-
:undoc-members:
16-
:show-inheritance:
17-
187
epidatpy.request module
198
-----------------------
209

@@ -23,11 +12,11 @@ epidatpy.request module
2312
:undoc-members:
2413
:show-inheritance:
2514

26-
epidatpy.async\_request module
27-
------------------------------
15+
epidatpy._endpoints module
16+
-----------------------
2817

29-
.. automodule:: epidatpy.async_request
18+
.. automodule:: epidatpy._endpoints
3019
:members:
3120
:undoc-members:
3221
:show-inheritance:
33-
22+
:exclude-members: get_wildcard_equivalent_dates

0 commit comments

Comments
 (0)