Package to create JRAGBEER Common Functions
Project description
jragbeer_common
Overview
A Python utility library containing common functions and tools used across various projects. This library provides reusable components for:
- Data processing and engineering
- Azure blob storage operations
- Dask distributed computing
- Ubuntu system operations
Features
-
Data Engineering Utilities
- DataFrame manipulation and cleaning
- SQL database operations
- Email notifications
- Date/time processing
- Logging configuration
-
Azure Integration
- Blob storage upload/download
- Parquet file handling
- Container management
- Batch operations
-
Dask Distributed Computing
- Cluster deployment and management
- Worker allocation
- Task scheduling
- Remote execution
-
Ubuntu System Operations
- Remote command execution
- Process management
- System monitoring
- File operations
Installation
- Install
uv(recommended):
pip install uv
- Create and activate a virtual environment:
uv venv
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # Windows
- Install the package:
uv pip install jragbeer-common
Development Setup
- Clone the repository:
git clone https://github.com/jragbeer/jragbeer_common.git
cd jragbeer_common
- Create a virtual environment and install dependencies:
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
- Install development dependencies:
uv pip install -e ".[dev]"
- Install pre-commit hooks:
pre-commit install
Usage
from jragbeer_common import (
jragbeer_common_data_eng,
jragbeer_common_azure,
jragbeer_common_dask,
jragbeer_common_ubuntu
)
# Data Engineering
jragbeer_common_data_eng.parse_date_features(df)
# Azure Operations
jragbeer_common_azure.adls_upload_file("path/to/file", "blob_name")
# Dask Operations
jragbeer_common_dask.deploy_dask_home_setup()
# Ubuntu Operations
jragbeer_common_ubuntu.execute_cmd_ubuntu_sudo("command")
Environment Variables
The following environment variables are required:
# Azure Storage
adls_connection_string="your_connection_string"
adls_container_name="your_container"
# Database
local_db_username="username"
local_db_password="password"
local_db_address="address"
local_db_port="port"
# Cluster Configuration
cluster_server_1_address="address"
cluster_server_1_username="username"
cluster_server_1_password="password"
Building and Distribution
- Build the package:
uv build
- Install locally for testing:
uv pip install dist/jragbeer_common-0.2.0-py3-none-any.whl
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting:
pre-commit run --all-files
pytest
- Submit a pull request
License
Copyright 2024 Julien Ragbeer
Licensed under the Apache License, Version 2.0
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
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 jragbeer_common-0.2.48.tar.gz.
File metadata
- Download URL: jragbeer_common-0.2.48.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f7a3f58bf0d501aed0d9e13e23dc8f1086a0cf292dc14198896464e3ac770d6
|
|
| MD5 |
3cbc39d2edcd186b90b2675a533776dc
|
|
| BLAKE2b-256 |
114b056771076494da4a15c80e88cb9bf1bc9f68deb4061da7ae506fa181349b
|
File details
Details for the file jragbeer_common-0.2.48-py3-none-any.whl.
File metadata
- Download URL: jragbeer_common-0.2.48-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59c5f1b4c6a6e812e7abfcd37cfd2b304c03b5707a3806475a70ae3cf7e612ec
|
|
| MD5 |
5a484a674ca4a4a4f8ff8fdbb9ac4ff1
|
|
| BLAKE2b-256 |
0219ac1a802e527ed8ba0d6dc591d8df3ffd9de77e752d675b4b7281aed8e743
|