Xfina (Python Bindings)
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. |
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xfina-0.6.0.tar.gz.
File metadata
- Download URL: xfina-0.6.0.tar.gz
- Upload date:
- Size: 221.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbd35512c8fe2cec00d04213a3de471ed2e5789092368669d234876f9786d354
|
|
| MD5 |
60e0d8d33cd4a4efeebcc76e369f6854
|
|
| BLAKE2b-256 |
e0d32e6dcbb2726c3585126f9f1063d35ded16fcc9454a3d296d28b6888a8611
|
Provenance
The following attestation bundles were made for xfina-0.6.0.tar.gz:
Publisher:
publish.yml on sakthipriyan/xfina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfina-0.6.0.tar.gz -
Subject digest:
fbd35512c8fe2cec00d04213a3de471ed2e5789092368669d234876f9786d354 - Sigstore transparency entry: 2807794606
- Sigstore integration time:
-
Permalink:
sakthipriyan/xfina@cede840745e39a1dd45f77187be999bed31b3e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/sakthipriyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cede840745e39a1dd45f77187be999bed31b3e93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xfina-0.6.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: xfina-0.6.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11436569201d5697e1c7ff0b16ece2d7d3e06a95bc57b1b201221c9ea89237d4
|
|
| MD5 |
5c03ed1ea2bfd65abaafa94bf0151ad0
|
|
| BLAKE2b-256 |
b3994a3f0d285a1fe0da2e016c9ba2553bab2224e1480d4b233679085d14327e
|
Provenance
The following attestation bundles were made for xfina-0.6.0-cp38-abi3-win_amd64.whl:
Publisher:
publish.yml on sakthipriyan/xfina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfina-0.6.0-cp38-abi3-win_amd64.whl -
Subject digest:
11436569201d5697e1c7ff0b16ece2d7d3e06a95bc57b1b201221c9ea89237d4 - Sigstore transparency entry: 2807795093
- Sigstore integration time:
-
Permalink:
sakthipriyan/xfina@cede840745e39a1dd45f77187be999bed31b3e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/sakthipriyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cede840745e39a1dd45f77187be999bed31b3e93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xfina-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: xfina-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6557044137d1f376f8a754361b8398087dacb75867af89a49406b13fb1e90bf0
|
|
| MD5 |
c044b87edd4ceee169167d3ea7beb093
|
|
| BLAKE2b-256 |
0e45e0f4f9e08376d70f9afacf9f44408000ba1e78da53426a85dfa538b5899a
|
Provenance
The following attestation bundles were made for xfina-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on sakthipriyan/xfina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfina-0.6.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
6557044137d1f376f8a754361b8398087dacb75867af89a49406b13fb1e90bf0 - Sigstore transparency entry: 2807794874
- Sigstore integration time:
-
Permalink:
sakthipriyan/xfina@cede840745e39a1dd45f77187be999bed31b3e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/sakthipriyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cede840745e39a1dd45f77187be999bed31b3e93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xfina-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: xfina-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a4db0c632aa0491484cf4daaf3dac286377d033b1dd8b07dba9beab3e69bf3b
|
|
| MD5 |
3a583b52f4332db1a79ca2555954e54a
|
|
| BLAKE2b-256 |
30968588143d565b6975b1b36b23ef405c0e608303c3d24787f69aa398365509
|
Provenance
The following attestation bundles were made for xfina-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on sakthipriyan/xfina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfina-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
7a4db0c632aa0491484cf4daaf3dac286377d033b1dd8b07dba9beab3e69bf3b - Sigstore transparency entry: 2807794799
- Sigstore integration time:
-
Permalink:
sakthipriyan/xfina@cede840745e39a1dd45f77187be999bed31b3e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/sakthipriyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cede840745e39a1dd45f77187be999bed31b3e93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xfina-0.6.0-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: xfina-0.6.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e911b1e581c3c98a5d23af5027ce12f41d24193ecd1dbe2b56676ce6a9ca456
|
|
| MD5 |
7049d66e15d8bbcf6340f0a6bc4990ef
|
|
| BLAKE2b-256 |
78d4b88cd68bbadc672637d77aa4fb2de866ab139d21a507eecab390e1530dcd
|
Provenance
The following attestation bundles were made for xfina-0.6.0-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on sakthipriyan/xfina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfina-0.6.0-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
7e911b1e581c3c98a5d23af5027ce12f41d24193ecd1dbe2b56676ce6a9ca456 - Sigstore transparency entry: 2807794699
- Sigstore integration time:
-
Permalink:
sakthipriyan/xfina@cede840745e39a1dd45f77187be999bed31b3e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/sakthipriyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cede840745e39a1dd45f77187be999bed31b3e93 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xfina-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: xfina-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11f56b92551a7c646faec1481b339bc828822837e62e129dad6d3f5d2cb76be3
|
|
| MD5 |
672e18fa29b0cfabbf065cc55d084299
|
|
| BLAKE2b-256 |
c6c1ce62c33d36a30aeba99550dc33e2d0b8e12aa2ba371c21f449041c551439
|
Provenance
The following attestation bundles were made for xfina-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on sakthipriyan/xfina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xfina-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl -
Subject digest:
11f56b92551a7c646faec1481b339bc828822837e62e129dad6d3f5d2cb76be3 - Sigstore transparency entry: 2807794987
- Sigstore integration time:
-
Permalink:
sakthipriyan/xfina@cede840745e39a1dd45f77187be999bed31b3e93 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/sakthipriyan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cede840745e39a1dd45f77187be999bed31b3e93 -
Trigger Event:
push
-
Statement type: