Skip to main content

Bondana Client

PyPI - Python Version

Неофициальная обертка официального Tinkoff Invest API v2, оптимизированная для торговли облигациями на языке Python.

⚠️ На данный момент отлажена работа на облигациях номиналом 1000 рублей, на других номиналах не тестировалось

Установка клиента

$ pip install bondana-client

Как пользоваться

Инициализация клиента

from bondana_client import Bondana

TOKEN = 'token'

client = Bondana(TOKEN)

Получить баланс свободных денег в рублях

balance_rub, blocked = client.get_balance('rub')

Получение списка бумаг в портфеле

client.portfolio.portfolio_get()
for bond in portfolio.positions:
    print(bond)

Получение истории операций

from datetime import datetime, timedelta

nw = datetime.now() - timedelta(days=1) # получим сделки за последний день
d1 = datetime(nw.year, nw.month, nw.day, 0, 0, 0, tzinfo=timezone('Europe/Moscow'))  
d2 = datetime.now(tz=timezone('Europe/Moscow')) 

ops = client.operations.operations_get(limit=1000, from_=d1, to=d2)

ops.reverse()
for op in ops:
    print(op.get("figi"), op.get("price"), op.get("payment"), op.get("quantity"))

Постановка лимитной заявки

# лимитная заявка на покупку
lots  = 1
price = 987.65
figi = "BBG00Y9B45C2"
order_limit = client.orders.orders_limit_order_post(figi, 
	limit_order_request = {"lots": lots, "operation": "Buy", "price":price, })  

# лимитная заявка на продажу
lots  = 1
price = 997.65
figi = "BBG00Y9B45C2"
order_limit = client.orders.orders_limit_order_post(figi, 
	limit_order_request = {"lots": lots, "operation": "Sell", "price":price, })                

Получение списка активных заявок

client.orders.orders_get() # список заявок в формате объектов Tinkoff API
client.orders.orders_get_json() # список заявок в формате JSON

for order in client.orders.orders_get_json():
	print(order.get("order_id"), order.get("operation"), order.get("figi"))

Отмена заявки на покупку

# последовательная отмена всех активных заявок, для примера
for order in client.orders.orders_get_json():
	client.orders.orders_cancel_post(order.get("order_id"))

Просмотр стакана по figi

figi = "BBG00Y9B45C2"
orderbook = client.market.market_orderbook_get_dict(figi, 20)

Получение списка всех доступных облигаций

bonds = client.market.market_bonds_get()
for bond in bonds:
	print(bond)

Получение свечей

candles = client.market.candles(figi, from_, to, interval, candle_source_type)
for candle in candles:
	print(candle)

TODO:

получение лотности

шаг цены

Metadata

Release files for bondana-client 2026.10.25195756

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bondana-client 2026.10.25195756
File Size Uploaded Provenance Actions
bondana_client-2026.10.25195756.tar.gz 6.3 kB Without provenance Details for bondana_client-2026.10.25195756.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bondana-client 2026.10.25195756
File Interpreter ABI Platform Actions
bondana_client-2026.10.25195756-py3-none-any.whl Python 3 none any Details for bondana_client-2026.10.25195756-py3-none-any.whl

Total release size: 12.9 kB

Release files / bondana_client-2026.10.25195756.tar.gz

Download URL bondana_client-2026.10.25195756.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b19a76290a0bb04ab85c6d4f780cf8c8bcb663ad2081e1a1fe7fe13a21b6232b
BLAKE2b-256 checksum
How to use checksums
cf72f14365882d0acee1a4b0326362f8ef50bee11221d2371ed33d07b98417f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / bondana_client-2026.10.25195756-py3-none-any.whl

Download URL bondana_client-2026.10.25195756-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66003e06719e0f1956d3cb5fef3b87bc6ca5d078d6c379c2b3544260a0d48c7f
BLAKE2b-256 checksum
How to use checksums
4a45ceff197be04c8cf59c5d013d4e2cd44ba627501935d033c49e1ca64e5857
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for bondana-client 2026.10.25195756

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page