Skip to main content

The French Republican calendar and decimal time in Python

Project description

Repcal

A script that converts date and time to the systems used by the French Republic, the calendar from 1793 to 1805 and decimal time for about a year between 1794 and 1795. More information can be found on Wikipedia.

It uses the Romme method of calculating leap years, as in keeping the ones used by the French Republic and using the Gregorian rules for the years after the calendar was abolished.

Installation

$ pip install repcal

Usage

The current local time is used by default.

$ repcal
5:80:63, quartidi 24 brumaire an CCXXIX

Or, for the full Republican experience, it can default to Paris Mean Time (6.49 decimal minutes ahead of GMT).

$ repcal --paris-mean
5:45:47, quartidi 24 brumaire an CCXXIX

It also accepts date, time and format as arguments.

$ repcal '1969-07-20 20:17:40'
8:45:60, primidi 1 thermidor an CLXXVII

$ repcal '1969-07-20'
primidi 1 thermidor an CLXXVII

$ repcal '20:17:40'
8:45:60

$ repcal '1969-07-20' --format '{%d} {%B}'
1 thermidor

As a Python package

from repcal import RepublicanDate, DecimalTime
from datetime import datetime

n = datetime.now()
rd = RepublicanDate.from_gregorian(n.date())
dt = DecimalTime.from_standard_time(n.time())

print(rd) # quartidi 24 brumaire an CCXXIX
print(dt) # 5:79:47

RepublicanDate API

Value Instance method Format placeholder Example
Year (arabic) get_year_arabic() %y 219
Year (roman) get_year_roman() %Y CCXXIX
Month get_month() %B vendémiaire
Week (décade) get_week_number() %W 3
Day in month get_day() %d 28
Day in week get_weekday() %A octidi
Is complementary is_sansculottides() -- false

DecimalTime API

Value Property Format placeholder Example
Hour hour %H 8
Minute minute %M 1
Second second %S 65

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for repcal, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size repcal-1.2.1-py3-none-any.whl (8.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size repcal-1.2.1.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page