GithubHelp home page GithubHelp logo

quemazote / mementomori Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makeyourownmaker/mementomori

0.0 0.0 0.0 33 KB

Memento mori: Remember death

License: GNU General Public License v2.0

Python 100.00%

mementomori's Introduction

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:

./mementomori -s m -b 1992-01-08

You are 27.36 years old
You are 328.67 months old
You are 1,427.86 weeks old
You are 9,995 days old

You can expect to live approximately 51.74 years
You can expect to live approximately 621.38 months
You can expect to live approximately 2,699.47 weeks
You can expect to live approximately 18,896 days

You are approximately 34.6 % dead
You are approximately 65.4 % alive

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

./mementomori -s f -b 1992-01-08

You are 27.36 years old
You are 328.67 months old
You are 1,427.86 weeks old
You are 9,995 days old

You can expect to live approximately 55.44 years
You can expect to live approximately 665.82 months
You can expect to live approximately 2,892.53 weeks
You can expect to live approximately 20,248 days

You are approximately 33.0 % dead
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:

wget https://raw.githubusercontent.com/makeyourownmaker/mementomori/master/mementomori
chmod u+x mementomori
./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:

./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

mementomori's People

Contributors

makeyourownmaker avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.