Skip to main content

Disclaimer

This is an unofficial open source project.

  • This project is not affiliated with or endorsed by E*TRADE, Morgan Stanley, the State Bank of India (SBI), the Reserve Bank of India (RBI), the Income Tax Department of India, or any other financial institution or government authority.
  • Historical exchange rates are obtained through the sbi-tt-rates package. For dates prior to 2020, where SBI TT data is unavailable, the library automatically falls back to historical USD/INR exchange rates from Yahoo Finance.
  • The library has only been tested with E*TRADE statement formats. Statements from other brokers are not currently supported.
  • The library has only been validated for FY 2025-26 (AY 2026-27). Future Income Tax portal formats, reporting requirements, or broker statement formats may require updates.
  • The generated Schedule FA should always be reviewed before filing your Income Tax Return. Users are responsible for verifying the accuracy of the generated data before submission.

The authors and contributors are not responsible for any incorrect tax filings, penalties, interest, or financial losses resulting from the use of this software.

itr-schedule-fa

Convert US broker statements into Schedule FA for the Indian Income Tax Return.

itr-schedule-fa is an open source Python library that converts broker statements into the Schedule FA format required by the Indian Income Tax portal.

The project currently supports E*TRADE statements and is designed so additional brokers can be added over time.


What it does

Preparing Schedule FA usually involves:

  • reconstructing historical holdings
  • calculating acquisition values
  • finding the peak value during the financial year
  • converting USD values into INR using historical exchange rates
  • creating dividen history in INR
  • listing short term, long term gains
  • Dividing the values as per quarter.
  • preparing the data in the format expected by the Income Tax portal

This library performs those calculations and generates a Schedule FA CSV from your broker statements.


Features

  • Parse E*TRADE holdings statements

  • Parse E*TRADE gain/loss statements

  • Reconstruct holdings for the reporting year

  • Calculate:

    • Initial investment value
    • Peak investment value
    • Closing balance
    • Gross sale proceeds
  • Convert USD values to INR using historical exchange rates

  • Generate Schedule FA CSV


Installation

pip install itr-schedule-fa

Supported brokers


Broker Status version
E*TRADE Supported 0.0.1

More brokers are planned.


Supported stocks

Currently the library supports multiple stocks** (if your broker is etrade)


Required files

The library accepts up to three input files.

File Required Description
holdings.xlsx Yes Current holdings exported from your broker
gnl_within.xlsx No Shares sold during the reporting financial year
gnl_after.xlsx No Shares sold after the reporting financial year

If there were no transactions in a category, simply omit that file. Note : All 3 files are needed in expanded view for the parsers to work.


E*TRADE Holdings Report

Holdings -> View By Status -> Download Expanded

E*TRADE Gain/Loss Reports

Download for current FY year and last year as well.

If filing for FY 2025-26 (AY 2026-27), download (Expanded View):

  • Gain & Loss report for 2025
  • Gain & Loss report for 2026

The purpose of the second Gain & Loss report is to reconstruct your holdings as of 31-Dec-2025.

For example, if you received an RSU in 2024 but sold it in January 2026, it will no longer appear in the holdings report downloaded during ITR filing season.

The transaction report is therefore used to add those shares back so that the holdings accurately reflect the position as of 31-Dec-2025.

Example

from pathlib import Path

from itr_schedule_fa import ScheduleFA
from itr_schedule_fa.factory import (
    supported_brokers,
    supported_tickers,
)

BROKER = "etrade"
TICKER = "QCOM"
REPORTING_YEAR = 2025  # a convention that fy 2025-26


def main():
    print(f"Broker         : {BROKER}")
    print(f"Ticker         : {TICKER}")
    print(f"Reporting Year : {REPORTING_YEAR}")

    if TICKER not in supported_tickers():
        raise ValueError(
            f"Unsupported ticker '{TICKER}'. Supported tickers: {', '.join(supported_tickers())}"
        )

    if BROKER not in supported_brokers():
        raise ValueError(
            f"Unsupported broker '{BROKER}'. Supported brokers: {', '.join(supported_brokers())}"
        )

    data_dir = Path(__file__).parent / "data"

    owned = data_dir / "holdings.xlsx"
    sold_within = data_dir / "gnl_within.xlsx"
    sold_after = data_dir / "gnl_after.xlsx"
    output_schedule_fa_path = data_dir / "schedule_fa.csv"
    output_gains_path = data_dir / "gains.csv"
    output_dividend_path = data_dir / "dividend.csv"
    if not owned.exists():
        raise FileNotFoundError(f"Missing holdings file: {owned}")

    fa = ScheduleFA(
        ticker=TICKER,
        year=REPORTING_YEAR,
        broker=BROKER,
    )

    fa.set_data(
        owned=owned,
        sold_within_reporting_year=(sold_within if sold_within.exists() else None),
        sold_after_reporting_year=(sold_after if sold_after.exists() else None),
    )

    fa.generate()

    fa.schedule_fa().to_csv(output_schedule_fa_path)  # writes FA
    fa.gains_table().to_csv(output_gains_path)  # writes gains
    fa.dividend_table().to_csv(output_dividend_path)  # writes dividends


if __name__ == "__main__":
    main()

How it works

Broker Statements
        │
        ▼
 Parse Holdings
        │
        ▼
 Parse Transactions
        │
        ▼
 Reconstruct Holdings
        │
        ▼
 Historical Stock Prices
        │
        ▼
 Historical Exchange Rates
        │
        ▼
 Schedule FA CSV

Exchange rates

The library uses historical SBI TT Buy exchange rates (SBITTR) through the sbi-tt-rates package. Link: https://github.com/jdecodes/sbi-tt-rates

Historical SBI TT data is available from 2020 onwards.

For acquisitions before 2020, the library automatically falls back to historical USD/INR exchange rates from Yahoo Finance and logs a warning.

Example:

WARNING: Falling back to Yahoo Finance for acquisition date 2019-08-19 (USD/INR=71.132) because SBI TT data is unavailable.

Dividends

Dividend calculations are done using https://github.com/jdecodes/fa-inrdata-api's dividend apis. Check project : https://github.com/jdecodes/fa-inrdata


Validation

The library validates the input before generating Schedule FA.

Some examples include:

  • unsupported broker
  • unsupported ticker
  • missing files
  • empty holdings file
  • missing required columns
  • mismatched ticker between statements
  • invalid input formats

Validation errors are reported with descriptive exceptions.


Roadmap

Planned improvements include:

  • additional US brokers
  • automatic broker detection

Companion projects

This project uses the following libraries:


Contributing

Bug reports, feature requests and pull requests are welcome.

If you'd like to add support for another US broker, feel free to open an issue before starting work so we can discuss the file formats and implementation.


License

MIT License. See the LICENSE file for details.

Download files

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

Source Distribution

itr_schedule_fa-0.1.3.tar.gz (33.4 MB view details)

Uploaded Source

Built Distribution

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

itr_schedule_fa-0.1.3-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file itr_schedule_fa-0.1.3.tar.gz.

File metadata

  • Download URL: itr_schedule_fa-0.1.3.tar.gz
  • Upload date:
  • Size: 33.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for itr_schedule_fa-0.1.3.tar.gz
Algorithm Hash digest
SHA256 24d69877c83c66458ef30f7dea7fd27ff5e1d301e513604be9a2246184cec864
MD5 7e4b39039f83679e9a994a66df2a1681
BLAKE2b-256 cac39d92436064e1142a1bd5fdb964c46502b9ecf7b638a447c6b90d4ac1bf37

See more details on using hashes here.

File details

Details for the file itr_schedule_fa-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for itr_schedule_fa-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 181b739390cc649fce6e9a40b0b8f9bcd85cca1be47af847abe67bc54344c3a0
MD5 a65116a27287e7f72cd7e1e8c2f35d5e
BLAKE2b-256 92fc25ba2554fcdb566669d1eba45040d56000b5ea2a0be1a1ebc6a022da6ed7

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 Sentry Error logging StatusPage Status page