Metadata-Version: 2.1
Name: moex
Version: 1.0.0
Summary: MoscowExchange ISS Queries implementation
License: MIT
Keywords: moex,moex iss,async moex,moscow,exchange,MoscowExchange,finance,stocks
Author: Michael R. Kisel
Author-email: aioboy@yandex.com
Maintainer: Michael R. Kisel
Maintainer-email: aioboy@yandex.com
Requires-Python: >=3.8.1,<3.13
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Home Automation
Classifier: Topic :: Internet
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Office/Business :: Financial :: Point-Of-Sale
Classifier: Topic :: Office/Business :: News/Diary
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: aiohttp (<=3.10.11)
Requires-Dist: beautifulsoup4 (<=4.11.1)
Requires-Dist: lxml (<=4.9.1)
Requires-Dist: numpy (<2.0.0)
Requires-Dist: pandas (<=2.0.3)
Requires-Dist: rich (<=12.6.0)
Project-URL: documentation, https://aioboy.tech/p/moex/
Project-URL: homepage, https://pypi.org/project/moex
Project-URL: repository, https://gitlab.com/aioboy/moex/
Description-Content-Type: text/markdown

<p align="center">
    <a href="https://pypi.org/project/moex"><img src="https://gitlab.com/aioboy/moex/-/raw/master/assets/cover.gif" alt="MOEX"></a>
</p>
<p align="center">
    <a href="https://pypi.org/project/moex"><img src="https://img.shields.io/pypi/v/moex.svg?style=flat-square&logo=appveyor" alt="Version"></a>
    <a href="https://pypi.org/project/moex"><img src="https://img.shields.io/pypi/l/moex.svg?style=flat-square&logo=appveyor&color=blueviolet" alt="License"></a>
    <a href="https://pypi.org/project/moex"><img src="https://img.shields.io/pypi/pyversions/moex.svg?style=flat-square&logo=appveyor" alt="Python"></a>
    <a href="https://pypi.org/project/moex"><img src="https://img.shields.io/pypi/status/moex.svg?style=flat-square&logo=appveyor" alt="Status"></a>
    <a href="https://pypi.org/project/moex"><img src="https://img.shields.io/pypi/format/moex.svg?style=flat-square&logo=appveyor&color=yellow" alt="Format"></a>
    <a href="https://pypi.org/project/moex"><img src="https://img.shields.io/pypi/wheel/moex.svg?style=flat-square&logo=appveyor&color=red" alt="Wheel"></a>
    <a href="https://pypi.org/project/moex"><img src="https://img.shields.io/gitlab/pipeline-status/aioboy%2Fmoex?branch=master&style=flat-square&logo=appveyor" alt="Build"></a>
    <a href="https://pypi.org/project/moex"><img src="https://gitlab.com/aioboy/moex/-/raw/master/assets/coverage.svg" alt="Coverage"></a>
    <a href="https://pepy.tech/project/moex"><img src="https://static.pepy.tech/personalized-badge/moex?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads" alt="Downloads"></a>
    <br><br><br>
</p>

# MOEX

A little bit complex and more powerful implementation for [ISS Queries](https://iss.moex.com/iss/reference/).

## INSTALL

```bash
pip install moex
```

## USAGE

```python
import asyncio
from moex import AsyncMoex


async def main(amoex):
    async with amoex:
        amoex.show_templates()

        template_id = 409
        for tmpl in amoex.find_template("/candles"):
            print(f"Template: {tmpl.id}. Path: {tmpl.path}")
            await amoex.show_template_doc(tmpl.id)
            template_id = tmpl.id

    async with amoex:
        for stock in ("SNGSP", "YNDX"):
            url = amoex.render_url(
                template_id, engine="stock", market="shares", security="SNGSP", board="TQBR"
                )
            dt_params = {"from": "2025-05-01", "till": "2025-05-20", "interval": "60"}
            candles = await amoex.execute(url=url, **dt_params)
            df = candles.to_df()
            print(df)

amoex = AsyncMoex()
loop = asyncio.get_event_loop()
loop.run_until_complete(main(amoex))
```

