A powerful age calculator library
Project description
🧙♂️ Agewizard
Agewizard is a world-class, magic-like Python library designed to handle all your age and date of birth (DOB) calculations with zero effort. Whether you need an exact age, zodiac signs, or next birthday countdowns, Agewizard does it all in a single line.
✨ Features
- 🚀 Instant Age: Calculate age in years, months, weeks, or days.
- �️ Strict Validation: Automatically catches invalid months (e.g., month 22) or invalid days (e.g., Feb 30).
- 📅 Customizable Formats: Supports ANY date format (e.g.,
DD-MM-YYYY,MM.DD.YYYY,YYYY/MM/DD). - 🔞 Age Verification: One-line checks for account eligibility (e.g.,
is_adult()). - ♈ Zodiac Magic: Get star signs instantly from a DOB.
- 🎂 Birthday Insights: Countdown to the next birthday and find out what day of the week it falls on.
- 👶 Age Classification: Infant, Child, Teen, Adult, Senior.
- 🌗 Multi-Cultural: Basic Hijri lunar age approximation.
🛠 Installation
pip install agewizard
📖 Detailed Usage
1. Strict Validation & Error Handling
Agewizard ensures you never process "fake" dates.
from agewizard import Age
try:
# This will raise a helpful ValueError
user = Age("2021-02-30")
except ValueError as e:
print(f"Invalid date: {e}")
2. Custom Date Formats (Global Support)
Different countries use different formats. Agewizard handles them all.
from agewizard import Age
# UK/Europe Format
uk_user = Age("31-12-1990", date_format="DD-MM-YYYY")
# US Format
us_user = Age("12.31.1990", date_format="MM.DD.YYYY")
# Default (Auto-detects YYYY-MM-DD or DD-MM-YYYY)
auto_user = Age("2000-01-01")
3. One-Line Age Verification
Perfect for apps that require a minimum age (like 18+).
from agewizard import Age
user_dob = input("Enter your DOB: ")
person = Age(user_dob)
if person.is_adult():
print("✅ Access Granted: 18+")
else:
print(f"❌ Access Denied: You are only {person.years}")
# Custom age checks
if person.is_over(21):
print("🥃 You can enter the bar.")
4. Interactive User Input Example
from agewizard import Age
dob_input = input("Birth Date (DD-MM-YYYY): ")
try:
p = Age(dob_input, date_format="DD-MM-YYYY")
print(f"Wizard Result: {p.readable}")
print(f"Zodiac: {p.zodiac}")
except ValueError as e:
print(f"Please check your input: {e}")
👨💻 Author
Kamran Hussain
- Email: contact.kamrankami@gmail.com
- GitHub: KamranProjects
📜 License
Agewizard is open-source software licensed under the MIT License.
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
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 agewizard-0.2.0.tar.gz.
File metadata
- Download URL: agewizard-0.2.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2e885b7aaec0dd8724a950f4d5382174cc12385b4b23a8535c0637f15d3aad1
|
|
| MD5 |
9dff7e5b536c5d884ed3f70ae92275ad
|
|
| BLAKE2b-256 |
1a60791da7d6077f37044d82c537ccc63b53f13316b1a8d86e45bd58e222eac4
|
File details
Details for the file agewizard-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agewizard-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56f8e76935bddec62d2a0f44d04a20c2b916bc31d0f6da87a99b1c29aa3b4cc5
|
|
| MD5 |
7c8e7fbd0e7c97b08ce1040f05717f93
|
|
| BLAKE2b-256 |
cf9f28355c46a8ddf78f15bce9fea66ae20b8449e711e7a2f77ac122d2a02896
|