otvertka
Набор простых функций для работы с данными в ClickHouse.
Установка
pip install otvertka
Использование
from otvertka import fetch_data, generate_ab_test_data, get_dates_tuples, get_table_info, handle_outliers
# Получить информацию о таблице
get_table_info('my_table')
# Выполнить SQL запрос
df = fetch_data('SELECT * FROM my_table LIMIT 10')
# Разбить временной интервал на периоды
dates = get_dates_tuples('2024-01-01', '2024-02-01', days_interval=7)
# Сгенерировать тестовые данные для A/B теста
df = generate_ab_test_data(
groups=['control', 'test'],
num_observations_per_group=10000,
effect_size=0.05,
base_retention_prob=0.3,
base_impressions_mean=5,
base_revenue_scale=1.0
)
# Обработать выбросы в данных
df = handle_outliers(
df,
target_column='revenue',
threshold_quantile=0.995,
handling_method='replace_threshold',
outlier_type='upper',
grouping_column='group'
)
Требования
- Python 3.7+
- Необходимые переменные окружения:
CH_USER- пользователь ClickHouseCH_PASSWORD- пароль ClickHouseCH_HOST- хост ClickHouse (по умолчанию: localhost)CH_PORT- порт ClickHouse (по умолчанию: 8123)
Лицензия
MIT
Metadata
Release files for otvertka 0.1.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| otvertka-0.1.16.tar.gz | 481.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| otvertka-0.1.16-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 489.3 kB
Release files / otvertka-0.1.16.tar.gz
| Download URL | otvertka-0.1.16.tar.gz |
|---|---|
| Size | 481.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cb04be44e0e3e1ec15fdff4dd587aba8e066463e9ce4f4aea90343ea858230c
|
|
BLAKE2b-256 checksum How to use checksums |
36b1da0e414a98d1cac03f7a576cf04518260aebe6d582ca8bd3a685293b7afc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.0
|
Release files / otvertka-0.1.16-py3-none-any.whl
| Download URL | otvertka-0.1.16-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3751bdba295d0d1767c98b7e2da874fd39a66d6b31bec519229d420e6a528165
|
|
BLAKE2b-256 checksum How to use checksums |
21232e2d2a9d6f81691184f8b6fa8ec19c44118b399387e52728afced7c455cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.0
|