A package of utilities used for personal projects.
Project description
Benny Bean Utils Package
Description
This package targets to offer basic utilities for my personal projects.
Installation
To build the package :
py -m pip install --upgrade build
py -m build
To upload the package to PyPI:
py -m pip install --upgrade twine
py -m twine upload dist/*
To install the package:
py -m pip install benny_bean_utils
Utilities
Date Utilities
DateFormatter
A class for formatting and parsing dates according to a specified format.
from datetime import datetime
from benny_bean_utils.date.date_formatter import DateFormatter
# Initialize with default format (%d/%m/%Y) or custom format
formatter = DateFormatter()
# or
formatter = DateFormatter("%Y-%m-%d")
# Format a date
date = datetime.now()
formatted_date = formatter.format_date(date) # "12/06/2025" with default format
# Parse a date string
date_obj = formatter.parse_date("12/06/2025") # Returns a datetime object
DateObtainer
A utility class for obtaining various date-related information.
from benny_bean_utils.date.date_obtainer import DateObtainer
# Get today's date
today = DateObtainer.today_date() # Returns datetime object
# Get yesterday's date
yesterday = DateObtainer.yesterday_date() # Returns datetime object
# Get current week day (0=Monday, 6=Sunday)
weekday = DateObtainer.current_week_day() # Returns int (0-6)
# Get current week number
week_num = DateObtainer.week_number() # Returns int
# Get days remaining before next week
days_to_next_week = DateObtainer.remaining_days_before_next_week() # Returns int
DateTester
A class to test date-related functionalities.
from datetime import datetime
from benny_bean_utils.date.date_tester import DateTester
# Check if a date is within X days from today
date = datetime.now()
is_within_days = DateTester.is_date_in_less_than_x_days(date, 5) # Returns boolean
# Check if a date is today
is_today = DateTester.is_today(date) # Returns boolean
String Utilities
StringFormatter
Utility class for string formatting operations.
from benny_bean_utils.string.string_formatter import StringFormatter
# Convert text to snake_case
snake_case = StringFormatter.get_snake_case_of_text("Hello World") # Returns "hello_world"
text_with_accents = StringFormatter.get_snake_case_of_text("Café au lait") # Returns "cafe_au_lait"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file benny_bean_utils-1.0.0.tar.gz.
File metadata
- Download URL: benny_bean_utils-1.0.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2610af7c365d51e972105a292b611d83a9703cc3d718c4e441af0720728b8c7
|
|
| MD5 |
fa0927a2f458265a95484155f7953fec
|
|
| BLAKE2b-256 |
a4f64cbe9dde1cfc03c2827f8b0bb6c5384d8bafe21c9220d01473f33cb15c4b
|
File details
Details for the file benny_bean_utils-1.0.0-py3-none-any.whl.
File metadata
- Download URL: benny_bean_utils-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77d1e951c32cce6e47341e3e91dcb187d9da548fede528e802d725e19eae068e
|
|
| MD5 |
9f40cf38aa3be093a101dfa5a323203f
|
|
| BLAKE2b-256 |
5ea8b8f290e9f2645498339f4c6642f7b26c9e3a850e5d5e0ad5737adccce4b0
|