Git Product home page Git Product logo

aiomoex's Issues

Ошибочное поведение get_board_candles

Python 3.8, jupyter notebook.
Пример 1:

async def main():
    security = "LKOH"
    interval = 24
    start = "2020-12-01"
    end = "2020-12-20"
    async with aiohttp.ClientSession() as session:
        data = await aiomoex.get_board_candles(session, security, interval, start, end) 
        df = pd.DataFrame(data)
        print(df.head(), '\n')
        print(df.tail(), '\n')
        df.info()
await main()

Выполняется корректно ("верхняя" пятерка, "нижняя" пятерка и информация
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 14 entries, 0 to 13. и т.д.)

Пример 2: добавим определение board = "TQBR" явно для тикера "LKOH":

async def main():
    security = 'LKOH'
    interval = 24
    start = '2020-12-01'
    end = '2020-12-20'
    board = 'TQBR' 
    async with aiohttp.ClientSession() as session:
        data = await aiomoex.get_board_candles(session, security, board, interval, start, end) 
        df = pd.DataFrame(data)
        print(df.head(), '\n')
        print(df.tail(), '\n')
        df.info()
await main()

Уже не выполняется корректно.
<class 'pandas.core.frame.DataFrame'>
Index: 0 entries
Empty DataFrame

Пример 3 (собственно откуда ноги замешательства начали расти) попробуем извлечь данные для ETF FXGD (есть для
'TQTF' и для 'TQTD' - рубли и доллары соответственно):

async def main():
    security = 'FXGD'
    interval = 24
    start = "2020-12-01"
    end = "2020-12-20"
    board = 'TQTF' 
    async with aiohttp.ClientSession() as session:
        data = await aiomoex.get_board_candles(session, security, board, interval, start, end) 
        df = pd.DataFrame(data)
        print(df.head(), '\n')
        print(df.tail(), '\n')
        df.info()
await main()

Результат: Empty DataFrame
Если заменить board = 'TQTD', то результат аналогичный.

Не выполняется запрос из примера в документации

При выполнении примера функции из документации вываливается ошибка


`import asyncio

import aiomoex
import pandas as pd

async def main():
request_url = ('https://iss.moex.com/iss/engines/stock/'
'markets/shares/boards/TQBR/securities.json')
arguments = {'securities.columns': ('SECID,'
'REGNUMBER,'
'LOTSIZE,'
'SHORTNAME')}
iss = aiomoex.ISSClient(request_url, arguments)
iss.start_session()
data = await iss.get()
df = pd.DataFrame(data['securities'])
df.set_index('SECID', inplace=True)
print(df.head(), '\n')
print(df.tail(), '\n')
df.info()
await iss.close_session()

asyncio.run(main())`


RuntimeError Traceback (most recent call last)
in
23
24
---> 25 asyncio.run(main())

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/runners.py in run(main, debug)
31 """
32 if events._get_running_loop() is not None:
---> 33 raise RuntimeError(
34 "asyncio.run() cannot be called from a running event loop")
35

RuntimeError: asyncio.run() cannot be called from a running event loop

Авторизация

Простите, а авторизация но мосбирже поддерживается?

На мою убунту не ставится

sudo pip install aiomoex
Downloading/unpacking aiomoex
Downloading aiomoex-1.2.0.tar.gz
Running setup.py (path:/tmp/pip_build_root/aiomoex/setup.py) egg_info for package aiomoex
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/aiomoex/setup.py", line 8, in
with open(pathlib.Path(file).parent / «aiomoex» / "init.py") as file:
TypeError: coercing to Unicode: need string or buffer, PosixPath found
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip_build_root/aiomoex/setup.py", line 8, in

with open(pathlib.Path(file).parent / «aiomoex» / "init.py") as file:

TypeError: coercing to Unicode: need string or buffer, PosixPath found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.