Metadata-Version: 2.4
Name: brokapi
Version: 0.1.0a3
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
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 :: Rust
Classifier: Typing :: Typed
Requires-Dist: pytest>=8 ; extra == 'test'
Requires-Dist: pytest-asyncio>=1.0 ; extra == 'test'
Provides-Extra: test
Summary: One interface to the APIs of Russian brokers (BCS, T-Bank, Finam) for Python: a thin layer over the Rust core of brokapi.
Keywords: trading,broker,algotrading,finance,api,asyncio
Home-Page: https://brokapi.ru
License: MIT OR Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://brokapi.ru/docs/python/
Project-URL: Homepage, https://brokapi.ru/
Project-URL: Repository, https://github.com/runinfra/brokapi

# brokapi for Python

One interface to the APIs of Russian brokers (BCS, T-Bank, Finam, ALOR): market data, orders, reconciliation and rate limits.
A thin layer over the Rust core of [brokapi](https://brokapi.ru/): `asyncio` for the events, `decimal.Decimal` for money,
the same errors and the same rules as the core.

**Open alpha.** Checked against the imitations of the brokers, not yet on live accounts. The interface can change
before the beta.

```python
import asyncio
import brokapi

async def main():
    client = await brokapi.connect("bcs")  # BCS_REFRESH_TOKEN from the environment
    sber = await client.instrument("SBER")
    book = await client.order_book(sber, depth=5)
    print(book.bids[0].price, book.asks[0].price)
    await client.close()

asyncio.run(main())
```

Stop orders, `client.raw()` (any method of a broker's API by name) and the event log with replay (`brokapi.record`) work as in
the Rust library.

Documentation: https://brokapi.ru/docs/python/. Licence: MIT or Apache-2.0.

