🇳🇬 ng-fintech-utils (Python)
A lightweight Python wrapper for the NG Fintech Utils API. Easily fetch Nigerian bank codes, NUBAN/sorting codes, and USSD strings directly in your Python applications.
📦 Installation
You can install the package directly from PyPI using pip:
pip install ng_fintech_utils
🚀 Getting Started
The package provides a simple, synchronous client to interact with the fintech data.
1. Initialization
Import the client and initialize it. By default, it connects to the live production API. (You can also pass a custom base_url for local testing).
from ng_fintech_utils.client import NG_FINTECH_UTILS
# Initialize the client
fintech = NG_FINTECH_UTILS()
# For local development against your Next.js server:
# fintech = NG_FINTECH_UTILS(base_url="http://localhost:3000/api")
2. Fetch All Banks
Retrieve a complete list of all supported commercial banks, their codes, and USSD strings.
banks = fintech.get_banks()
for bank in banks:
print(f"{bank['name']} - Code: {bank['code']} - USSD: {bank['ussd']}")
3. Fetch a Single Bank
You can look up a specific bank using its URL-friendly slug or its 3-digit code. This is great for resolving bank details dynamically during a checkout flow.
# Lookup by 3-digit code
gtb = fintech.get_bank("058")
print(gtb['name']) # Output: Guaranty Trust Bank
# Lookup by slug
access = fintech.get_bank("access-bank")
print(access['ussd']) # Output: *901#
🛠️ Error Handling
The client will return None if a specific bank is not found, making it easy to write clean conditional checks:
bank = fintech.get_bank("unknown-code")
if not bank:
print("Bank not found. Please check the code.")
If the API is unreachable or rate-limited, the client will raise an Exception with the corresponding HTTP status code.
🔗 Ecosystem
This package is part of the broader NG Fintech Utils project. If you are a frontend developer, you can also query our free REST API directly without this wrapper.
See the API Documentation for more details.
📄 License
MIT License
Release files for ng-fintech-utils 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ng_fintech_utils-0.1.0.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ng_fintech_utils-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.8 kB
Release files / ng_fintech_utils-0.1.0.tar.gz
| Download URL | ng_fintech_utils-0.1.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70f2c038df106b72fa8485a10c286bd085541da3f5544802c53cd31fc9a3a38a
|
|
BLAKE2b-256 checksum How to use checksums |
6c4e2183cb6e2b25aeb38649d3dc3dd4e91c84b99cf66a7b8360a8eeed1c3517
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Release files / ng_fintech_utils-0.1.0-py3-none-any.whl
| Download URL | ng_fintech_utils-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
900f91d2dc71d626f71bd7c31bbe94f20d06645bba536563cca164c4bf1a4ed1
|
|
BLAKE2b-256 checksum How to use checksums |
8f3b0dfddda752eff8d4bdaa7b0992800172990ddb06bdc7d5cdf8da73fbf8dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|