Skip to main content

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.

PyPI Version License: MIT


✨ Features

  • 🚀 Instant Age: Calculate age in years, months, weeks, or days.
  • 📅 Flexible Parsing: Automatically handles formats like YYYY-MM-DD, YYYY.MM.DD, YYYY/MM/DD, or even spaces.
  • ♈ Zodiac Magic: Get star signs (Aries, Leo, etc.) instantly from a DOB.
  • 🎂 Birthday Insights: Countdown to the next birthday and find out what day of the week it falls on.
  • 👶 Age Classification: Automatically classify life stages (Infant, Child, Teen, Adult, Senior).
  • 🌗 Multi-Cultural: Includes basic Hijri lunar age approximation.
  • 🤝 Comparisons: Compare two different birth dates to see who is older and by exactly how many days.

🛠 Installation

pip install agewizard

📖 Detailed Usage

1. Interactive User Input (The Easiest Way)

Agewizard is built for real-world apps where users provide input.

from agewizard import Age

# Get input from user
user_dob = input("Enter your Date of Birth (YYYY-MM-DD): ")

try:
    person = Age(user_dob)
    print(f"Wizard says you are {person.years} years old!")
    print(f"Your star sign is {person.zodiac}.")
    print(f"Days until your next cake: {person.next_birthday_days}")
except Exception as e:
    print(f"Error: {e}")

2. The Comprehensive Age Object

One object, all the data.

from agewizard import Age

p = Age("1995-05-15")

print(p.years)           # 30
print(p.months)          # 368
print(p.days)            # 11210
print(p.readable)        # "30 years, 7 months, 24 days"
print(p.category)        # "Adult"
print(p.is_today)        # True if it's their birthday!

3. Comparing Two People

Perfect for social apps or family statistics.

from agewizard import compare_ages

result = compare_ages("1990-01-01", "1995-05-15")
print(result) # "Person 1 is older by approx 5 years (1960 days)."

4. Specialized Logic

from agewizard import is_leap_year, next_birthday_weekday

print(is_leap_year("2000-01-01")) # True
print(next_birthday_weekday("2000-01-01")) # "Thursday"

💎 Why Agewizard?

Most libraries require complex datetime arithmetic. Agewizard wraps all that complexity into a Fluent API that reads like a story. It's built for developers who value their time and want clean, production-ready code.


👨‍💻 Author

Kamran Hussain


📜 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

agewizard-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

agewizard-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file agewizard-0.1.0.tar.gz.

File metadata

  • Download URL: agewizard-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for agewizard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a026d96eff0a167a511bf30fc9d90286f780b13205190a46e8cb738c4a8e01b
MD5 5e9519296229eda930d6e313b7b45fa4
BLAKE2b-256 0daf063bcf28532597301e59cd2b0f90dcf99452117f5ac4f1e233553f74c444

See more details on using hashes here.

File details

Details for the file agewizard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agewizard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for agewizard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79acf852cddbdfe142ae068a42cebe77138434c773b64407316cdf901aa4192b
MD5 ab1d249a99c882c1abcdb0d488426714
BLAKE2b-256 c5565870781ef557d20ad46d692e12ad276461ab71079abac271e91cabaf7d83

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