Add mic_code (ISO 10383 MIC) column#149
Conversation
|
Other columns are without the word "code" so I'd say we just make it "mic" (and MIC already contains the word code 😉) EDIT: it's related to exchange so location of the column makes sense! |
|
Good points, thanks! On the name: agreed — I'll rename it to On the placement: I put it right after That said, it's your call — happy to move it next to |
|
Location makes sense indeed, if you could rename to |
07f5565 to
97767a2
Compare
renamed 😉 |
|
The code is making a lot of changes to the package, somewhat simplifying it but in this case how the code originally was written was done on purpose. This adds a layer of abstraction that, given the minimal size of the package, doesn't add much value. I'd much prefer to keep the package the way it is even if it can in theory be done in less lines of code. |
Resolves JerBouma#110. Data: - Add `mic` column (right after `exchange`) to equities, etfs, funds and indices, mapping each Yahoo exchange code to its ISO 10383 MIC. Pseudo-codes (indices/FX/crypto/NAV funds) and venue-ambiguous codes (e.g. ENX) are left blank rather than guessed. All MICs validated as ACTIVE against the official ISO 10383 registry. Package: - Add a `mic` filter to select()/show_options() across the asset classes, keeping the existing explicit per-field style. - Annotate select() to return FinanceFrame and broaden search(**kwargs) typing. - Fix the pandas DtypeWarning (low_memory=False) and clear pyright/ruff findings. Tests: - Add mic coverage (filter, show_options, exchange->MIC invariant) and regenerate the snapshot fixtures.
97767a2 to
5836813
Compare
following your guide |
|
Perfect, thank you. Once there is functionality for the delisted tickers (as mentioned in your issue) I'll release a new PyPi and GitHub release. Wanted to work on this somewhere next week. |
|
@dokson Forgot something, the GitHub Actions script doesn't include a placeholder for the new |
@JerBouma fixed in #150. In the It also backfills the 16 NASDAQ rows ( |
Two related data-quality resolutions: 1. composite_figi enrichment (adapts PR #125 to current main) - Fills empty composite_figi for 1,539 ISINs sourced via OpenFIGI, applied to 1,753 rows in equities.csv. Only previously-empty cells are populated; no existing value is overwritten and no other column is touched (coverage 7,235 -> 8,774 unique ISINs). 2. mic backfill + workflow fix (resolves PR #149 follow-up) - The Database-Update action did not set the new mic column for added tickers. build_new_ticker now derives exchange -> ISO 10383 MIC from the existing one-to-one data and fills it; unknown codes stay blank. - Backfills 16 NASDAQ rows (NMS -> XNAS) added by a prior run before the column existed. - Adds test_mic_filled_when_exchange_mapped: fails when a row has a known exchange but a missing mic (the gap that let those rows ship). Snapshot fixtures regenerated; full suite passes (58).
Closes #110.
Adds a standardised ISO 10383 MIC code for each ticker, as requested in the issue, by mapping the existing Yahoo
exchangecode to its MIC.Data
mic_codecolumn (placed right afterexchange) inequities,etfs,fundsandindices.NMS/NGM/NCM → XNAS,NYQ → XNYS,LSE/IOB → XLON,GER → XETR,JPX → XJPX).ENX, generic Euronext) are intentionally left blank rather than guessed.Package
mic_codeadded as a filter toselect()and as an option inshow_options()for every asset class.FinanceDatabase._filter_by_options) with a centralisedCOLUMN_LABELSmap for the error messages.select()is now annotated to returnFinanceFrame;search(**kwargs)typing broadened.DtypeWarningand cleared the package's pyright/ruff findings.Tests
mic_codefilter,show_options, and anexchange → mic_codeone-to-one invariant.Note:
compression/artifacts are intentionally not committed — they are regenerated by the Database-Update workflow.