Install the package via pip or from source code using Git.
pip install data-utils-py
Or install from source:
git clone https://github.com/yourusername/data-utils
cd data-utils
python setup.py install
Install the package via pip or from source code using Git.
pip install data-utils-py
Or install from source:
git clone https://github.com/yourusername/data-utils
cd data-utils
python setup.py install
The data_utils package provides helper functions for various utility tasks in data processing.
This example shows how to import the library and use a simple function.
from data_utils import strings, numbers, lists, dates
# Capitalize every word in a sentence
result = strings.title_case("hello world")
print(result) # Output: Hello World
Use these functions to modify and clean up string data easily.
print(strings.remove_special_characters("Hello@#%$ World!!"))
# Output: Hello World
print(strings.reverse_string("python"))
# Output: nohtyp
Basic mathematical operations and number handling made simple.
print(numbers.is_prime(13)) # Output: True
print(numbers.factorial(5)) # Output: 120
print(numbers.average([10, 20, 30])) # Output: 20.0
Tools for working with lists, like flattening and chunking.
print(lists.flatten([[1, 2], [3, 4]]))
# Output: [1, 2, 3, 4]
print(lists.unique([1, 1, 2, 3]))
# Output: [1, 2, 3]
These functions help with formatting, parsing, and computing dates and times.
dt = dates.parse_date("2025-07-06", "%Y-%m-%d")
print(dates.format_date(dt, "%d %b %Y"))
# Output: 06 Jul 2025
Functions to validate common inputs like email, phone, and passwords.
print(validation.is_valid_email("user@example.com"))
# Output: True
print(validation.is_strong_password("abc123"))
# Output: False
Read and write files and JSON with these easy-to-use utilities.
file_utils.write_file("sample.txt", "Hello World")
print(file_utils.read_file("sample.txt"))
# Output: Hello World
Log important messages or errors while developing your application.
logger.log_info("Script started")
logger.log_error("Something went wrong")
Combine utilities to perform powerful data operations with minimal code.
text = "hello@python!"
clean = strings.remove_special_characters(text)
reverse = strings.reverse_string(clean)
print(reverse)
# Output: nohtypolleH
All the documentation in this page is taken from Python Docs