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.1.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.1.tar.gz.
File metadata
- Download URL: sspart_py_lib-1.1.1.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 |
83fbb41269e42127abf9ce47035a0a705c8f11de5b2df62a85ea93b5ca132a95
|
|
| MD5 |
1669a5ccf50aa1914c25226b64ebf826
|
|
| BLAKE2b-256 |
8c8ebaee28117dd6f4c2c65059d033958215c8dc40631f5163c04f1dae569d8b
|
File details
Details for the file sspart_py_lib-1.1.1-py3-none-any.whl.
File metadata
- Download URL: sspart_py_lib-1.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 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 |
37fc4cb77a808f6d81157f036678ac12b9a2f8ae98c761a58e7b5bc66d42e760
|
|
| MD5 |
f7a92d3096b103b9d235e0543493df27
|
|
| BLAKE2b-256 |
a9037daf7cba5f3823cbce4f719345d0b6be603e8f34bab03611b8c08a5e681e
|