python-utils-18 is a collection of handy utility functions and classes designed to streamline Python development. Perfect for both newcomers and seasoned developers, this toolkit simplifies common programming tasks, enhancing productivity and code readability.
- File Manipulation: Quickly read, write, and parse files with robust error handling and logging.
- Data Validation: Easily validate and sanitize input data types and structures, including dictionaries and lists.
- Date and Time Handling: Simplify working with dates and times, including timezone conversions and formatting.
- Performance Monitoring: Built-in decorators for measuring the execution time of functions, helping you optimize your code.
To install python-utils-18, you can clone the repository or install it directly from PyPI. Here are the commands:
git clone https://github.com/Developer/python-utils-18.git
cd python-utils-18
pip install .Alternatively, you can use pip:
pip install python-utils-18Here is a quick example of how to utilize some of the features in python-utils-18:
from utils.file_manager import read_file
from utils.data_validator import validate_json
from utils.date_helper import format_date
from utils.performance import measure_time
# Read and validate a JSON file
file_path = 'data.json'
data = read_file(file_path)
if validate_json(data):
print("Valid JSON data.")
else:
print("Invalid JSON format.")
# Format and display the current date
current_date = format_date(date.today())
print(f"Today's date is: {current_date}")
# Measure execution time of a sample function
@measure_time
def sample_function():
# some time-consuming operations
passFor support and contributions, please feel free to open issues or pull requests in the repository. Happy coding!