Reusable Python library with PostgreSQL, ClickHouse, and Telegram helpers.
Project description
sspart-py-lib
Reusable Python library package for:
- PostgreSQL
- ClickHouse
- Telegram
1) Create virtual environment and install locally
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .
2) Use in another project
Option A: install from local path
pip install /absolute/path/to/sspart-py-lib
Option B: install in editable mode during development
pip install -e /absolute/path/to/sspart-py-lib
3) Quick usage
from sspart_py_lib import PostgresClient, ClickHouseClient, TelegramClient
pg = PostgresClient("postgresql://user:pass@localhost:5432/app")
result = pg.execute("INSERT INTO events(name) VALUES (%s)", ("boot",))
print(result.rowcount, result.status_message)
rows = pg.fetch_all("SELECT NOW()")
ch = ClickHouseClient(host="localhost", port=8123, username="default", password="")
result = ch.query("SELECT version()")
bot = TelegramClient("<telegram-bot-token>")
# await bot.send_text(chat_id=123456, text="Hello from sspart-py-lib")
Project structure
sspart-py-lib/
pyproject.toml
README.md
src/
sspart_py_lib/
__init__.py
postgres.py
clickhouse.py
telegram.py
Next improvements (later)
- Add retries / timeouts configuration
- Add connection pooling
- Add structured logging
- Add integration tests with Docker
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sspart_py_lib-1.1.0.tar.gz
(7.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sspart_py_lib-1.1.0.tar.gz.
File metadata
- Download URL: sspart_py_lib-1.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1472c45031c4c752e13652096fcbe3c4dbf6b6df1a9d6efdc8358a2915899c96
|
|
| MD5 |
2bf465e10125300852f72473e5f887eb
|
|
| BLAKE2b-256 |
8f267547b29a373b271e98c60828a7c9aa9f6f5747f2122f77081bbf1855a51c
|
File details
Details for the file sspart_py_lib-1.1.0-py3-none-any.whl.
File metadata
- Download URL: sspart_py_lib-1.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae80bcba480ac2dd63fb101e55ad7ae2e88bc50f3409ad6558321942ee5576d6
|
|
| MD5 |
6886e3ca40c75cea40527cd8481c1bd4
|
|
| BLAKE2b-256 |
39a4165e5876ab3a1e8c96fe408a1263bba3a7168bfb0fceb8b423e0691a25fd
|