Skip to main content

Xfina Logo

Xfina (Python Bindings)

Crates.io PyPI npm

Xfina is a blazingly fast library for parsing Indian financial statements (Bank Accounts, Credit Cards, Mutual Funds) and international brokers (IBKR), written in Rust and exposed to Python via PyO3.

It converts raw PDFs, Excel files, and CSVs into structured, ReBIT-compliant JSON dictionaries in milliseconds.

Installation

pip install xfina

Quick Start

The Python bindings expose the same entry point as the Rust core. To keep the core parsing logic as pure functions without side-effects (like file I/O), the library requires raw bytes to be passed in rather than file paths.

Parsing a Credit Card Statement

import xfina

with open("statement.xls", "rb") as fh:
    data = fh.read()

# Hand over the bytes; the format is worked out from the content.
statement = xfina.parse(data, filename="statement.xls")

statement["format"]       # "ba-hdfc"
statement["category"]     # "bank_account"
statement["institution"]  # "HDFC Bank"
statement["detection"]    # how it was identified, plus the file's metadata
statement["validation"]   # the two-level validation report
statement["data"]         # the account, in the requested schema

# ReBIT output, or a pinned format that skips detection:
xfina.parse(data, schema="rebit")
xfina.parse(data, **{"as": "ba-hdfc"})

Failures raise xfina.XfinaParseError, which is where this differs from the JS binding: exceptions are the idiom here, so the same information arrives as attributes rather than in an error envelope.

try:
    xfina.parse(data, filename=name)
except xfina.XfinaParseError as e:
    if e.kind == "password_required":
        prompt_for_password(e.format)   # the format the filename suggested

The four functions

Function Purpose
parse(bytes, password=None, filename=None, modified_timestamp=None, **{"as": None}, schema=None) Identify and parse a statement.
detect(bytes, password=None, filename=None, modified_timestamp=None) Identify a statement without parsing it.
formats() Every format this build knows, with id, category, institution, containers and enabled.
version() The version of the parsers actually running.

Metadata

Release files for xfina 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xfina 0.9.0
File Size Uploaded Provenance Actions
xfina-0.9.0.tar.gz 230.2 kB With provenance Details for xfina-0.9.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for xfina 0.9.0
File Actions
xfina-0.9.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for xfina-0.9.0-cp38-abi3-win_amd64.whl
xfina-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for xfina-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
xfina-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for xfina-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
xfina-0.9.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for xfina-0.9.0-cp38-abi3-macosx_11_0_arm64.whl
xfina-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for xfina-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 12.8 MB

Release files / xfina-0.9.0.tar.gz

Download URL xfina-0.9.0.tar.gz
Size 230.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0d0c81ac4cd6b699240fb97639e0614587f4942e70c1829b679f178aaf945b4a
BLAKE2b-256 checksum
How to use checksums
1ee64316a7a9fcf66355768890c9f99854c094b1d052c264142feb5517c2234d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / xfina-0.9.0-cp38-abi3-win_amd64.whl

Download URL xfina-0.9.0-cp38-abi3-win_amd64.whl
Size 2.3 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a1cfcf3f2772e85f2366929e48daf50b33a66fe5f4723dfe3daa2e9cc0f512fd
BLAKE2b-256 checksum
How to use checksums
0a6f84241283ade358a5d72941ab1ac57d02a1dffb94c59d4fd4471d58a4794a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / xfina-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL xfina-0.9.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.7 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e057f906b809a8ef6377c8f7ee38182487c2964d2dd5202054b046ea4fca9edf
BLAKE2b-256 checksum
How to use checksums
a221490429d6fd1fb9e77221c5e6282f2367909a100a53cb837e82d97971337c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / xfina-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL xfina-0.9.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.7 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
cb2735a22963cac4b5c495e8090c30015fe32649593f673a3e00753d1e826a56
BLAKE2b-256 checksum
How to use checksums
56e38f6f9dcb1d1e94651198e1f13741af16eb61beb8902f741c4d3a2adb26ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / xfina-0.9.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL xfina-0.9.0-cp38-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f8f4acaf88ee3cd27e520bdfe33650eccfc88350cb02648cf3df0ab3c98a0191
BLAKE2b-256 checksum
How to use checksums
cba3400a902cf34800609e2cbbc2ee2db4a44f24f32edee9cb5d101f3d0d3043
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / xfina-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL xfina-0.9.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ef3cec51a59a53d1c847d8c86066f35911fbdce2c39ff1002546ac697f657287
BLAKE2b-256 checksum
How to use checksums
4dfea3169b7ad8a4a5c42ee1f8da215b7f9b4f8b8f7ba02af3fbe373c70a2e40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Security for xfina 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for xfina-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page