Skip to main content

A package to visualize your life as a grid of weeks.

Project description

Life Graph

License Tests codecov PyPI version

Installation

pip install lifegraph

Life Graph Inspiration

Inspired by this post, I decided I wanted to make my own graph of my life. In the comments on that post, there are many other graphs available, but most of them add lots of different things that I did not care for. They looked extremely nice, but not nearly as simple as the box of squares originally showed in the post. The simplicity of seeing my life on a tiny grid really hit me. I wanted to recreate that.

The folks at waitbutwhy.com own the idea behind this work. They gave me permission to produce and realease this code for free use by everyone else.

A Life Graph Example

A Life Graph

The code:

from lifegraph.lifegraph import Lifegraph, Papersize, random_color, Point, Side
from datetime import date, datetime

birthday = date(1995, 11, 20)
g = Lifegraph(birthday, dpi=300, size=Papersize.Letter, label_space_epsilon=1)

g.add_life_event('Won an award', date(2013, 11, 20), '#014421')
g.add_life_event('Hiked the Rocky Mountains', date(2014, 2, 14), '#DC143C', hint=(25, -3))
g.add_life_event('Ran first marathon', date(2017, 9, 11), '#990000')
g.add_life_event('Built a canoe', date(2018, 12, 8), '#87CEFA')
g.add_life_event('Started working at\nEcosia', date(2019, 1, 7), '#00008B')

now = datetime.utcnow()
g.add_life_event('Today', date(now.year, now.month, now.day), (0.75, 0, 0.75))

g.add_era("Elementary School", date(2001, 8, 24), date(2007, 6, 5), 'r')
g.add_era("Intermediate School", date(2007, 8, 24), date(2008, 6, 5), '#00838f')
g.add_era("Middle School", date(2008, 8, 24), date(2010, 6, 5), 'b')
g.add_era("High School", date(2010, 8, 24), date(2014, 6, 5), '#00838f')
g.add_era("College", date(2014, 9, 1), date(2018, 12, 14), (80/255, 0, 0), side=Side.LEFT)

g.add_era_span("Longest vacation ever", date(2016, 8, 22), date(2016, 12, 16), '#D2691E', hint=Point(53, 28))

g.add_title("The life of Someone")

g.show_max_age_label()

g.save("images/alife.png")

For tutorials, API reference, and more examples, see the full documentation.

Contributing and Code of Conduct

Read our contributing guidelines

Read our code of conduct

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

lifegraph-0.3.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lifegraph-0.3.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file lifegraph-0.3.0.tar.gz.

File metadata

  • Download URL: lifegraph-0.3.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lifegraph-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0fe1ba7fb1ec00750472f03ba91359cd536056c3380f16b9b3215009c054a854
MD5 7625273cd66d407d2b13cae552d222b9
BLAKE2b-256 02db4423a4645bf83bf0baa28ba4500d88534edcd3893217547185c6717a8e9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifegraph-0.3.0.tar.gz:

Publisher: publish.yml on K20shores/lifegraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lifegraph-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: lifegraph-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lifegraph-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2e6ae038780b902851417bb80193bdcf8edbfd267020dfc38846cc2dc8883ae
MD5 98a6851879901019a398299ada678ae5
BLAKE2b-256 914a8b568ffc9eadc45a23265bd5795ab537cf7e9ae9465e14591983102f60e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for lifegraph-0.3.0-py3-none-any.whl:

Publisher: publish.yml on K20shores/lifegraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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