Tiny, dependency-light client for Indian mutual-fund NAVs from AMFI
Project description
Get the list of fund houses (AMCs), the latest NAV of every scheme in India, and each AMC's full master profile — straight from AMFI's public pages. No API key, no login, no cookies — one function call.
import mutualfund as mf
mf.get_nav(119018) # -> 1186.883 (latest NAV; changes daily)
mf.get_amc_profile("ICICI Prudential") # full AMC profile (sponsor, trustees, ...)
AMFI publishes a single plain-text file, NAVAll.txt,
with the latest NAV of every mutual-fund scheme in India (~14,000 rows), plus a
master profile for each fund house on its member pages. These are free and
public, but they're quirky — a semicolon-delimited dump with fund houses and
categories as bare header lines, and server-rendered profile pages. mutualfund
parses all of that for you and hands back clean, typed Python objects.
Install
pip install mutualfund
The only runtime dependency is requests.
Usage
List all fund houses (AMCs)
import mutualfund as mf
for amc in mf.get_amcs():
print(amc.scheme_count, amc.name)
# 357 HDFC Mutual Fund
# 412 SBI Mutual Fund
# ...
Get the latest NAV of a scheme
mf.get_nav(119018) # -> 1186.883 (latest NAV, or None if unavailable)
scheme = mf.get_scheme(119018)
print(scheme.name) # "HDFC Large Cap Fund - Growth Option - Direct Plan"
print(scheme.nav, scheme.nav_date)
print(scheme.amc) # "HDFC Mutual Fund"
print(scheme.category) # "Large Cap Fund"
All schemes of one fund house
for s in mf.get_schemes("SBI Mutual Fund"):
print(s.code, s.name, s.nav)
Find a scheme by name
for s in mf.search("Nifty 50 Index"):
print(s.code, s.name, s.nav)
Reusable client
The module-level helpers share one cached download. For isolated state (or to control refreshing yourself), use the client directly:
from mutualfund import AMFIClient
client = AMFIClient()
schemes = client.schemes() # downloads + parses once, then cached
fresh = client.schemes(refresh=True) # force a new download
Every NAV helper also accepts refresh=True:
mf.get_nav(119018, refresh=True)
AMC profiles
Beyond NAVs, AMFI publishes a master profile for each fund house. mutualfund
reads those member pages too.
import mutualfund as mf
# Discover every fund house and its AMFI id (one request):
for m in mf.get_amc_members():
print(m.mf_id, m.name)
# Full profile, by name substring or by AMFI id:
p = mf.get_amc_profile("ICICI Prudential") # or mf.get_amc_profile(20)
print(p.sebi_regid) # "MF/003/93/6"
print(p.setup_date) # 1993-10-12
print(p.sponsors) # "ICICI Bank Limited and Prudential Plc"
print(p.ceo) # "Mr. Nimesh Shah"
print(p.trustees) # ('Mr. Nilanjan Sinha', 'Mr. Jyotin Mehta', ...)
print(p.custodians) # ('HDFC Bank Limited', 'Deutsche Bank AG', ...)
for app in p.mobile_apps: # MobileApp(platform, name, url, developer)
print(app.platform, app.url)
for link in p.social: # SocialLink(platform, name, url)
print(link.platform, link.url)
AMCProfile fields
| Group | Fields |
|---|---|
| Identity | mf_id, name, amc_name, sebi_regid, setup_date, incorporation_date |
| Structure | sponsors, trustee_company, trustees, directors |
| Personnel | chairman, ceo, managing_director, cio_equity, compliance_officer, investor_service_officer |
| Contact | address, phone, fax, email, email_domain, website |
| Providers | auditors, custodians, registrar |
| Digital | mobile_apps (list of MobileApp), social (list of SocialLink) |
trustees, directors and custodians are tuples of names; missing text
fields are "" and missing dates are None.
Note: AMC profiles come from AMFI's server-rendered member pages, so they are slightly more fragile than the NAV file — a future redesign of those pages could require an update here.
The Scheme object
| Field | Type | Description |
|---|---|---|
code |
int |
AMFI scheme code |
name |
str |
Full scheme name (plan + option) |
amc |
str |
Fund house, e.g. "HDFC Mutual Fund" |
nav |
float | None |
Latest net asset value |
nav_date |
date | None |
Date the NAV applies to |
isin_growth |
str |
ISIN (Growth / IDCW-Payout) |
isin_reinvestment |
str |
ISIN (IDCW-Reinvestment) |
category |
str |
AMFI category, e.g. "Large Cap Fund" |
structure |
str |
"open", "close" or "interval" |
scheme_type |
str |
"equity", "debt", "hybrid", "index", ... |
A missing NAV or date is None — never a silent zero or an exception.
Scope
This package reads AMFI's public data: scheme NAVs and AMC master profiles. It deliberately does not scrape portfolio holdings, transaction data, or anything behind a login.
Limitations & disclaimer
- NAVs are end-of-day, as published by AMFI — not live/intraday prices.
- The data comes from AMFI's public file; this project re-publishes it as-is and makes no guarantee of accuracy or availability.
- Not investment advice. This is a data-access tool, nothing more.
Links
- Source & issues: github.com/ShantanuAnant/mutualfund
- Changelog: CHANGELOG.md
License
MIT — see 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 mutualfund-0.1.0.tar.gz.
File metadata
- Download URL: mutualfund-0.1.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
106e9898db7afdfefb72c7c8e5786358e9ef5741c6c14ec2e2a24116e7b8bc70
|
|
| MD5 |
b81f7ce939c49b70d8acda4cab8b5914
|
|
| BLAKE2b-256 |
31bdb9eaaca1771e8a61eb164224ab980d64823ecb2691a5ad06ed12e81cb5af
|
File details
Details for the file mutualfund-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mutualfund-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70260074d63a2f9e65d03fa30999c20bb62059625c9fd645b819fe524b6fe022
|
|
| MD5 |
49502509a6814e0de1e81d87fd9f17cc
|
|
| BLAKE2b-256 |
e82c5e8eb8eca90a082a2718a5210fb0100dad410cf0957ede1ff8dcbc512dc2
|