Skip to main content

Index Constitution

中文

Purpose

This repository was created to make it easier to train quantitative models on major stock indices. Reliable historical index composition data (constituent additions and removals over time) is notoriously hard to obtain — vendors often charge for it, official sources are scattered across PDFs and announcements, and free APIs rarely expose point-in-time membership. Without this data, backtests suffer from survivorship bias and lookahead bias.

This repo collects and normalizes that information into plain CSV files so it can be consumed directly by research and modeling pipelines.

Datasets

Index Description Source Latest constituents
CSI 300 Top 300 A-share stocks listed on the Shanghai and Shenzhen exchanges Official announcements from China Securities Index Co. (csindex.com.cn) Eastmoney: CSI 300 constituents
CSI 500 500 mid-cap A-share stocks listed on the Shanghai and Shenzhen exchanges Official announcements from China Securities Index Co. (csindex.com.cn) Eastmoney: CSI 500 constituents
S&P 500 500 leading large-cap U.S. companies listed on U.S. exchanges Wikipedia: List of S&P 500 companies Wikipedia: S&P 500 component stocks
NASDAQ-100 100 largest non-financial companies listed on the Nasdaq Stock Market Wikipedia: NASDAQ-100 Nasdaq: NASDAQ-100 Index quotes
Dow Jones Industrial Average 30 large U.S. blue-chip companies in the Dow Jones Industrial Average Wikipedia: Dow Jones Industrial Average and Wikipedia: Historical components of the Dow Jones Industrial Average Wikipedia: Dow Jones Industrial Average components

Python package

This repo also ships a small Python library that embeds the CSVs and exposes them as pandas DataFrames.

Install:

pip install index-constitution

Usage:

import index_constitution as ic

ic.list_indices()                    # ['csi300', 'csi500', 'sp500', 'nasdaq100', 'dow30']

ic.latest("sp500")                   # current S&P 500 members
ic.latest("dow30")                   # current Dow 30 members
ic.history("csi300")                 # full CSI 300 history with opt-in/opt-out
ic.constituents_at("sp500", "2015-06-30")   # point-in-time membership
ic.is_member("sp500", "AAPL", "2020-01-02") # True
ic.events("sp500")                   # ticker/name change audit trail
ic.symbol_status("sp500", "ABMD")   # whether a historical symbol is still directly usable

Ticker and name changes

history/*.csv and latest/*.csv use the current canonical ticker and namefor each company across the full membership span. For example, S&P 500 historylists Meta Platforms only as META, even for the period when it traded as FB. The event/us.csv and event/cn.csv files are the audit trail for those changes.

This canonicalization is strongest for pure ticker/name changes. When an event row includes new_symbol, it means this dataset treats the new ticker as the usable successor for historical lookup. For example, FB -> META means you can use META to access the full history for that company in this dataset.

delisting means the old ticker was retired and is no longer directly usable. In that case new_symbol and new_name are left empty because this dataset does not treat any other ticker as its direct successor. For example, ABMD remains valid historical S&P 500 membership data, but the symbol itself stopped trading after Johnson & Johnson acquired Abiomed.

Events are not scoped to a single index — a corporate ticker or name change applies to every index that includes the company. ic.events("sp500") filters the table to events whose old or new symbol ever appeared in S&P 500 history.

is_member() and constituents_at() are strict — they do not resolve old tickers automatically. Use ic.events("sp500") or ic.symbol_status() to tell whether an old symbol maps to a usable successor ticker or is simply delisted.

Use Cases

  • Check the current constituents of an index
  • Reconstruct point-in-time index membership for backtesting
  • Avoid survivorship bias when training quantitative models
  • Keep a consistent structure for adding more indices later

Download files

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

Source Distribution

index_constitution-1.0.0.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

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

index_constitution-1.0.0-py3-none-any.whl (98.3 kB view details)

Uploaded Python 3

File details

Details for the file index_constitution-1.0.0.tar.gz.

File metadata

  • Download URL: index_constitution-1.0.0.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for index_constitution-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b214777e37b4d80f9e8484d7d4256eafa6b4e99752da23cc5de4dd83b1a1552c
MD5 f9e7a40e9a87f80b28df4ce887fd84f1
BLAKE2b-256 4da3ad336183a2db35020869d7c21fbe04f92d105e710dcc99dc7f2b7929cccc

See more details on using hashes here.

Provenance

The following attestation bundles were made for index_constitution-1.0.0.tar.gz:

Publisher: release.yml on unliftedq/index-constitution

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

File details

Details for the file index_constitution-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for index_constitution-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fa360e62d27c8f84f4e5d1bc50dbfc393c5616f41fccc9131e10717474b29ed
MD5 a62181baac5ad00e2aa1c234d88147ed
BLAKE2b-256 cf2ec109dd6ad40a822f3595631fe7ad768f34a814d21cba43cf1f7082634b79

See more details on using hashes here.

Provenance

The following attestation bundles were made for index_constitution-1.0.0-py3-none-any.whl:

Publisher: release.yml on unliftedq/index-constitution

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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