Modern Python client for Moscow Exchange ISS API
Project description
MOEX ISS Python Client
Modern Python client for Moscow Exchange ISS API.
Проект предназначен для загрузки, хранения и анализа данных Московской биржи в задачах:
- quantitative trading
- backtesting
- machine learning
- feature engineering
- market research
- automated trading systems
Клиент предоставляет удобный интерфейс для работы с:
- историческими данными
- OHLCV свечами
- рыночными данными
- инструментами MOEX
- shares
- futures
- research datasets
Features
Core
✅ Python 3.13+
✅ REST ISS API client
✅ Sync API (requests)
✅ Async API (httpx)
✅ Automatic pagination
✅ Retry mechanism
✅ Rate limiting
✅ JSON parsing
✅ Pandas integration
✅ Parquet export
✅ Unit tests
✅ Mock HTTP testing
Architecture
Проект построен как модульный Python клиент:
moex_iss/
├── client.py # Основной ISS клиент
├── async_client.py # Async версия клиента
├── auth.py # MOEX Passport authentication
├── session.py # HTTP session layer
│
├── endpoints.py # ISS URL builder
├── parser.py # JSON parser
├── pagination.py # Pagination logic
├── dataframe.py # Pandas adapters
│
├── limiter.py # Request rate limiter
├── models.py # Data models
├── exceptions.py # Custom exceptions
Installation
Clone repository
git clone <repository>
cd moex_iss
Create virtual environment
Windows
python -m venv .venv
.venv\Scripts\activate
Linux
python3 -m venv .venv
source .venv/bin/activate
Install dependencies
Runtime:
pip install -r requirements.txt
Development:
pip install -r requirements-dev.txt
Quant research:
pip install -r requirements-quant.txt
Install package:
pip install -e .
Quick Start
Basic client
from moex_iss import ISSClient
client = ISSClient()
data = client.get(
"/engines"
)
print(data)
Historical Data
Example: SBER history
from moex_iss import ISSClient
client = ISSClient()
df = client.history_df(
engine="stock",
market="shares",
board="TQBR",
security="SBER",
from_date="2025-01-01",
till_date="2025-02-01"
)
print(df.head())
Example:
TRADEDATE SECID CLOSE VOLUME
2025-01-01 SBER 250.5 100000
2025-01-02 SBER 252.0 120000
Candles
Получение OHLCV данных:
df = client.candles_df(
security="SBER",
interval=60
)
Поддерживаемые интервалы:
1 minute
10 minutes
60 minutes
24 daily
Result:
open high low close volume
2025-01-01 10:00 250 253 248 252 50000
Данные готовы для:
- indicators
- feature engineering
- machine learning
- backtesting
MOEX ISS Endpoints
Пример корректных endpoint:
Engines:
https://iss.moex.com/iss/engines.json
Markets:
https://iss.moex.com/iss/engines/stock/markets.json
Candles:
https://iss.moex.com/iss/engines/stock/markets/shares/boards/TQBR/securities/SBER/candles.json
Важно:
/iss/markets.json
не является существующим ISS endpoint.
Pagination
MOEX ISS ограничивает размер ответа.
Клиент автоматически поддерживает:
start=0
start=100
start=200
...
Пример:
for row in client.iter_history(
engine="stock",
market="shares",
board="TQBR",
security="GAZP"
):
print(row)
Большие датасеты загружаются без переполнения памяти.
Parquet Export
Для хранения исторических данных используется формат Parquet.
Требуется:
pyarrow
Пример:
from pathlib import Path
from moex_iss import ISSClient
Path("data").mkdir(
exist_ok=True
)
client = ISSClient()
df = client.candles_df(
"SBER",
interval=10
)
df.to_parquet(
"data/sber_10m.parquet"
)
Результат:
data/
└── sber_10m.parquet
Чтение:
import pandas as pd
df = pd.read_parquet(
"data/sber_10m.parquet"
)
Async API
Для параллельной загрузки:
from moex_iss import AsyncISSClient
async with AsyncISSClient() as client:
data = await client.get_json(
"https://iss.moex.com/iss/engines.json"
)
Использование:
- multiple instruments
- monitoring
- batch download
- realtime polling
Rate Limiting
Защита от ограничения MOEX ISS:
client = ISSClient(
rate_limit=5
)
означает:
5 requests / second
Authentication
Для приватных данных:
from moex_iss import ISSClient
from moex_iss import ISSConfig
config = ISSConfig(
username="login",
password="password"
)
client = ISSClient(
config
)
Поддерживается:
- MOEX Passport
- cookie authentication
- session persistence
Error Handling
Клиент использует собственные исключения:
from moex_iss.exceptions import (
ISSServerError,
ISSAuthenticationError,
ISSRateLimitError
)
Пример:
try:
data = client.get_json(url)
except ISSServerError:
reconnect()
Examples
examples/
├── 03_get_candles.py
├── 06_async_download.py
└── 07_export_parquet.py
Запуск:
python examples/03_get_candles.py
или:
python examples/07_export_parquet.py
Testing
Запуск:
pytest -v
Coverage:
pytest \
--cov=moex_iss \
--cov-report=term-missing
HTML:
pytest \
--cov=moex_iss \
--cov-report=html
Development
Formatting:
black .
Lint:
ruff check .
Type checking:
mypy moex_iss
Quant Pipeline
Типичный workflow:
MOEX ISS
|
v
ISSClient
|
v
Pandas DataFrame
|
v
Parquet Storage
|
v
Feature Engineering
|
v
Model
|
v
Backtesting
|
v
Trading System
Planned Features
Market Data
- order book
- trades
- quotes
Futures
- FORTS instruments
- futures candles
- open interest
Analytics
- volatility indicators
- returns calculation
- technical indicators
- microstructure features
Infrastructure
- parquet export
- parquet cache layer
- incremental updates
- Redis cache
- Docker support
- CI/CD pipeline
Requirements
Recommended:
Python >=3.13
Main dependencies:
requests
httpx
pandas
numpy
pyarrow
pydantic
tenacity
License
Apache License 2.0
Copyright (c) 2026
Licensed under the Apache License, Version 2.0.
You may obtain a copy of the License at:
https://www.apache.org/licenses/LICENSE-2.0
Disclaimer
Проект предназначен для исследовательских и образовательных целей.
Перед использованием в реальной торговле необходимо учитывать:
- комиссии
- спреды
- проскальзывание
- ликвидность инструментов
- ограничения API
- рыночные режимы
- риск управления капиталом
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moex_iss-0.2.0.post0.tar.gz.
File metadata
- Download URL: moex_iss-0.2.0.post0.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6342743b2775faa4b9cb1790d4348779fcbe1841f25a47e0ef4bfd7f6a77894
|
|
| MD5 |
e5cff35bf7399173890d1ac6b9acaf9c
|
|
| BLAKE2b-256 |
6a8775f2bf291781672e7af0dc2dc6241a9336599711474f7327f233996d2f0d
|
Provenance
The following attestation bundles were made for moex_iss-0.2.0.post0.tar.gz:
Publisher:
cd.yml on 8bitniksis/moex_iss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moex_iss-0.2.0.post0.tar.gz -
Subject digest:
f6342743b2775faa4b9cb1790d4348779fcbe1841f25a47e0ef4bfd7f6a77894 - Sigstore transparency entry: 2195298467
- Sigstore integration time:
-
Permalink:
8bitniksis/moex_iss@7eb5315132463f2e1b463a818cd9fb643be12a1a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/8bitniksis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7eb5315132463f2e1b463a818cd9fb643be12a1a -
Trigger Event:
push
-
Statement type:
File details
Details for the file moex_iss-0.2.0.post0-py3-none-any.whl.
File metadata
- Download URL: moex_iss-0.2.0.post0-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
713a79c0d5a616ed0d8622b474c72a46347d70a462a6a4dfa70982d9f0e5cde5
|
|
| MD5 |
887dd63480c75522d6761ca30b575d14
|
|
| BLAKE2b-256 |
50960e0898bc13885b786848fb85acc1dab342f498ca970d8bb9278caf89f9ac
|
Provenance
The following attestation bundles were made for moex_iss-0.2.0.post0-py3-none-any.whl:
Publisher:
cd.yml on 8bitniksis/moex_iss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moex_iss-0.2.0.post0-py3-none-any.whl -
Subject digest:
713a79c0d5a616ed0d8622b474c72a46347d70a462a6a4dfa70982d9f0e5cde5 - Sigstore transparency entry: 2195298534
- Sigstore integration time:
-
Permalink:
8bitniksis/moex_iss@7eb5315132463f2e1b463a818cd9fb643be12a1a -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/8bitniksis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7eb5315132463f2e1b463a818cd9fb643be12a1a -
Trigger Event:
push
-
Statement type: