Skip to main content

fa-inrdata-api

A lightweight Python API for historical INR-adjusted stock prices, built specifically for Indian Income Tax Schedule FA reporting.

fa-inrdata-api provides historical daily stock prices already converted to INR using the corresponding State Bank of India (SBI) TT Buying Rate for that date. Instead of downloading Yahoo Finance prices, searching SBI TT rates, and performing currency conversion yourself, this package gives you the final INR value in one API call.

The data is powered by the fa-inrdata dataset.


Why?

While filing Schedule FA (Foreign Assets) in the Indian Income Tax Return, taxpayers are required to report values such as:

  • Initial value of investment
  • Peak value during the year
  • Closing balance
  • Value on a specific acquisition date

Obtaining these values is surprisingly tedious.

Typically you need to

  • download historical stock prices
  • obtain historical SBI TT buying rates
  • convert every day's closing price into INR
  • determine the maximum INR value for the required period

This package performs those steps for you.


Features

  • Historical daily close prices
  • Historical SBI TT Buying rates
  • Daily INR converted prices
  • Initial value for a year
  • Closing value for a year
  • Peak INR value for a year
  • Peak INR value within a custom date range
  • Value on any date (with automatic previous trading day fallback)
  • Ticker metadata
  • Local caching
  • Zero third-party dependencies

Installation

pip install fa-inrdata-api

Requires Python 3.10+


Quick Example

import fa_inrdata_api as fa

summary = fa.schedule_fa_summary("AAPL", 2025)

print(summary.initial)
print(summary.peak)
print(summary.closing)

Using the Object-Oriented API

from fa_inrdata_api import Ticker

aapl = Ticker("AAPL", 2025)

print(aapl.schedule_fa_summary())
print(aapl.max_value())
print(aapl.value_at_start())
print(aapl.value_at_end())

Supported Tickers

import fa_inrdata_api as fa

print(fa.supported_tickers())

Supported Years

import fa_inrdata_api as fa

print(fa.supported_years_for_ticker("AAPL"))

Example

[2025]

Get Company Metadata

import fa_inrdata_api as fa

info = fa.ticker_metadata("AAPL")

print(info)

Returns

TickerInfo(
    ticker="AAPL",
    name="Apple Inc.",
    address="One Apple Park Way",
    zip="95014",
    country="United States",
)

Complete Daily Price History

rows = fa.price_action("AAPL", 2025)

print(rows[0])

Returns

PriceRow(date="2025-01-02", close=243.85, sbi_tt=85.64, close_inr=20880.11)

Value on a Specific Date

import fa_inrdata_api as fa

row = fa.value_on_date("AAPL", "2025-05-17")

print(row)

If the supplied date falls on a weekend or market holiday, the package automatically returns the nearest previous trading day.


Initial Value

fa.value_at_year_start("AAPL", 2025)

Closing Value

fa.value_at_year_end("AAPL", 2025)

Maximum Value

Entire year

fa.max_value("AAPL", 2025)

Custom period

fa.max_value(
    "AAPL",
    2025,
    start_date="2025-03-15",
    end_date="2025-08-31",
)

Minimum Value

fa.min_value("AAPL", 2025)

Schedule FA Summary

This convenience function returns everything typically required for Schedule FA.

summary = fa.schedule_fa_summary("AAPL", 2025)

print(summary.initial)
print(summary.peak)
print(summary.closing)

Returns

ScheduleFASummary(ticker="AAPL", year=2025, initial=..., peak=..., closing=...)

Warm the Cache

The package downloads data lazily and stores it locally.

If desired, you can warm the cache beforehand.

import fa_inrdata_api as fa

fa.warm_cache()

Caching

Downloaded files are cached locally under

~/.cache/fa_inrdata_api/

Subsequent requests are served directly from the cache.


Dividends

Retrieve all dividends declared by a company for a given calendar year.

import fa_inrdata_api as fa

rows = fa.dividends("AAPL", 2025)

for row in rows:
    print(row)

Returns

DividendRow(
    record_date=date(2025, 2, 10),
    payment_date=date(2025, 2, 13),
    dividend_per_share=0.25,
    dividend_per_share_inr=21.60,
)

Or, using the object-oriented API

from fa_inrdata_api import Ticker

aapl = Ticker("AAPL", 2025)

print(aapl.dividends())

Data Source

This package reads data from

https://github.com/jdecodes/fa-inrdata

Each ticker has one CSV per calendar year.

data/
    AAPL/
        2023.csv
        2024.csv
        2025.csv

    MSFT/
        ...

Each CSV contains

Column Description
date Trading date
close Yahoo Finance closing price
sbi_tt SBI TT Buying Rate
close_inr close × sbi_tt

Why SBI TT Buying Rate?

Indian Income Tax guidance for Schedule FA generally requires foreign asset values to be converted into INR using the State Bank of India Telegraphic Transfer (TT) Buying Rate.

This package performs that conversion in advance.


Disclaimer

This is an unofficial, community-maintained package.

It is not affiliated with

  • State Bank of India (SBI)
  • Yahoo Finance
  • Indian Income Tax Department

Although every effort is made to ensure accuracy, the data may contain errors or omissions.

Always verify important values against official sources before filing taxes or making financial decisions.


License

MIT License


This package is powered by the underlying dataset:

fa-inrdata

https://github.com/jdecodes/fa-inrdata


Author

Built by jdecodes : https://github.com/jdecodes

Contributions, bug reports, feature requests, and pull requests are always welcome.

Metadata

Release files for fa-inrdata-api 0.2.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 fa-inrdata-api 0.2.0
File Size Uploaded
fa_inrdata_api-0.2.0.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fa-inrdata-api 0.2.0
File Interpreter ABI Platform
fa_inrdata_api-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / fa_inrdata_api-0.2.0.tar.gz

Download URL fa_inrdata_api-0.2.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e760a133b7acdb37f5da37055d4d3f56e22d1bfd7e1975f81b1338065ee3987f
BLAKE2b-256 checksum
How to use checksums
49cc6e50e5aad665d454e760741c24fbd4200f06a3238ce313fb78930cb8a03d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / fa_inrdata_api-0.2.0-py3-none-any.whl

Download URL fa_inrdata_api-0.2.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dbfc37fdc1f3f18c4ab9e1fafe5e2c51af1c55a90c51bc570fab175e2c78f11
BLAKE2b-256 checksum
How to use checksums
7b1f5220b5de7741b0fcf21e4e9d5f43dd132c3f244450abaa89c04f214c7769
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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