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")
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-0.1.0.tar.gz
(3.2 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-0.1.0.tar.gz.
File metadata
- Download URL: sspart_py_lib-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07a238348acbe8f9248962c72c94258cf99d6c9b1e7188de316d7dbc19297eb0
|
|
| MD5 |
2880dbf19e2608bb5d2e144b7bbd2455
|
|
| BLAKE2b-256 |
016eaadd58014a5ae78b02cfa6740353461291267039c9924f500ea3608f26ec
|
File details
Details for the file sspart_py_lib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sspart_py_lib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1fb5cb4bc19f7e2e7cf595c106794f58298c82efb902c362b3330e8e00f876b
|
|
| MD5 |
3aa022d4430c74ad626140f8bef71495
|
|
| BLAKE2b-256 |
8474f13c8a9043f7fefc6b59bb90ccfbc62b35bd61f5aa92d084175acb0f6679
|