Morphex's blogologue (Life, technology, music, politics, business, mental health and more)

This is the blog of Morten W. Petersen, aka. morphex in various places. I blog about my life, and what I find interesting and/or important. This is a personal blog without any editor or a lot of oversight so treat it as such. :)

My email is morphex@gmail.com.

An OGG/Vorbis player, implemented in Javascript.

My Kiva bragging page
My shared (open source) code on GitHub

Morphex's Blogodex

News
Slashdot

Zope hosting by Nidelven IT

Morten Petersen on Linkedin

Morten Petersen on Facebook

Morten Petersen on SoundCloud

Morten Petersen on MixCloud

Blogologue on Twitter



Older entries



Atom - Subscribe - Categories

Facebook icon Share on Facebook Google+ icon Share on Google+ Twitter icon Share on Twitter LinkedIn icon Share on LinkedIn

A small script to find suitable, recurring dates

So, I recently was in a long process, to find an arrangement between me and the kids mom regarding the kids.

We made a court settlement, and the setup is that I see them every 8th week. Through my volunteer work, I have commitments during Christmas and Easter, and I also plan to partake in a mini triathlon in the middle of July each year. A useful goal, to keep me motivated for exercise. I also meet family around this triathlon, and it's good to keep connected, and get connected.

I've come quite a long way physically, I feel much lighter and nimbler today than I did a year ago, five years ago.

So, I created this small script:

https://github.com/morphex/misc/blob/master/togetherness.py

Using the Python 3 datetime module. I haven't used the formatting before, so I'm not sure if I did it right, but it looks right on the console anyway.

I thought about adding checks for whether dates were around Christmas or Easter, but it didn't look like the datetime module could automatically figure out what period Easter falls on each year.

And having run the script, I found a usable start date just checking Easter dates manually.

[Updated 03/02/2021 10:30] Mark Lawrence chimes in on email, mentioning the dateutil module:

https://dateutil.readthedocs.io/en/stable/

When I think about it, the Python library documentation could do with a section at the end of each module, which briefly summarizes known, trusted modules and packages and their contents.

It's not directly under PSF control, but it would be useful to have nonetheless.

[Permalink] [By morphex] [Python and web (Atom feed)] [01 Feb 19:36 Europe/Oslo]