Skip to main content

MoscowExchange ISS Queries implementation

Project description

MOEX

Version License Python Status Format Wheel Build Coverage Downloads


MOEX

A little bit complex and more powerful implementation for ISS Queries. See more in documentation

INSTALL

pip install moex

USAGE

import asyncio
import aiohttp
from moex import AIOMoex


async def main(aio_moex, engine="stock", market="shares", board="TQBR"):
    async with aiohttp.ClientSession() as session:
        await aio_moex.load(session=session, output_format=".json")

        # aio_moex.show_templates()

        for tmpl in aio_moex.find_template("/candles"):
            print(f"Template: {tmpl.id}. Path: {tmpl.path}")
            await aio_moex.show_template_doc(session, tmpl.id)

        df_sngsp = (
            await aio_moex.execute(
                session=session,
                url=aio_moex.render_url(
                    46,
                    engine=engine,
                    market=market,
                    security="SNGSP",
                    board=board
                    ),
                **{
                    "from": "2022-02-24",
                    "till": "2022-10-24",
                    "interval": "60"
                    }
                )
            ).to_df()
        df_yndx = (
            await aio_moex.execute(
                session=session,
                url=aio_moex.render_url(
                    155,
                    engine=engine,
                    market=market,
                    security="YNDX"
                    ),
                till="2022-01-01"
                )
            ).to_df()

        for df in (df_sngsp, df_yndx):
            print(df)     


aio_moex = AIOMoex()
loop = asyncio.get_event_loop()
loop.run_until_complete(main(aio_moex))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moex-0.0.1.tar.gz (13.3 kB view hashes)

Uploaded Source

Built Distribution

moex-0.0.1-py3-none-any.whl (15.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page