{"id":50583268,"url":"https://github.com/unliftedq/index-constitution","last_synced_at":"2026-06-05T04:01:55.518Z","repository":{"id":353603973,"uuid":"1219865973","full_name":"unliftedq/index-constitution","owner":"unliftedq","description":"Reliable historical index composition data for csi300, csi500, nasdaq100, sp500 and dow30.","archived":false,"fork":false,"pushed_at":"2026-04-28T15:07:45.000Z","size":138,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T02:07:29.058Z","etag":null,"topics":["backtest","quantitive"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unliftedq.png","metadata":{"files":{"readme":"README.md","changelog":"history/csi300.csv","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-24T09:49:05.000Z","updated_at":"2026-05-27T20:05:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/unliftedq/index-constitution","commit_stats":null,"previous_names":["unliftedq/index-constitution"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unliftedq/index-constitution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliftedq%2Findex-constitution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliftedq%2Findex-constitution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliftedq%2Findex-constitution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliftedq%2Findex-constitution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unliftedq","download_url":"https://codeload.github.com/unliftedq/index-constitution/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliftedq%2Findex-constitution/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33928631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtest","quantitive"],"created_at":"2026-06-05T04:01:54.518Z","updated_at":"2026-06-05T04:01:55.513Z","avatar_url":"https://github.com/unliftedq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Index Constitution\n\n[中文](README.zh.md)\n\n## Purpose\n\nThis 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.\n\nThis repo collects and normalizes that information into plain CSV files so it can be consumed directly by research and modeling pipelines.\n\n## Datasets\n\n| Index | Description | Source | Latest constituents |\n| --- | --- | --- | --- |\n| 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](https://data.eastmoney.com/other/index/hs300.html) |\n| 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](https://data.eastmoney.com/other/index/zz500.html) |\n| S\u0026P 500 | 500 leading large-cap U.S. companies listed on U.S. exchanges | [Wikipedia: List of S\u0026P 500 companies](https://en.wikipedia.org/wiki/List_of_S%26P_500_companies) | [Wikipedia: S\u0026P 500 component stocks](https://en.wikipedia.org/wiki/List_of_S%26P_500_companies) |\n| NASDAQ-100 | 100 largest non-financial companies listed on the Nasdaq Stock Market | [Wikipedia: NASDAQ-100](https://en.wikipedia.org/wiki/Nasdaq-100) | [Nasdaq: NASDAQ-100 Index quotes](https://www.nasdaq.com/market-activity/quotes/nasdaq-ndx-index) |\n| Dow Jones Industrial Average | 30 large U.S. blue-chip companies in the Dow Jones Industrial Average | [Wikipedia: Dow Jones Industrial Average](https://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average) and [Wikipedia: Historical components of the Dow Jones Industrial Average](https://en.wikipedia.org/wiki/Historical_components_of_the_Dow_Jones_Industrial_Average) | [Wikipedia: Dow Jones Industrial Average components](https://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average#Components) |\n\n## Python package\n\nThis repo also ships a small Python library that embeds the CSVs and exposes\nthem as pandas DataFrames.\n\nInstall:\n\n```bash\npip install index-constitution\n```\n\nUsage:\n\n```python\nimport index_constitution as ic\n\nic.list_indices()                    # ['csi300', 'csi500', 'sp500', 'nasdaq100', 'dow30']\n\nic.latest(\"sp500\")                   # current S\u0026P 500 members\nic.latest(\"dow30\")                   # current Dow 30 members\nic.history(\"csi300\")                 # full CSI 300 history with opt-in/opt-out\nic.constituents_at(\"sp500\", \"2015-06-30\")   # point-in-time membership\nic.is_member(\"sp500\", \"AAPL\", \"2020-01-02\") # True\nic.events(\"sp500\")                   # ticker/name change audit trail\nic.symbol_status(\"sp500\", \"ABMD\")   # whether a historical symbol is still directly usable\n```\n\n### Ticker and name changes\n\n`history/*.csv` and `latest/*.csv` use the current canonical ticker and namefor each company across the full membership span. For example, S\u0026P 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.\n\nThis 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 -\u003e META` means you can use `META` to access the full history for that company in this dataset.\n\n`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\u0026P 500 membership data, but the symbol itself stopped trading after Johnson \u0026 Johnson acquired Abiomed.\n\nEvents 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\u0026P 500 history.\n\n`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.\n\n## Use Cases\n\n- Check the current constituents of an index\n- Reconstruct point-in-time index membership for backtesting\n- Avoid survivorship bias when training quantitative models\n- Keep a consistent structure for adding more indices later\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funliftedq%2Findex-constitution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funliftedq%2Findex-constitution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funliftedq%2Findex-constitution/lists"}