项目作者: makeyourownmaker

项目描述 :
Memento mori: Remember death
高级语言: Python
项目地址: git://github.com/makeyourownmaker/mementomori.git
创建时间: 2019-05-21T21:24:11Z
项目社区:https://github.com/makeyourownmaker/mementomori

开源协议:GNU General Public License v2.0

下载


mementomori

Lifecycle
Dependencies

mementomori is a python script for reflecting on how many days, weeks, months and years you’ve been alive
and approximately how many more you will live.

If you like mementomori, give it a star, or fork it and contribute!

Example Output

Age details and life expectancy estimates for male born on 8th January 1992:

  1. ./mementomori -s m -b 1992-01-08
  2. You are 27.36 years old
  3. You are 328.67 months old
  4. You are 1,427.86 weeks old
  5. You are 9,995 days old
  6. You can expect to live approximately 51.74 years
  7. You can expect to live approximately 621.38 months
  8. You can expect to live approximately 2,699.47 weeks
  9. You can expect to live approximately 18,896 days
  10. You are approximately 34.6 % dead
  11. You are approximately 65.4 % alive

Age details and life expectancy estimates for female born on 8th January 1992:

  1. ./mementomori -s f -b 1992-01-08
  2. You are 27.36 years old
  3. You are 328.67 months old
  4. You are 1,427.86 weeks old
  5. You are 9,995 days old
  6. You can expect to live approximately 55.44 years
  7. You can expect to live approximately 665.82 months
  8. You can expect to live approximately 2,892.53 weeks
  9. You can expect to live approximately 20,248 days
  10. You are approximately 33.0 % dead
  11. You are approximately 67.0 % alive

Installation

Requires a recent version of python.

Both python versions 2 and 3 are supported.

The following should work on any unix-ish environment:

  1. wget https://raw.githubusercontent.com/makeyourownmaker/mementomori/master/mementomori
  2. chmod u+x mementomori
  3. ./mementomori -h

Details

The mementomori script displays your age in years, months, weeks and days.

It also estimates how much longer you will live based on the
National life tables, UK: 2013 to 2015
from the Office for National Statistics.
There are both male (79.1 years) and female (82.8 years) lifetime estimates.

The script should be run from a daily cron job without the verbose option.
In this case, it only displays ages and lifetime estimates on the following “milestones”:

  • every 500 days
  • every 100 weeks
  • every 50 months
  • every 10 years
  • every 10th percentile (10, 20, 30 … %) of lifetime estimate

Further info:

  1. ./mementomori -h

Command-line options

There are two types of arguments, required and optional.

Required arguments:

Name Short Long Description
Birth date -b —birthdate Date of birth - format YYYY-MM-DD

Required but mutually exclusive arguments:

Name Short Long Description
Sex -s —sex Sex; m or M for male and f or F for female
Lifetime -l —lifetime Expected lifetime in years

Either the -l/—lifetime or -s/—sex option is required but both cannot be
used together.

The -l/—lifetime option overrides the default male and female expected
lifetimes.

Optional arguments:

Name Short Long Description
Help -h —help Print help message and exit
Verbose -v —verbose Print additional information

Roadmap

  • Check and double-check the milestone calculations
  • Better support males and females who are older than the life expectancy estimates
  • Improve output:
    • Return “x years, y months, z weeks and a days” instead of “42.87 years”
  • New functionality:
    • Add option to print dates for next and/or all future milestone(s)
      • eg 15,000 days old on …

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

See Also

License

GPL-2