Skip to main content

Utility functions and tools for data processing and analysis

Project description

Orama Utils

A collection of utility functions for data processing and feature engineering.

Features

  • Date feature generation
  • Holiday feature generation (supporting ES and IT countries)

Installation

You can install the package using pip:

pip install orama-utils

For development installation:

git clone https://github.com/Orama-Solutions/utils.git
cd utils
pip install -e .[dev]

Usage

Holiday Features

Add holiday-related features to your DataFrame:

import pandas as pd
from orama_utils import add_holiday_features

# Create your DataFrame
df = pd.DataFrame({
    'date': ['2023-01-01', '2023-12-25'],
    'country': ['ES', 'ES'],
    'county': ['ES-MD', 'ES-CT']
})

# Add holiday features
result = add_holiday_features(df)

The function adds three columns:

  • is_public_holiday: True for national holidays
  • is_local_holiday: True for county-specific holidays
  • many_counties_holiday: True when multiple counties celebrate the holiday

You can customize the threshold for many counties:

result = add_holiday_features(df, county_threshold=5)

Date Features

Add date-related features to your DataFrame:

from orama_utils import add_date_features

result = add_date_features(df, date_column='date')

Development

Running Tests

pytest tests/

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

orama_utils-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

orama_utils-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file orama_utils-0.1.0.tar.gz.

File metadata

  • Download URL: orama_utils-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for orama_utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb13093ede93f99c0822c766a78243206ac5af3772ea7a24a1822eaf54d52073
MD5 171a58fe5987ada2c6de651b2a28543b
BLAKE2b-256 ea3447011d3e785f58d781264a56ec58a91458314b90e26442ffc017d4c7ee93

See more details on using hashes here.

File details

Details for the file orama_utils-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: orama_utils-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for orama_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c50800aa286577f48409d0e93e315914d51bbc26325a0b502ec3aa3a898d851
MD5 a33ee348f2f06e45649f82860eb7761c
BLAKE2b-256 d3946295ebdc00d113c385db7148f8fd17e8b85884055555e4b8279ab1f8c7d8

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