Ntropy SDK
raw JSON → 5.3.0 verified Fri May 01 auth: no python
SDK for the Ntropy API, enabling financial transaction enrichment and categorization. Current version 5.3.0, actively maintained with weekly releases.
pip install ntropy-sdk Common errors
error TypeError: __init__() missing 1 required positional argument: 'api_key' ↓
cause Ntropy() called without API key argument and NTROPY_API_KEY not set in environment.
fix
Set NTROPY_API_KEY environment variable or pass api_key='your_key_here'.
error ntropy_sdk.exceptions.NtropyError: 401 - Unauthorized ↓
cause Invalid or expired API key.
fix
Verify your API key at https://dashboard.ntropy.com/ and pass the correct one.
error AttributeError: module 'ntropy_sdk' has no attribute 'Ntropy' ↓
cause Importing from old package name 'ntropy' (pre-v3) instead of 'ntropy_sdk'.
fix
Change import to 'from ntropy_sdk import Ntropy'.
Warnings
deprecated The SDK v4.x deprecated synchronous client initialization; ntropy_sdk.Ntropy now requires async context manager in newer versions. ↓
fix Use 'async with ntropy_sdk.Ntropy(api_key) as sdk:' pattern for async operations, or rely on default sync mode in v5.3.
breaking In v5, the 'Transaction' model fields 'description' and 'amount' are mandatory; previously they were optional. ↓
fix Ensure all transaction creates include 'description' and 'amount'.
gotcha API key is required but can be set via environment variable NTROPY_API_KEY. The SDK reads this automatically if no argument is passed to Ntropy(). ↓
fix Set NTROPY_API_KEY environment variable before using SDK.
Imports
- Ntropy wrong
import ntropycorrectfrom ntropy_sdk import Ntropy - NtropyError wrong
from ntropy_sdk.errors import NtropyErrorcorrectfrom ntropy_sdk import NtropyError
Quickstart
from ntropy_sdk import Ntropy
import os
api_key = os.environ.get('NTROPY_API_KEY', '')
sdk = Ntropy(api_key)
try:
account_holder = sdk.account_holders.create(type='business', business_name='Test Inc')
print(account_holder.id)
except Exception as e:
print(e)