Metadata-Version: 2.1
Name: moex
Version: 2.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: moex@aioboy.tech
Maintainer: Michael R. Kisel
Maintainer-email: moex@aioboy.tech
Requires-Python: >=3.8.1,<3.15
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.13
Classifier: Programming Language :: Python :: 3.14
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.14.1)
Requires-Dist: beautifulsoup4 (<=4.15.0)
Requires-Dist: lxml (<=6.1.1)
Requires-Dist: niquests (<=3.19.1)
Requires-Dist: numpy (<=2.5.0)
Requires-Dist: pandas (<=3.0.3)
Requires-Dist: rich (<=15.0.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, Moex

# ASYNC

async def main():

    client = AsyncMoex()

    async with client:

        # client.show_templates()

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

        for stock in ("SNGSP", "YDEX"):
            url = client.render_url(template_id, engine="stock", market="shares", security=stock, board="TQBR")
            params = {"from": "2026-06-20", "till": "2026-06-26", "interval": "60"}
            result = await client.execute(url=url, **params)
            df = result.to_df()
            print(df)


try:
    loop = asyncio.get_event_loop()
except RuntimeError as e:
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)

loop.run_until_complete(main())


# SYNC

def main():

    client = Moex()

    with client:

        for stock in ("SNGSP", "YDEX"):
            url = client.render_url(409, engine="stock", market="shares", security=stock, board="TQBR")
            params = {"from": "2026-06-20", "till": "2026-06-26", "interval": "60"}
            result = client.execute(url=url, **params)
            df = result.to_df()
            print(df)


main()
```

