Skip to main content

Project description

Important

! Arguments' naming has been changed since 0.1.x release. !

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.

API docs for moeximporter.

Installation

Install moeximporter:

$ pip install moeximporter

Requirements

  • pandas

Examples

Importing modules

# Import required modules
from datetime import date
from moeximporter import MoexImporter, MoexSecurity, MoexCandlePeriods

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))

# Request candles as a pandas DataFrame
candles_df = sec.getCandleQuotesAsDataFrame(date(2023, 5, 1), date(2023, 9, 20), interval=MoexCandlePeriods.Period1Hour)

# Request candles as an array of dicts
candles_arr = sec.getCandleQuotesAsArray(date(2023, 5, 1), date(2023, 9, 20), interval=MoexCandlePeriods.Period1Hour)

Licensing

The package is distributed under MIT License. See details in LICENSE.txt file.

Metadata

Release files for moeximporter 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for moeximporter 0.2.4
File Interpreter ABI Platform
moeximporter-0.2.4-py3-none-any.whl Python 3 none any Details

Release files / moeximporter-0.2.4-py3-none-any.whl

Download URL moeximporter-0.2.4-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
315a8ba99c39ec0339bdb2798ea5f5a0a2c1481f79bc876236433ccf890a0f6c
BLAKE2b-256 checksum
How to use checksums
5aaecb50d0e5bbc7eb61d5da6046e14e1de944a72ce41a80dd15d87268bd9a1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.2.4 This release

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page