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.1.tar.gz (5.3 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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agewizard-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 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.1.tar.gz
Algorithm Hash digest
SHA256 60cfaaa32e419b8967d06f71e609b8df2e12d0c8b1f7ae08ed4143581c56b4af
MD5 b62b27b5e88724db50b2598e29d605c7
BLAKE2b-256 ee3b73626c6375a3aeda94874709fc10afd8d26d7e0a2ba2916cf067c4cb3aa7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agewizard-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 34fef5a8ec2c0d40fe7e27c07528c5ab54903c061707d58f3140f9e4367a9c4a
MD5 2ae60cb99af77c6f89f98f06a2ffbad2
BLAKE2b-256 7ace20a030d01754f646c8391dba5a2975a36308cc3b8c0496838aa6a0533f78

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