finec
Financial data and financial computation utilities for Finec MGIMO students.
Demo
https://share.streamlit.io/epogrebnyak/finec/main
Installation
pip install git+https://github.com/epogrebnyak/finec.git
Moscow Exchange (MOEX)
Download Moscow Exchange (MOEX) data for stocks, bonds, currencies and indices and pandas dataframes, CSV or Excel files.
Stocks
from finec.moex import Stock, Index
# What stocks are part of IMOEX index?
Index("IMOEX").composition()
# General information about Aeroflot stock
Stock("AFLT").whoami()
# Ozon stock price history, all dates and columns
Stock("OZON").get_history()
# Yandex stock price, restricted by columns and start date
Stock("YNDX").get_history(columns=["TRADEDATE", "CLOSE"], start="2022-01-01")
# Get dividend history from https://github.com/WLM1ke/poptimizer
Stock("GMKN").get_dividend()
Bonds
from finec.moex import Bond
# Sistema 2027 bond price and yields from TQCB trading bord
Bond(ticker="RU000A0JXN21", board="TQCB").get_history()
# What data columns are provided for trading history?
Bond(ticker="RU000A101NJ6", board="TQIR").provided_columns()
Currencies
from finec.moex import Currency, usd_rur, eur_rur, cny_rur
# USDRUR exchange rate
Currency("USD000UTSTOM").get_history(start="2020-01-01")
# Tickers for euro and yuan exchange rates
eur_rur().ticker
cny_rur().ticker
Lookup functions
from finec.moex import whoami, find, traded_boards
# General information about ticker
whoami("YNDX")
# What boards does a security trade at?
traded_boards("MTSS")
# Are there traded securities with *query_str* in description?
find(query_str="Челябинский", is_traded=True)
Markets and boards
from finec.moex import Market, Board
m = Market(engine="stock", market="shares")
m.traded_boards()
b = Board(engine="stock", market="shares", board="TQBR")
b.securities()
b.history()
More about MOEX data
References:
- MOEX API reference https://iss.moex.com/iss/reference/?lang=en
- Developper manual (2016) https://fs.moex.com/files/6523
Notes:
- MOEX is very generious to provide a lot of data for free and without any registration or tokens.
- MOEX API provided on "as is" basis and some parts are undocumented.
Aknowledgements
- We rely on
apimoex.ISSClientand expertise developped within apimoex project by @WLMike1. - Dividend history relayed from https://github.com/WLM1ke/poptimizer
Release files for finec 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| finec-0.1.7.tar.gz | 21.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| finec-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.7 kB
Release files / finec-0.1.7.tar.gz
| Download URL | finec-0.1.7.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6df88d499824ac023349acad2f5e57cc3d0088efb0e8030d12f5fd2b0d63550a
|
|
BLAKE2b-256 checksum How to use checksums |
d35e17509e91c136c2774dc98db11fa229a91a1033ecb4f9373bc093d2f55a50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.5 Windows/10
|
Release files / finec-0.1.7-py3-none-any.whl
| Download URL | finec-0.1.7-py3-none-any.whl |
|---|---|
| Size | 22.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0d89569ba7ca78c493d665736b35361b4ab933d9358a14a729dd2b7e13d75fb
|
|
BLAKE2b-256 checksum How to use checksums |
060e5498f4607fe966b308ffe1641f8824dfe7fa9bd0a13472363b3122f2f111
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.8.5 Windows/10
|