Skip to main content

Calculates birth information based on a specified Date of Birth.

Project description

Synopsis

Calculates birth information based on a specified Date of Birth.

Installation

pip install agecalc

What’s Inside

Classes

AgeCalc

This stores the DOB data into a class. You can then use the methods below to get data from this.

Functions

age

Displays a DOB’s age in years.

age_days

Displays a DOB’s age in days.

age_hours

Displays a DOB’s age in hours.

age_months

Displays a DOB’s age in months.

age_weeks

Displays a DOB’s age in weeks.

age_weeks_days

Displays a DOB’s age in weeks/days. Will return a dictionary with the ‘weeks’ and ‘days’ keys, and their values.

age_years_months

Displays a DOB�s age in years/months. Will return a dictionary with the ‘years’ and ‘months’ keys, and their values.

dating_ages

Displays the socially acceptable dating ages for a person. Will return a dictionary with the “max”, “min” and “original” keys, with their values.

day_of_birth

Displays the DAY of birth of a DOB.

last_birthday

Displays the days since a DOB’s last birthday

next_birthday

Displays the days until a DOB’s next birthday

Example (age function)

With AgeCalc class

import agecalc
dob = agecalc.AgeCalc(1, 1, 2000)
print dob.age

With Functions

import agecalc
print agecalc.age(1, 1, 2000)

Notes

All functions/classes take only these three arguments:

dd: Day

mm: Month

yy: Year

Dates should be passed as if they were integers. If the Date/Month contains a ‘0’ before the integer, the ‘0’ should be ommitted.

E.G. DOB ‘01/01/2000’ should be passed as:

dd: 1

mm: 1

yy: 2000

Submitting an Issue

If you wish to submit an issue with this module, or suggest any changes, you can either use the GitHub Issue Tracker, or email me at alir6716@gmail.com

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

agecalc-3.5.2.zip (4.5 kB view details)

Uploaded Source

File details

Details for the file agecalc-3.5.2.zip.

File metadata

  • Download URL: agecalc-3.5.2.zip
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for agecalc-3.5.2.zip
Algorithm Hash digest
SHA256 3a719fd444d0c9de05bff84be1ec16c270bf2f3b25871535851f3691eae54fd0
MD5 ee6ae9d1b81f2057258c7e02d65ff1d9
BLAKE2b-256 5d373ca78c3d3d9182605638873d9aee086c2b232f72de1ed81eb8b678151d41

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page