Skip to main content

A Python library to handle the tedious parts of Data Science and AI—so you don't have to.

Project description

boring-utils

For every project involving data, there's a lot of tedious repetitive work that goes into it, which results in the creation of reusable scripts that greatly automate the process for you. What if instead of copy and pasting these files into new projects, there was one library that simplified things, and get solutions done through one line of code?

Introducing boring-utils — a Python library focused on simplifying tedious, boring tasks involving data management, such as downloading files, managing datasets, storing and retrieving data in various formats, and much more.

📦 Installation

Using pip

To install boring-utils using pip, run the following command:

pip install boring-utils

Using uv (Recommended)

If you're using uv, the modern Python package installer, you can install boring-utils with:

uv pip install boring-utils

Or if you're using uv as a project manager:

uv add boring-utils

Requirements

  • Python >= 3.13
  • Dependencies:
    • pandas >= 3.0.2 — Data manipulation and analysis
    • requests >= 2.33.1 — HTTP requests for downloading files

✨ Main Features

1. Data Collection 🔽

Easily download and manage files from the web:

  • Download single files with progress tracking
  • Download multiple files in batch operations
  • Automatic filename detection from HTTP headers or URLs
  • Unzip archives automatically

Example:

from boring_utils.data.data_collecting import download_file, download_several_files
from pathlib import Path

# Download a single file
download_file("https://example.com/data.csv", Path("./data"))

# Download multiple files
urls = [
    "https://example.com/file1.zip",
    "https://example.com/file2.csv"
]
download_several_files(urls)

2. Data Storage 💾

Save and load data in multiple formats with a unified interface:

  • JSON — Store structured data with customizable indentation
  • Pickle — Python object serialization
  • CSV — Tabular data format
  • Parquet — Efficient columnar storage
  • YAML & XML — Structured data formats

Example:

from boring_utils.data.data_storage import save_json, save_csv, load_json
from pathlib import Path

# Save data as JSON
data = {"name": "John", "age": 30}
save_json(data, "output.json")

# Load data from JSON
loaded = load_json("output.json")

3. Helper Utilities 🔧

  • Path Management — Preconfigured directories for organized data storage
  • Constants — Predefined file extensions and default HTTP headers
  • Directory Utilities — Automatic directory creation and validation

Example:

from boring_utils.helpers._paths import DATA_DIRECTORY_PATH
from boring_utils.helpers.constants import DATA_EXTENSIONS

print(f"Data directory: {DATA_DIRECTORY_PATH}")
print(f"Supported formats: {DATA_EXTENSIONS}")

4. Network Utilities 🌐

  • Default headers for HTTP requests
  • User-Agent configuration — Avoid blocking by providing proper headers
  • Extensible networking features for data collection

🚀 Quick Start

import pandas as pd
from boring_utils.data import data_collecting, data_storage
from pathlib import Path

# Download a CSV file
data_collecting.download_file(
    "https://example.com/dataset.csv",
    dest_path=Path("./data/my_dataset.csv")
)

# Load and process with pandas
df = pd.read_csv("./data/my_dataset.csv")

# Save processed data
data_storage.save_json(df.head().to_dict(), "sample.json")

📚 Documentation

For detailed documentation on each module, please refer to the docstrings in the source code or check the GitHub repository.

🤝 Contributing

We welcome contributions! Please read our CONTRIBUTING.md for guidelines on how to contribute to this project.

📝 License

This project is licensed under the terms specified in the LICENSE file.

PyPi Page

This project is also available in the PyPI page.

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

boring_utils-0.2.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

boring_utils-0.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file boring_utils-0.2.0.tar.gz.

File metadata

  • Download URL: boring_utils-0.2.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for boring_utils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e82ef6be1a9d488a4f2fb56f5080e8746e9807abb050c3aad560405b576a9a0f
MD5 3b032794e191ab9f3a3f182c3f2e2f83
BLAKE2b-256 bca4ca10a750b73f76bdbec0c791ea55fd89fdd1ecad782760d19196dbb5d0aa

See more details on using hashes here.

File details

Details for the file boring_utils-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: boring_utils-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for boring_utils-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d83e6de2fd919ce31924d9d1a791763fa85a8ab1ba47c0b7c536dded25f2efa
MD5 a2a986cd2286d476ba99eaaa25d08545
BLAKE2b-256 fe2a660353818b1e5116a8d6b63d73bcd23eb1559c23edfaf75f38231af8df2f

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