Набор простых функций для работы с данными
Project description
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
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
otvertka-0.1.14.tar.gz
(481.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 otvertka-0.1.14.tar.gz.
File metadata
- Download URL: otvertka-0.1.14.tar.gz
- Upload date:
- Size: 481.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce75af07d950893d0b2081443244462fe856fc538f33d3e2ddbb94274a8fd922
|
|
| MD5 |
c64c8a7dbe7c42bd36af649ef24c41ad
|
|
| BLAKE2b-256 |
388b198b34c21c85354fac1e53231ea6191228dc3455b094a3db9ac6cc0e3dac
|
File details
Details for the file otvertka-0.1.14-py3-none-any.whl.
File metadata
- Download URL: otvertka-0.1.14-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376b24ab97237d44c885668993d3eb72e38c54c0de39795362681dff901d74ca
|
|
| MD5 |
9a4e9f2c6c01a9240cdafb34ddaf5e39
|
|
| BLAKE2b-256 |
3af4f161a1642296d7c16abad0d47cd7d00460fc6671b08648599407499c4d57
|