Skip to main content

API client used to access Pngme's financial data APIs.

Project description

Pngme

Python API Client

This package exposes a synchronous and asynchronous client used to interact with Pngme's financial data APIs.

Install

Install the latest version with:

pip3 install pngme-api

Quick start

Create a Client instance using your API token found in the Pngme Dashboard:

from pngme.api import Client

token = "" # your API token
client = Client(token)

If you're using asyncio, you can import and use the AsyncClient instead.

We can list or search the available /users:

users = client.users.get()
users = client.users.get(search="2343456789012")

For a user of interest, we can get a list of the user's /institutions:

user_uuid = "33b6215d-3d75-4271-801c-6da27603a8be"

institutions = client.institutions.get(user_uuid=user_uuid)

Then for a given institution, we can get a list of the user's /transactions, /balances, or /alerts:

user_uuid = "33b6215d-3d75-4271-801c-6da27603a8be"
institution_id = "zenithbank"

transactions = client.transactions.get(user_uuid=user_uuid, institution_id=institution_id)
balances = client.balances.get(user_uuid=user_uuid, institution_id=institution_id)
alerts = client.alerts.get(user_uuid=user_uuid, institution_id=institution_id)

Development environment

We use Poetry to build, package, and publish this project. You'll need to install Poetry to use the development tools.

Clone this repo and install the development dependencies:

make install

You may need to configure your IDE to point to the newly created virtual environment after running install.

This will create a virtual environment in the .venv directory. You can activate the virtual environment with source .venv/bin/activate or poetry shell.

You can type make help to see a list of other options, which aren't strictly necessary as part of our day-to-day development practices.

Integration tests

You can replicate the integration tests (which run in a GitHub action on every push) locally. To do this, you'll need to set the PNGME_TOKEN environment variable with your API key from the Pngme Dashboard.

This can be done in 2 ways:

  1. Create a .env file from the template (.env.local) and set your PNGME_TOKEN there
cp .env.local .env
# set your PNGME_TOKEN in the .env file
make ci
  1. Or set the variable in your active shell and run the tests:
export PNGME_TOKEN=...
make ci

Dependencies

Production dependencies are listed in setup.cfg under options.install_requires, see setuptools dependency management.

Development dependencies are listed in requirements.txt.

Running make install will install both production and development dependencies. Running pip install . (where . is the path to the directory containing pyproject.toml) will install only the production dependencies.

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

pngme-api-0.7.0.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

pngme_api-0.7.0-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

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