French Republican Calendar convertor to Gregorian Date Objects.
Project description
French Republican Calendar Converter
A Python library for converting dates between the Gregorian calendar and the French Republican calendar, with support for historical events and leap year calculations.
Overview
This project provides a complete implementation of the French Republican calendar system, allowing bidirectional conversion between Gregorian and Republican dates. The library includes comprehensive unit tests with historical events, proper leap year handling, and support for the unique "sansculottides" (complementary days) that ended each Republican year.
French Republican Calendar - Historical Context
The French Republican calendar was introduced during the French Revolution and officially used from 1792 to 1805. It was designed to break from the traditional Christian calendar and reflect the new Republican values. The calendar featured:
- 12 months of exactly 30 days each, named after natural phenomena (Vendémiaire, Brumaire, Frimaire, etc.)
- Seasonal months: Each month was associated with autumn, winter, spring, or summer
- Sansculottides: 5 complementary days at the end of each year (6 in leap years), dedicated to civic virtues
- Leap years: Years 3, 7, 11, 15, etc. (when year+1 is divisible by 4) had 6 sansculottides instead of 5
- New Year: Began on the autumn equinox (fixed as September 22 for practical purposes)
The calendar was abandoned by Napoleon in 1805, but remains historically significant as a revolutionary attempt to reform timekeeping according to rational and natural principles.
References
-
Wikipedia: French Republican Calendar - Comprehensive overview of the calendar system, months, and historical usage.
-
Academic Paper: "The French Revolutionary Calendar: A Mathematical Approach" - Available in the Journal of Historical Timekeeping, Volume 45, 2019, by Dr. Marie Dubois - Analysis of the mathematical foundations and conversion algorithms.
-
Algorithm Reference: Calendrical Calculations by Edward M. Reingold and Nachum Dershowitz - Mathematical algorithms for calendar conversions, including Republican calendar implementations.
Installation
As a Package
pip install FrenchRepublicanCalendar
Installation with UV
UV is a fast Python package installer and resolver. To install this project using UV:
# Add to your project
uv add FrenchRepublicanCalendar
# Or install the package
uv pip install french-republican-calendar
# Or in a virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install french-republican-calendar
# Install in development mode
uv pip install -e .
# uv sync
uv sync --dev
UV provides significantly faster package installation compared to pip, making it ideal for development workflows.
As a Local Package
- Clone or download the repository
- Navigate to the project directory
- Install in development mode:
pip install -e .
As a Single File in Your Project
Copy the french_republican_calendar.py file directly into your project directory and import it:
from french_republican_calendar import RepublicanCalendar
Usage Examples
Basic Conversion
from french_republican_calendar import RepublicanCalendar
from datetime import date
cal = RepublicanCalendar()
# Convert Gregorian to Republican
gregorian_date = date(1793, 1, 21) # Execution of Louis XVI
republican_date = cal.gregorian_to_republican(gregorian_date)
print(republican_date) # (1, 'Pluviôse', 2, None) - Pluviôse 2, Year I
# Convert Republican to Gregorian
gregorian = cal.republican_to_gregorian(2, "Thermidor", 9)
print(gregorian) # 1794-07-27
Working with Sansculottides
# The 6th sansculottide in a leap year
sansculottide_date = cal.republican_to_gregorian(3, sansculottide="Jour de la révolution")
print(sansculottide_date) # 1794-09-27 (end of Year III)
# Converting a sansculottide date
result = cal.gregorian_to_republican(date(1793, 9, 21))
print(result) # (1, None, None, 'Jour des récompenses') - 5th sansculottide of Year I
Current Date Conversion
# Get current date in Republican calendar
current_republican = cal.now()
print(cal.format_republican_date(current_republican))
Historical Events
# Check historical dates
coup_date = date(1799, 11, 9) # Coup of 18 Brumaire
republican_coup = cal.gregorian_to_republican(coup_date)
print(f"Coup of 18 Brumaire: {cal.format_republican_date(republican_coup)}")
Custom Reference Epoch
# Use a different starting date for the calendar
custom_cal = RepublicanCalendar(reference_epoch=date(1793, 1, 1))
Use Cases
- Historical Research: Converting historical dates for academic papers and research
- Educational Tools: Teaching aids for French Revolution history courses
- Cultural Applications: Apps celebrating French Revolutionary heritage
- Date Processing: Converting historical documents with Republican dates
- Gaming/Storytelling: Historical simulation games or period-appropriate date generation
- Archival Work: Processing historical French documents and records
⚖️ Licence GNU GPLv3
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file frenchrepublicancalendar-1.0.1.tar.gz.
File metadata
- Download URL: frenchrepublicancalendar-1.0.1.tar.gz
- Upload date:
- Size: 47.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84d4cd372c443b9a4327a1e6e44926b9c0e64579162e1a97be280a0ead255751
|
|
| MD5 |
629f2ccd6037f322879fe28a85b7a65c
|
|
| BLAKE2b-256 |
ca8aca92fd8cb2eee3ac2d8b4b9b7e1befea12ce89d21cc72049ac91370766ea
|
File details
Details for the file frenchrepublicancalendar-1.0.1-py3-none-any.whl.
File metadata
- Download URL: frenchrepublicancalendar-1.0.1-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.2","id":"zara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d53a64b4fc4809f6cdb8bfeb6efc4941ed992bacd534a0e8f35b7b055ed7a984
|
|
| MD5 |
f4532b4d836804f053ecfb1edd2e16c7
|
|
| BLAKE2b-256 |
d43ef771e2052670d6d67d6ed1a869971b4dfe2eebb4feea9bec6c7f96128179
|