Package to retrieve sector/industry assignments based on a flexible connector architecture for different data sources
Use identifiers such as ISINs and ticker symbols to identify listed companies and retrieve their classifications through a provider-based architecture.
- resolve listed equities from supported identifier types (ISIN, Ticker, ...)
- retrieve sector / industry classification for companies with listed equities
- support for different classification systems like GICS or GECS
- support different classification data sources
- extendable architecture for additional data sources
- Excel output
Currently supported classification systems
- GECS by Morningstar
- GICS by MSCI / S&P
- Yahoo (close to GICS)
Currently supported providers:
- OpenFIGI for master data and identifier reference data
- Morningstar for GECS classification
- MotelyFool for GICS classification
- SeekingAlpha for GICS classification data
- Yahoo for industry/sector classification close to GICS
Due to license issues f. e. for MSCI GICS not all classification levels might be retrievable.
Installation
pip install equities-classifier
Usage
Prepare a xlsx file with two columns, column on being the equity identifier type and column to the identifier type (i. e. ISIN). If column two is empty, ISIN is assumed.
Example:
| Value | Typ |
|---|---|
| CH0038863350 | |
| DK0060336014 |
Enter equities-classifier at a command line and follow GUI instructions.
To set up hatch and pre-commit for the first time:
- install hatch globally, e.g. with pipx, i.e.
pipx install hatch, - make sure
pre-commitis installed globally, e.g. withpipx install pre-commit.
A special feature that makes hatch very different from other familiar tools is that you almost never
activate, or enter, an environment. Instead, you use hatch run env_name:command and the default environment
is assumed for a command if there is no colon found. Thus you must always define your environment in a declarative
way and hatch makes sure that the environment reflects your declaration by updating it whenever you issue
a hatch run .... This helps with reproducability and avoids forgetting to specify dependencies since the
hatch workflow is to specify everything directly in pyproject.toml. Only in rare cases, you
will use hatch shell to enter the default environment, which is similar to what you may know from other tools.
To get you started, use hatch run test:cov or hatch run test:no-cov to run the unitest with or without coverage reports,
respectively. Use hatch run lint:all to run all kinds of typing and linting checks. Try to automatically fix linting
problems with hatch run lint:fix and use hatch run docs:serve to build and serve your documentation.
You can also easily define your own environments and commands. Check out the environment setup of hatch
in pyproject.toml for more commands as well as the package, build and tool configuration.
To support versioning and changelog generation please refer to the toolchain selected during package
generation (see also pyproject.toml). If not deselected, the toolchain includes a pre-commit hook
for linting commit messages to ensure commit messages are compliant with the conventional commit format and
support an automated changelog generation.
This package was created with The Hatchlor Enhanced project template. This template is based on The Hatchlor but was substantially improved.