Skip to main content

Decrypt and parse Indian ITD Annual Information Statement (AIS) JSON locally

Project description

aisparser

CI PyPI Python versions License: MIT

Parse the Indian Income Tax Department's Annual Information Statement (AIS) JSON locally into typed, structured data. Zero network calls, in-memory decryption, and no silently dropped data — every leaf of the decrypted file is either typed, kept verbatim in a generic record, or reported in a redaction-safe warning.

Package name vs import name: the distribution is itd-aisparser, but the import and the CLI are both aisparserpip install itd-aisparser, then import aisparser / aisparser summary. The PyPI name aisparser is occupied by an abandoned maritime-AIS (ship-tracking) package, so this project ships under the itd- prefix.

Install

pip install itd-aisparser

With the optional pandas DataFrame adapter:

pip install "itd-aisparser[pandas]"

Quickstart

from aisparser import read_ais

statement = read_ais(
    path="ABCDE1234A_2025-26_AIS_03072026.json",
    password="ABCDE1234A21011991",
)

statement.assessment_year   # "2026-27" — detected from the portal filename
statement.parse_warnings    # redaction-safe structural warnings (labels only, never values)
statement.to_dict()         # plain-dict dump of the full typed statement

# With the [pandas] extra installed:
frames = statement.to_df()  # dict of category-keyed DataFrames

The password is your PAN (any case) followed by your date of birth as DDMMYYYY. The library resolves casing and the internal ITD key-derivation details automatically.

What parses typed vs generic

Category AIS part Typed model What you get
TDS entries (salary, dividend) Part B1 (TDS/TCS) TdsEntryRecord Per-quarter amount paid/credited plus TDS deducted and deposited as exact Decimals
TCS / outward foreign remittance Part B1 (TDS/TCS) TcsEntryRecord Amount received/debited, tax collected, and TCS deposited per quarter as exact Decimals
Interest from savings bank Part B2 (SFT) SavingsInterestRecord Account number and type, reporting date, and the interest amount as an exact Decimal
Dividend (SFT) Part B2 (SFT) SftDividendRecord Reporting date and dividend amount as an exact Decimal, per reporting entity
Sale of securities and mutual fund units Part B2 (SFT) SecuritiesSaleRecord Sale date, security identity and class, quantity, sale consideration, cost of acquisition, and FMV as Decimals
Purchase of securities and mutual fund units Part B2 (SFT) SecuritiesPurchaseRecord Quarterly market purchase and sale totals per client/holder as exact Decimals
Payment of taxes Part B3 TaxPaymentRecord Challan identity (BSR code, serial, CIN) with the tax/surcharge/cess breakup as Decimals
Refund Part B4 RefundRecord Refund amount, mode, nature, and payment date keyed by financial year
Salary (Annexure II) Part B7 (other information) SalaryAnnexureRecord Employment period and the gross-salary breakup u/s 17(1)/(2)/(3) as exact Decimals
Interest on income tax refund Part B7 (other information) RefundInterestRecord Assessment-year-keyed refund-interest amounts as exact Decimals

All other categories (57+ in the CBDT list) parse generically with verbatim field names and redaction-safe warnings — no data is silently dropped — and reporter-level rollups arrive typed as CategorySummaryRecord.

Downloading your AIS from the portal

  1. Log in at the e-Filing portal: https://www.incometax.gov.in/
  2. Open "Annual Information Statement (AIS)" from the e-File menu — the portal hands off to the AIS/compliance portal.
  3. On the AIS tile, pick the financial year and download the JSON format.
  4. The file arrives named {PAN}_{FY}_AIS_{DDMMYYYY}.json — keep this name so aisparser can detect the assessment year from it. The filename token is the financial year; aisparser converts FY to AY internally. A renamed file still works: pass assessment_year= in Python or --assessment-year on the CLI.
  5. The password is your PAN followed by your date of birth as DDMMYYYY.

CLI

aisparser summary ABCDE1234A_2025-26_AIS_03072026.json
aisparser export ABCDE1234A_2025-26_AIS_03072026.json -o out.csv
aisparser fingerprint ABCDE1234A_2025-26_AIS_03072026.json
  • The password is read from a hidden prompt by default; for scripting, set the AISPARSER_PASSWORD environment variable or use --password-file. There is no --password argv option by design.
  • --assessment-year overrides filename detection when the file has been renamed.
  • aisparser fingerprint prints a redaction-safe schema fingerprint per category — category names and column labels only, never values — safe to paste into a GitHub issue.

Privacy guarantees

  • No network: zero network calls at runtime and no HTTP client anywhere in the dependency tree — see SECURITY.md for the auditable proof.
  • In-memory only: decryption never touches disk; no temp files are ever written — see SECURITY.md for the enforcing test.
  • Value-free errors and warnings: no password, PAN, or financial value ever appears in an error, warning, or log — see SECURITY.md for how this is asserted.

License

MIT — see LICENSE.

Project details


Download files

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

Source Distribution

itd_aisparser-0.1.1.tar.gz (89.1 kB view details)

Uploaded Source

Built Distribution

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

itd_aisparser-0.1.1-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file itd_aisparser-0.1.1.tar.gz.

File metadata

  • Download URL: itd_aisparser-0.1.1.tar.gz
  • Upload date:
  • Size: 89.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for itd_aisparser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 54436b379df1b2f00ee4390dad55bf7b0932c4d15955a667ab543d88bdeeb654
MD5 87ffb858e34d367ed4f069e905ec56f5
BLAKE2b-256 a53474551d4b327e8274af4bc58c7cd3331d47359b1f5e9d5c40002aa58a4124

See more details on using hashes here.

Provenance

The following attestation bundles were made for itd_aisparser-0.1.1.tar.gz:

Publisher: release.yml on niladridasroy/itd-aisparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file itd_aisparser-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: itd_aisparser-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for itd_aisparser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fcbcd9bb999b2d6bcc7edd5d73a2bf3a9d705fb245f63ae825deb3265c04526
MD5 dd7334da7541e1ce8cae0b998b2a4322
BLAKE2b-256 8de6aa6904a3056a156db1c93e2024f0c0a81f86f9e086aefe34c9314d697b88

See more details on using hashes here.

Provenance

The following attestation bundles were made for itd_aisparser-0.1.1-py3-none-any.whl:

Publisher: release.yml on niladridasroy/itd-aisparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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