ahawker / ulid

Universally Unique Lexicographically Sortable Identifier (ULID) in Python 3
Apache License 2.0
695 stars 42 forks source link

Add time providers to ulid.providers.time package #475

Closed ahawker closed 4 years ago

ahawker commented 4 years ago

This adds two provider implementations using the following:

If running on py37+, time.time_ns() will be used as it provides a more accurate clock resolution according to https://www.python.org/dev/peps/pep-0564/#annex-clocks-resolution-in-python.

Status: Ready

Python.org
PEP 564 -- Add new time functions with nanosecond resolution
The official home of the Python Programming Language
codecov[bot] commented 4 years ago

Codecov Report

Merging #475 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #475   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        17    +4     
  Lines          467       498   +31     
  Branches        79        80    +1     
=========================================
+ Hits           467       498   +31     
Impacted Files Coverage Δ
ulid/api/api.py 100.00% <ø> (ø)
ulid/providers/base.py 100.00% <ø> (ø)
ulid/providers/monotonic.py 100.00% <ø> (ø)
ulid/providers/default.py 100.00% <100.00%> (ø)
ulid/providers/time/__init__.py 100.00% <100.00%> (ø)
ulid/providers/time/base.py 100.00% <100.00%> (ø)
ulid/providers/time/default.py 100.00% <100.00%> (ø)
ulid/providers/time/nanosecond.py 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7ce680a...1e3876a. Read the comment docs.