An example for API client using python request library
Project description
# Python API Client
An example for API client using python [request](https://docs.python-requests.org/) library.
tests directory has an example to call an weather reporting API(https://weather.tsukumijima.net/), an API that returns Japanese weather prediction data reported by Meteorological Agency in Japan, compatible with deprecated livedoor API.
—
## Usage (by running test)
### case1: run by python venv
`bash $ cd concurrent-api-client $ python -m venv venv $ source venv/bin/activate $ (venv) pytest -s # -s option returns standard output. $ (venv) deactivate $ `
### case2: run by tox with testing with multiple python versions
tox.ini has some python interpreters definition (e.g. py37, py38, py39) You can setup multiple python versions by [pyenv](https://github.com/pyenv/pyenv). Install pyenv and setup python versions (e.g. pyenv install 3.7.8 3.8.6 3.9.7) `
`bash $ cd concurrent-api-client $ pyenv local 3.7.8 3.8.6 3.9.7 # you need to setup multiple versions that are relevant with `envlist` in `tox.ini` $ tox -r # -r option recreates virtual environment. Once you configure it, you can just run `tox` for later test. `
You can see output in log/api_clint.log
—
## Workflow with pip and pip-tools (on package update)
Please see [note](https://note.hommalab.io/posts/python/python-dependency-management/)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file concurrent-api-client-0.0.1.tar.gz
.
File metadata
- Download URL: concurrent-api-client-0.0.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05d9ac1b4081820a153e1ec38300a16bf774a67b956477866c78e754fe49ebd3 |
|
MD5 | 500409f5979b0826f5a93319ec042b8c |
|
BLAKE2b-256 | ac5ce90d00951f81bde662c5cf6cffc797012b3b027b11f2a4640795b35d3972 |
File details
Details for the file concurrent_api_client-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: concurrent_api_client-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adc04e762b23d3a17792f07e8dc12ba6e43b21bd7cd1559db121f47122569d60 |
|
MD5 | e74c0457b23043edc9f2b17f3626d4e8 |
|
BLAKE2b-256 | c3738ef3bebc834d7bc8df80ef66658aa3e8c4d18c87aa6feeffecf667ba1194 |