Implementation of decimal time and French Republican calendar.
Project description
metric-time
===========
Implementation of decimal time and French Republican calendar.
During the French Revolution, attempts were made decimalise various measuring methods including time and calendars. Two things arose from this movement: The french Republican calendar and Decimal calendar.
## Usage
.. code-block:: bash
$ metric-time
Or as a Python API
.. code-block:: python
>>> import metric_time
>>> metric_time.DecimalTime.now()
(8, 2, 88, 543) # Time in format (hours, minutes, seconds, milliseconds)
>>> metric_time.DecimalTime.decimal_time(datetime.datetime(year=2018, month=6, day=28, hour=13, minute=50, second=30))
(5, 76, 73, 611) # Time in format (hours, minutes, seconds, milliseconds)
>>> metric_time.RepublicanCalendar().now()
(226.91780821917808, 'Messidor', 10, 'Décadi') # Date in format (year, month, date, day)
>>> metric_time.RepublicanCalendar().republican_date(datetime.datetime(year=2020, month=5, day=20, tzinfo=pytz.reference.LocalTimezone()))
(228.81095890410958, 'Prairial', 2, 'Duodi') # Date in format (year, month, date, day)
===========
Implementation of decimal time and French Republican calendar.
During the French Revolution, attempts were made decimalise various measuring methods including time and calendars. Two things arose from this movement: The french Republican calendar and Decimal calendar.
## Usage
.. code-block:: bash
$ metric-time
Or as a Python API
.. code-block:: python
>>> import metric_time
>>> metric_time.DecimalTime.now()
(8, 2, 88, 543) # Time in format (hours, minutes, seconds, milliseconds)
>>> metric_time.DecimalTime.decimal_time(datetime.datetime(year=2018, month=6, day=28, hour=13, minute=50, second=30))
(5, 76, 73, 611) # Time in format (hours, minutes, seconds, milliseconds)
>>> metric_time.RepublicanCalendar().now()
(226.91780821917808, 'Messidor', 10, 'Décadi') # Date in format (year, month, date, day)
>>> metric_time.RepublicanCalendar().republican_date(datetime.datetime(year=2020, month=5, day=20, tzinfo=pytz.reference.LocalTimezone()))
(228.81095890410958, 'Prairial', 2, 'Duodi') # Date in format (year, month, date, day)
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
metric-time-1.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for metric_time-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d54f8de60e2abbc9d66e0e21c4950097caf270aaadfb803f2ee117a73da70d9 |
|
MD5 | cc9274e98b1811413014e2008d071728 |
|
BLAKE2b-256 | e8b78df1c5b68808580a82b8782672e0bfc5d0d8da0da10d99234c06735ccb4b |