durationpy

Module for converting between datetime.timedelta and Go's time.Duration strings.

Latest version: 0.10 registry icon
Maintenance score
7
Safety score
100
Popularity score
6
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.10 0 0 0 0 0
0.9 0 0 0 0 0
0.8 0 0 0 0 0
0.7 0 0 0 0 0
0.6 0 0 0 0 0
0.5 0 0 0 0 0
0.4 0 0 0 0 0
0.3 0 0 0 0 0
0.2 0 0 0 0 0
0.1 0 0 0 0 0

Stability
Latest release:

0.10 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant



durationpy

Module for converting between datetime.timedelta and Go's Duration strings.

Install

$ pip install durationpy

Parse

  • ns - nanoseconds
  • us - microseconds
  • ms - millisecond
  • s - second
  • m - minute
  • h - hour
  • d - day
  • w - week
  • mm - month
  • y - year
# parse
td = durationpy.from_str("4h3m2s1ms")

# format
durationpy.to_str(td)

Note: nanosecond precision is lost because datetime.timedelta uses microsecond resolution.