A package for extracting JSON data from Maybank PDF account statements
Project description
maybankpdf2json
Convert Maybank PDF statements into structured data.
TL;DR
- Use one method:
json() - Output includes:
account_number,statement_date,transactions
Install
pip install maybankpdf2json
Usage
from maybankpdf2json import MaybankPdf2Json
with open("statement.pdf", "rb") as f:
data = MaybankPdf2Json(f, "your_pdf_password").json() # No password? Omit the second argument.
print(data)
Example output:
{
"account_number": "162021-851156",
"statement_date": "30/09/24",
"transactions": [
{
"date": "01/09/24",
"desc": "BEGINNING BALANCE",
"trans": 0,
"bal": 3285.77
}
]
}
Response Schema
Root Object
| Field | Type | Format | Notes |
|---|---|---|---|
account_number |
str | None |
NNNNNN-NNNNNN |
May be None if not detected |
statement_date |
str | None |
dd/mm/yy |
May be None if not detected |
transactions |
list[Transaction] |
Array | Ordered as parsed from statement |
Transaction Object
| Field | Type | Format | Example |
|---|---|---|---|
date |
str |
dd/mm/yy |
01/09/24 |
desc |
str |
Free text | BEGINNING BALANCE |
trans |
float | int |
Signed numeric | -10.0, 0, 250.5 |
bal |
float |
Signed numeric | 3285.77 |
Date format is dd/mm/yy.
Quick Full-Data Test (tests folder)
- Put your statement PDF at
tests/test.pdf. - Run this from the project root:
TEST_PDF_PASSWORD='passwordOfTest.pdf' python3 -c "import json, os; from maybankpdf2json.extractor import MaybankPdf2Json; f=open('tests/test.pdf','rb'); print(json.dumps(MaybankPdf2Json(f, os.environ.get('TEST_PDF_PASSWORD','')).json(), indent=2)); f.close()"
If your PDF has no password, use TEST_PDF_PASSWORD=''.
MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 maybankpdf2json-0.2.7.tar.gz.
File metadata
- Download URL: maybankpdf2json-0.2.7.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6236922934e0c1036e8151fadbf4d7bfa490d885023f010ec3022bd8983839d4
|
|
| MD5 |
d00ae031e594ce96c7473bdd6b990816
|
|
| BLAKE2b-256 |
024fa16f60fd0565ff4ec2d25492c46a9c84216da2d82e3041dcb33e169ba062
|
Provenance
The following attestation bundles were made for maybankpdf2json-0.2.7.tar.gz:
Publisher:
publish.yml on nordinz7/maybankpdf2json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maybankpdf2json-0.2.7.tar.gz -
Subject digest:
6236922934e0c1036e8151fadbf4d7bfa490d885023f010ec3022bd8983839d4 - Sigstore transparency entry: 1246215146
- Sigstore integration time:
-
Permalink:
nordinz7/maybankpdf2json@e279b02843bf9cc0cd1e2c445d673c775822216f -
Branch / Tag:
refs/tags/v0.2.7 - Owner: https://github.com/nordinz7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e279b02843bf9cc0cd1e2c445d673c775822216f -
Trigger Event:
push
-
Statement type:
File details
Details for the file maybankpdf2json-0.2.7-py3-none-any.whl.
File metadata
- Download URL: maybankpdf2json-0.2.7-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fcefc6ed62e730df0f2f8ae0382c28447fd37203faa39db5365d9fccad51674
|
|
| MD5 |
e4aa4c3b096ade3744e1ee527ebd5410
|
|
| BLAKE2b-256 |
e01d7248a9a3ff49816722072108c908749e1e34749fb8a41ca87eeb4e8bd30d
|
Provenance
The following attestation bundles were made for maybankpdf2json-0.2.7-py3-none-any.whl:
Publisher:
publish.yml on nordinz7/maybankpdf2json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maybankpdf2json-0.2.7-py3-none-any.whl -
Subject digest:
4fcefc6ed62e730df0f2f8ae0382c28447fd37203faa39db5365d9fccad51674 - Sigstore transparency entry: 1246215151
- Sigstore integration time:
-
Permalink:
nordinz7/maybankpdf2json@e279b02843bf9cc0cd1e2c445d673c775822216f -
Branch / Tag:
refs/tags/v0.2.7 - Owner: https://github.com/nordinz7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e279b02843bf9cc0cd1e2c445d673c775822216f -
Trigger Event:
push
-
Statement type: