Metadata-Version: 2.4
Name: pybinbot
Version: 2.1.1
Summary: Utility functions for the binbot project.
Author-email: Carlos Wu <carkodw@gmail.com>
Requires-Python: >=3.15
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic[email]>=2.0.0
Requires-Dist: numpy==2.5.4
Requires-Dist: pandas==3.1.1
Requires-Dist: pandas-stubs==3.1.0.261029
Requires-Dist: requests>=2.32.5
Requires-Dist: kucoin-universal-sdk>=1.3.2
Requires-Dist: aiohttp<3.15,>=3.14.1
Requires-Dist: websocket-client>=1.9.0
Requires-Dist: python-dotenv>=1.2.1
Requires-Dist: python-telegram-bot>=22.1
Requires-Dist: pandera>=0.29.0
Provides-Extra: dev
Requires-Dist: pytest>=9.0.2; extra == "dev"
Requires-Dist: ruff>=0.11.12; extra == "dev"
Requires-Dist: mypy>=1.19.1; extra == "dev"
Requires-Dist: types-requests>=2.32.4.20260107; extra == "dev"
Requires-Dist: types-python-dateutil; extra == "dev"
Requires-Dist: httpx>=0.28.1; extra == "dev"
Requires-Dist: pytest-asyncio>=1.3.0; extra == "dev"
Dynamic: license-file

# PyBinbot

Utility functions for the binbot project. Most of the code here is not runnable, there's no server or individual scripts, you simply move code to here when it's used in both binbot and binquant.

``pybinbot`` is the public API module for the distribution.

This module re-exports the internal ``shared`` and ``models`` packages and the most commonly used helpers and enums so consumers can simply::

        from pybinbot import round_numbers, ExchangeId

Python 3.15 or newer is required. Pandas and NumPy use matching version pins in
pybinbot, binbot, and binquant. Import these libraries directly:

```python
import numpy as np
import pandas as pd
```


## Installation

```bash
uv sync --extra dev
```

`--extra dev` also installs development tools like ruff and mypy

## Telegram delivery

Import `TelegramDelivery` from `pybinbot.shared.telegram_delivery`. Initialization
loads the application's `.env` and reads `TELEGRAM_BOT_KEY` and `TELEGRAM_USER_ID`,
without overriding existing environment variables. Credentials may also be
passed explicitly.

Use `send_once(message)` for a synchronous attempt with a short timeout and no
retry or cooldown. Use `await send(message)` for asynchronous delivery with
rate-limit retries and optional spacing configured at initialization. Both use
HTML formatting and disable link previews. Delivery does not persist messages.
The Telegram library is installed as a dependency of pybinbot.


## Publishing

1. Save your changes and do the usual Git flow (add, commit, don't push the changes yet).
2. Bump the version, choose one of these:

```bash
make bump-patch
```
or 

```bash
make bump-minor
```

or

```bash
make bump-major
```

3. Git tag the version for Github. This will read the bump version. There's a convenience command:
```
make tag
```

4. `git commit --amend`. This is to put these new changes in the previous commit so we don't dup uncessary commits. Then `git push`


For further commands take a look at the `Makefile` such as testing `make test`
