Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update reqs and contrib guide
  • Loading branch information
gribok committed Apr 3, 2020
commit afb6415d61adafeb826533c2c98aad45358467c8
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Please write new test cases for new code you create.
* If you're unable to find an open issue, [open a new one](https://github.com/ExpDev07/coronavirus-tracker-api/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible
* Open a new [GitHub Pull Request to coronavirus-tracker-api](https://github.com/ExpDev07/coronavirus-tracker-api/pulls) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)). Include the relevant issue number if applicable.
* We will love you forever if you include unit tests. We can always use more test coverage
* If you have updated [Pipefile](./Pipfile), you have to update `Pipfile.lock`, `requirements.txt` and `requirements-dev.txt`. See section [Update requirements files](./README.md#update-requirements-files).

## Your First Code Contribution

Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ Support multiple data-sources.

Currently 2 different data-sources are available to retrieve the data:

* **jhu** - https://github.com/CSSEGISandData/COVID-19 - Worldwide Data repository operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE).
* **jhu** - https://github.com/CSSEGISandData/COVID-19 - Worldwide Data repository operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE).

* **csbs** - https://www.csbs.org/information-covid-19-coronavirus - U.S. County data that comes from the Conference of State Bank Supervisors.

__jhu__ data-source will be used as a default source if you don't specify a *source parameter* in your request.

## API Reference

All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL:
All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL:
*[https://coronavirus-tracker-api.herokuapp.com/v2/locations](https://coronavirus-tracker-api.herokuapp.com/v2/locations)*

You can open the URL in your browser to further inspect the response. Or you can make this curl call in your terminal to see the prettified response:
Expand All @@ -56,7 +56,7 @@ Consume our API through [our super awesome and interactive SwaggerUI](https://co

The [OpenAPI](https://swagger.io/docs/specification/about/) json definition can be downloaded at https://coronavirus-tracker-api.herokuapp.com/openapi.json

## API Endpoints
## API Endpoints

### Sources Endpoint

Expand Down Expand Up @@ -365,7 +365,7 @@ These are the available API wrappers created by the community. They are not nece

### C#

* [CovidSharp by @Abdirahiim](https://github.com/Abdirahiim/covidtrackerapiwrapper)
* [CovidSharp by @Abdirahiim](https://github.com/Abdirahiim/covidtrackerapiwrapper)
* [Covid19Tracker.NET by @egbakou](https://github.com/egbakou/Covid19Tracker.NET)

### Python
Expand Down Expand Up @@ -408,7 +408,7 @@ You will need the following things properly installed on your computer.
3. Create virtual environment and install all dependencies `$ pipenv sync --dev`
4. Activate/enter the virtual environment `$ pipenv shell`

And don't despair if don't get the python setup working on the first try. No one did. Guido got pretty close... once. But that's another story. Good luck.
And don't despair if don't get the python setup working on the first try. No one did. Guido got pretty close... once. But that's another story. Good luck.

## Running / Development

Expand Down Expand Up @@ -437,6 +437,14 @@ pipenv run lint
pipenv run fmt
```

### Update requirements files

```bash
invoke generate-reqs
```

[Pipfile.lock](./Pipfile.lock) will be automatically updated during `pipenv install`.

### Building

### Deploying
Expand Down
8 changes: 8 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-i https://pypi.org/simple
appdirs==1.4.3
astroid==2.3.3
async-asgi-testclient==1.4.4
async-generator==1.10
asyncmock==0.4.2
attrs==19.3.0
bandit==1.6.2
black==19.10b0
Expand All @@ -13,18 +16,22 @@ docopt==0.6.2
gitdb==4.0.2
gitpython==3.1.0
idna==2.9
importlib-metadata==1.6.0 ; python_version < '3.8'
invoke==1.4.1
isort==4.3.21
lazy-object-proxy==1.4.3
mccabe==0.6.1
mock==4.0.2
more-itertools==8.2.0
multidict==4.7.5
packaging==20.3
pathspec==0.7.0
pbr==5.4.4
pluggy==0.13.1
py==1.8.1
pylint==2.4.4
pyparsing==2.4.6
pytest-asyncio==0.10.0
pytest-cov==2.8.1
pytest==5.4.1
pyyaml==5.3.1
Expand All @@ -38,3 +45,4 @@ typed-ast==1.4.1
urllib3==1.25.8
wcwidth==0.1.9
wrapt==1.11.2
zipp==3.1.0
10 changes: 9 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
-i https://pypi.org/simple
aiohttp==3.6.2
async-timeout==3.0.1
asyncache==0.1.1
attrs==19.3.0
cachetools==4.0.0
certifi==2019.11.28
chardet==3.0.4
click==7.1.1
fastapi==0.53.1
dataclasses==0.6 ; python_version < '3.7'
fastapi==0.53.2
gunicorn==20.0.4
h11==0.9.0
httptools==0.1.1 ; sys_platform != 'win32' and sys_platform != 'cygwin' and platform_python_implementation != 'PyPy'
idna-ssl==1.1.0 ; python_version < '3.7'
idna==2.9
multidict==4.7.5
pydantic==1.4
python-dateutil==2.8.1
python-dotenv==0.12.0
Expand All @@ -18,3 +25,4 @@ urllib3==1.25.8
uvicorn==0.11.3
uvloop==0.14.0 ; sys_platform != 'win32' and sys_platform != 'cygwin' and platform_python_implementation != 'PyPy'
websockets==8.1
yarl==1.4.2
7 changes: 7 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ def lint(ctx):
def test(ctx):
"""Run pytest tests."""
ctx.run(" ".join(["pytest", "-v"]))

@invoke.task
def generate_reqs(ctx):
"""Generate requirements.txt"""
reqs = ["pipenv lock -r > requirements.txt",
"pipenv lock -r --dev > requirements-dev.txt"]
[ctx.run(req) for req in reqs]