Skip to main content

Package to create JRAGBEER Common Functions

Project description

jragbeer_common

License Python 3.10 pre-commit

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

  1. Install uv (recommended):
pip install uv
  1. Create and activate a virtual environment:
uv venv
source .venv/bin/activate  # Linux/Mac
# or
.venv\Scripts\activate  # Windows
  1. Install the package:
uv pip install jragbeer-common

Development Setup

  1. Clone the repository:
git clone https://github.com/jragbeer/jragbeer_common.git
cd jragbeer_common
  1. Create a virtual environment and install dependencies:
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
  1. Install development dependencies:
uv pip install -e ".[dev]"
  1. 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

  1. Build the package:
uv build
  1. Install locally for testing:
uv pip install dist/jragbeer_common-0.2.0-py3-none-any.whl

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting:
pre-commit run --all-files
pytest
  1. Submit a pull request

License

Copyright 2024 Julien Ragbeer

Licensed under the Apache License, Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jragbeer_common-0.2.46.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jragbeer_common-0.2.46-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file jragbeer_common-0.2.46.tar.gz.

File metadata

  • Download URL: jragbeer_common-0.2.46.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

Hashes for jragbeer_common-0.2.46.tar.gz
Algorithm Hash digest
SHA256 5375448034d0a810553535204a9fed1a560c0d823d52c35bcba555f4ec66639b
MD5 e316f17d10eb7b33b9c9f93f0f0a25b6
BLAKE2b-256 7c38458f487cc731f74fa420c7eed4131af088d486aa740010b4161950e9441d

See more details on using hashes here.

File details

Details for the file jragbeer_common-0.2.46-py3-none-any.whl.

File metadata

  • Download URL: jragbeer_common-0.2.46-py3-none-any.whl
  • Upload date:
  • Size: 28.0 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

Hashes for jragbeer_common-0.2.46-py3-none-any.whl
Algorithm Hash digest
SHA256 81956372b0dcad9614943b443c4080dbdbd15dd9949c5bc7f38306bb5d3cadb6
MD5 aa608ca15a70bcbd64a9678a3b6bf8d8
BLAKE2b-256 58090d0e06677b27f388cdd0ff6fabb8dfa5016ec0e6c7ad72f71c6a793941f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page