MOEX Importer package
Project description
Project desctiption
Disclaimer
This project is not affilliated with MOEX.
You should refer to MOEX's official documents for terms of use the market data.
Description
The package allows to get quotes and data from MOEX ISS interface over HTTPS.
Installation
Install moeximporter
:
$ pip install moeximporter
Requirements
- pandas
Examples
Importing modules
# Import required modules
from datetime import date
from moeximporter import MoexImporter, MoexSecurity
Initialization
Class MoexImporter
is used for all https-requests to the ISS API. You should create at least one copy of the class to use for data-requests.
You can pass your own http-header to the class-constructor. _loadinfo
flag allows to get additional data from the exchange during the class initialization. You may use this data to check available engines and markets. You do not need to set this flag to True
if you often create copies of the class to speedup the code. Additional data isn't required for
# Create an object to access ISS API requests
mi = MoexImporter()
# Get all traded securities
seclist = mi.getSecuritiesAllTraded()
# Get all traded bonds
seclist = mi.getBondsAllTraded()
# Get all traded shares
seclist = mi.getSharesAllTraded()
# Search for traded security
seclist = mi.searchForSecurityTraded('ОФЗ')
Working with securities
Class MoexSecuirty
is used to get quotes and additional data for the security. You should pass an appropriate ticker and MoexImporter
object that you have created before.
# Create an object to access sequirity data
sec = MoexSecurity('GAZP', mi)
# Print information about security
print(sec)
# Request quotes as a pandas DataFrame
quotes_df = sec.getHistoryQuotesAsDataFrame(date(2023, 5, 1), date(2023, 9, 20))
# Request quotes as an array of dicts
quotes_arr = sec.getHistoryQuotesAsArray(date(2023, 5, 1), date(2023, 9, 20))
Licensing
The package is distributed under MIT License. See details in LICENSE.txt file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for moeximporter-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbaa7697f7f98a85e3fd4a29fb0c039288ac7d3fa8901fb4eed7ba147ac3ec68 |
|
MD5 | 8a6d443b7941d31cae6461cc859b08b8 |
|
BLAKE2b-256 | 87c914e3a5b9592981d154884999295a439b3fde96f5ad25fc7060c37219efe0 |