Skip to main content

DBnomics Python Client

Project description

DBnomics Python client

Access DBnomics time series from Python.

This project relies on Python Pandas.

Tutorial

A tutorial is available as a Jupyter notebook.

Use with a proxy

This Python package uses requests, which is able to work with a proxy (HTTP/HTTPS, SOCKS). For more information, please check its documentation.

Install

pip install dbnomics

See also: https://pypi-hypernode.com/project/DBnomics/

Development

To work on dbnomics-python-client source code:

git clone https://git.nomics.world/dbnomics/dbnomics-python-client.git
cd dbnomics-python-client
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .

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:

dataframe = fetch_series(
    api_base_url='http://localhost:5000',
    provider_code='AMECO',
    dataset_code='ZUTN',
)

Or globally change the default API URL used by the dbnomics module, like this:

import dbnomics
dbnomics.default_api_base_url = "http://localhost:5000"

Open the demo notebook

Install jupyter if not already done, in a virtualenv:

pip install jupyter
jupyter notebook index.ipynb

Tests

Run tests:

# Only once
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install -e .

pytest

# Specify an alterate API URL
API_URL=http://localhost:5000 pytest

Release

To release a version on PyPI:

  • merge one or many feature branches into master (no need to do a release for every feature...)
  • update setup.py incrementing the package version (we use Semantic Versioning so determine if it's a major, minor or patch increment)
  • ensure the changelog is up to date
  • git commit setup.py CHANGELOG.md -m "Release"
  • create a Git tag with a v before version number and push it (git tag v1.2.0; git push; git push --tags)
  • the CI will run a job to publish the package on PyPI at https://pypi-hypernode.com/project/DBnomics/

It's advised to do pip install -e . to let your virtualenv know about the new version number.

Project details


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.2.2.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

DBnomics-1.2.2-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file DBnomics-1.2.2.tar.gz.

File metadata

  • Download URL: DBnomics-1.2.2.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for DBnomics-1.2.2.tar.gz
Algorithm Hash digest
SHA256 3933425232d1d818ccc211089a1c536f4978fc77d31c50a43973d692d3e66465
MD5 7f7fd238f2dc4db769e3031c6bb7a26f
BLAKE2b-256 1b786de516427a0cd7fffc38e3861489e076d57be194ba9c414d2d99c9ae9e76

See more details on using hashes here.

File details

Details for the file DBnomics-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: DBnomics-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for DBnomics-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f9d089a802686c685c9c19552cd280baee778cf7109b19e9449514f89eb8b56
MD5 87db52674af03a0d1ff9a22cb2c8bece
BLAKE2b-256 d687ab29aa4bb41aaad8f6d1db55c8b6eec0044243b72bdd42c3c7fdbe94aef7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page