Skip to content

Convert dates from/to the French Republican calendar

License

Notifications You must be signed in to change notification settings

bfontaine/Romme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Romme

Romme is a Python 3 library to convert dates between the French Republican and the Gregorian calendars. It’s named after Gilbert Romme, who developed the former.

The French Republican calendar was briefly used in France between 1792 and 1806. The population didn’t widely use it, but official documents did; we can see it used in some open datasets. Dealing with two different calendars is a pain, so this library allows you to translate from one to another.

Build Status

Features

  • Convert from French Republican to Gregorian calendar
  • Convert from Gregorian to French Republican calendar
  • Parse dates from strings (e.g. "3 Prairial, an VIII")

Install

pip install romme

Usage

from romme import RepublicanDate

rd = RepublicanDate(5, 1, 1)  # first day of the year V

rd.to_date()  # gives you a datetime.date object for the 1796/09/22

rd2 = RepublicanDate.from_gregorian(1796, 9, 22)
print(rd == rd2)  # True

# You can also parse from a string
RepublicanDate.from_string("1 Vendémiaire, an I")

About

Convert dates from/to the French Republican calendar

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages