Skip to main content

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.

French Republic calendar

The French Republic calendar calendar consists of 12 months, each with exactly 30 days. Each week (décade) had 10 days. Years are counted in relation to the year 1792. The year usually begins on the 22nd of September. The calendar was introduced in 1793 and abolished in 1805

Decimal time

A decimal clock consists of 10 hours, each containing 100 minutes with 100 seconds. This means that the definition of the second has to be changed to 1 decimal second = 0.864 normal seconds. It was introduced in 1794 and suspended in 1795.

Installation

Pip

$ pip install metric-time

Git clone

$ git clone https://github.com/lakhanmankani/metric-time.git

Usage

$ metric-time
$ python3 metric_time.py

or as a Python API

>>> import metric_time
>>> import datetime
>>> import pytz.reference
>>> decimal_time = metric_time.DecimalTime()
>>> decimal_time.now()
"08:02:88.543" # Time in format hours:minutes:seconds.milliseconds
>>> republican_calendar = metric_time.RepublicanCalendar()
>>> republican_calendar.now()
"Décadi 10 Messidor 226" # Date in format day date month year

Convert from normal date time to metric

>>> decimal_time.decimal_time(datetime.datetime(year=2018, month=6, day=28, hour=13, minute=50, second=30))
"05:76:73.611" # Time in format hours:minutes:seconds.milliseconds
>>> republican_calendar.republican_date(datetime.datetime(year=2020, month=5, day=20, tzinfo=pytz.reference.LocalTimezone()))
"Duodi 2 Prairial 228" # Date in format day date month year

Access time components

>>> now_time = decimal_time.now()
>>> now_time.hours
8
>>> now_time.minutes
2
>>> now_time.seconds
88
>>> now_time.milliseconds
543

Access date components

>>> now_date = republican_calendar.now()
>>> now_date.year
226.91780821917808
>>> now_date.month
"Prairial"
>>> now_date.day
10
>>> now_date.day_of_the_week
"Décadi"

Metadata

Release files for metric-time 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metric-time 1.0.8
File Size Uploaded Provenance Actions
metric-time-1.0.8.tar.gz 5.0 kB Without provenance Details for metric-time-1.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for metric-time 1.0.8
File Interpreter ABI Platform Actions
metric_time-1.0.8-py3-none-any.whl Python 3 none any Details for metric_time-1.0.8-py3-none-any.whl

Total release size: 10.2 kB

Release files / metric-time-1.0.8.tar.gz

Download URL metric-time-1.0.8.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ad7c76032afc663336217781baf251bf685ac7a46b628a7e27814ac4a0fe3c1b
BLAKE2b-256 checksum
How to use checksums
735164cad9eda0ab779c4957076d717c252fa598a25af05ccf280f0e08001074
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.4

Release files / metric_time-1.0.8-py3-none-any.whl

Download URL metric_time-1.0.8-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53a75b9e8f5776b93f0437093dbf84b51eb4b3f81ac4ac455428fe4f0292398f
BLAKE2b-256 checksum
How to use checksums
78a773ec865ef269e3e24179942d19d38471afcc2f281d923f409d796fc1f01a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.4

Security for metric-time 1.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page