Calculates birth information based on a specified Date of Birth.
pip install agecalc
This stores the DOB data into a class. You can then use the methods below to get data from this.
Displays a DOB's age in years.
Displays a DOB's age in days.
Displays a DOB's age in hours.
Displays a DOB's age in months.
Displays a DOB's age in weeks.
Displays a DOB's age in weeks/days. Will return a dictionary with the "weeks" and "days" keys, and their values.
Displays a DOB's age in years/months. Will return a dictionary with the "years" and "months" keys, and their values.
Displays the socially acceptable dating ages for a person. Will return a dictionary with the "max", "min" and "original" keys, with their values.
Displays the DAY of birth of a DOB.
Displays the days since a DOB's last 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
import agecalc print agecalc.age(1, 1, 2000)
All functions/classes take only these three arguments:
Dates should be passed as integers. If the Date/Month contains a "0" before the integer, the "0" should be omitted.
E.G. DOB "01/01/2000" (DD/MM/YYYY) should be passed as:
Submitting an Issue
Copyright (C) 2015, Ali Raja
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.