Skip to main content

SDK for the Ntropy API

Project description

Ntropy SDK

SDK for the Ntropy API

Installation:

$ pip install --upgrade 'ntropy-sdk[benchmark]'

Usage:

Programmatic usage for benchmarking:

Assuming you have a CSV file called testset.csv with the following fields set:

  • iso_currency_code: The currency of the transaction
  • amount: The amount (a positive number)
  • entry_type: incoming for money coming into the account, outgoing for money going out of the account
  • description: The transaction description string
  • account_holder_id: A unique identifier for the account holder
  • account_holder_type: A string indicating the type of the account of the transaction (business or consumer)
  • (optional) correct_merchant: A string that should match the merchant output of the API. If you combine this with --ground-truth-merchant-field=correct_merchant you will be given an accuracy % for the API.
  • (optional) correct_labels: The label that the transaction should be marked as. If you combine this with --ground-truth-label-field=correct_labels you will be given an F1 score for the API.
$ ntropy-benchmark --api-key=$NTROPY_API_KEY --in-csv-file=testset.csv --out-csv-file=enriched.csv --ground-truth-label-field=correct_labels

Using this as a python library:

import os
from ntropy_sdk.ntropy_sdk import SDK, Transaction

sdk = SDK(os.getenv("NTROPY_API_KEY"))

transaction = Transaction(
    amount=1.0,
    description="AMAZON WEB SERVICES AWS.AMAZON.CO WA Ref5543286P25S: Crd15",
    entry_type="outgoing",
    account_holder_id="1",
    account_holder_type="business",
    iso_currency_code="USD",
    country="US",
)

batch = sdk.enrich_batch([transaction])
enriched_list = batch.wait_with_progress()
print("BATCH", enriched_list.transactions[0].labels)

enriched = sdk.enrich(transaction)
print("REALTIME:", enriched.labels)

License:

Free software: MIT license

Project details


Release history Release notifications | RSS feed

This version

3.6.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ntropy_sdk-3.6.1.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ntropy_sdk-3.6.1-py2.py3-none-any.whl (9.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ntropy_sdk-3.6.1.tar.gz.

File metadata

  • Download URL: ntropy_sdk-3.6.1.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11

File hashes

Hashes for ntropy_sdk-3.6.1.tar.gz
Algorithm Hash digest
SHA256 ab026b28af280474d63aff806ff2203e39b1eef9c8c7813372d3c18dde1479ce
MD5 2dda493868c583a5402ff95237171c10
BLAKE2b-256 649fd5406c9c0e9ed15f126dcd6f753f8df70853e9e5027c5e4dfc532e837317

See more details on using hashes here.

File details

Details for the file ntropy_sdk-3.6.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ntropy_sdk-3.6.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11

File hashes

Hashes for ntropy_sdk-3.6.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5bcc71e5a2a638dc5b20075be0e8bb6b563376fbf018a9d7dbadc798a7a3bab3
MD5 f8efa9ab6087497cd8321ec6bba0c89d
BLAKE2b-256 7095d1b0ed80245e18fac52e97d1ff3524074e2a9a6c39f02dafb8df4b381b0b

See more details on using hashes here.

Supported by

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