DBnomics Web API Client
Project description
# DBnomics Python client
Access DBnomics time series from Python.
This project relies on [Python Pandas](https://pandas.pydata.org/).
## Demo
A demo is available thanks to the [Binder project](https://mybinder.org/).
To launch the demo, click here: [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/dbnomics/dbnomics-python-client/master?filepath=index.ipynb) then wait a couple of seconds to be redirected to a Jupyter Notebook home page, displaying a list of files. In this list, click on `index.ipynb`. Then you'll be in a demo notebook, where you'll be able to play with the DBnomics Python client.
Unfortunately, Binder is only compatible with GitHub for now, and DBnomics is hosted on its own [GitLab platform](https://git.nomics.world/). That's why we created a mirror of this project [on GitHub](https://github.com/dbnomics/dbnomics-python-client), but the real home is [on DBnomics GitLab](https://git.nomics.world/dbnomics/dbnomics-python-client).
## Install
```sh
git clone https://git.nomics.world/dbnomics/dbnomics-python-client.git
cd dbnomics-python-client
pip install --editable .
```
## Development
If you plan to use a local Web API, running on the port 5000, you'll need to use the `api_base_url` parameter of the `fetch_*` functions, like this:
```python
dataframe = fetch_series(
api_base_url='http://localhost:5000',
provider_code='AMECO',
dataset_code='ZUTN',
)
```
Or set the default API URL by [monkey-patching](https://en.wikipedia.org/wiki/Monkey_patch) the `dbnomics` module, like this:
```python
import dbnomics
dbnomics.default_api_base_url = "http://localhost:5000"
```
## Tests
Run tests:
```bash
pytest tests/test_client.py
# Specify an alterate API URL
API_URL=http://localhost:5000 pytest tests/test_client.py
```
Access DBnomics time series from Python.
This project relies on [Python Pandas](https://pandas.pydata.org/).
## Demo
A demo is available thanks to the [Binder project](https://mybinder.org/).
To launch the demo, click here: [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/dbnomics/dbnomics-python-client/master?filepath=index.ipynb) then wait a couple of seconds to be redirected to a Jupyter Notebook home page, displaying a list of files. In this list, click on `index.ipynb`. Then you'll be in a demo notebook, where you'll be able to play with the DBnomics Python client.
Unfortunately, Binder is only compatible with GitHub for now, and DBnomics is hosted on its own [GitLab platform](https://git.nomics.world/). That's why we created a mirror of this project [on GitHub](https://github.com/dbnomics/dbnomics-python-client), but the real home is [on DBnomics GitLab](https://git.nomics.world/dbnomics/dbnomics-python-client).
## Install
```sh
git clone https://git.nomics.world/dbnomics/dbnomics-python-client.git
cd dbnomics-python-client
pip install --editable .
```
## Development
If you plan to use a local Web API, running on the port 5000, you'll need to use the `api_base_url` parameter of the `fetch_*` functions, like this:
```python
dataframe = fetch_series(
api_base_url='http://localhost:5000',
provider_code='AMECO',
dataset_code='ZUTN',
)
```
Or set the default API URL by [monkey-patching](https://en.wikipedia.org/wiki/Monkey_patch) the `dbnomics` module, like this:
```python
import dbnomics
dbnomics.default_api_base_url = "http://localhost:5000"
```
## Tests
Run tests:
```bash
pytest tests/test_client.py
# Specify an alterate API URL
API_URL=http://localhost:5000 pytest tests/test_client.py
```
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
DBnomics-1.0.0.tar.gz
(5.4 kB
view details)
Built Distribution
DBnomics-1.0.0-py3-none-any.whl
(17.1 kB
view details)
File details
Details for the file DBnomics-1.0.0.tar.gz
.
File metadata
- Download URL: DBnomics-1.0.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9095f5e7691a4d7eecdd2cc2df00ce9804218fa2579ad31b806614f6da9b5d54 |
|
MD5 | 73729a058e6d0619602f1bebeb89dc07 |
|
BLAKE2b-256 | 7f0af4d7dd47e61211c92182c0b212f1a77ce97c55cbda433b8957d31d4a9d2a |
File details
Details for the file DBnomics-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: DBnomics-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ff2b13229ce01bef80b4197d6207374840f9cba267adb7da68b43cdffe841c6 |
|
MD5 | 514ae95fe11c406302f512116bb84e41 |
|
BLAKE2b-256 | 698b42df3ad076b2389c02370f6ac08dee383c81aa96c7127be70c935f7c7e35 |