Registry / serialization / timedelta

timedelta

JSON →
library2020.12.3pypypi✓ verified 85d ago

The `timedelta` library, last updated in 2020, provides a custom `Timedelta` class intended as a replacement for Python's standard `datetime.timedelta`. It aims to offer similar functionality for representing durations and performing time arithmetic, but its development appears to be inactive. The current version is 2020.12.3.

pip install timedelta
INSTALL
IMPORT
SIG · TIMEDELTA
T
timedelta
serializationpythonv2020.12.3
Install
2.4s avg
Import
6ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2020.12.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.002s · 19.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.4s · import 0.001s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Timedelta
from timedelta import Timedelta
import timedelta
Total
from timedelta import Total
datetime
from timedelta import datetime

This quickstart demonstrates how to import and instantiate the `Timedelta` class from the `timedelta` library, including an example of creating one from a difference calculated using the standard `datetime.timedelta`.

import timedelta from datetime import datetime, timedelta as stdlib_timedelta # Using the third-party timedelta library's Timedelta class td_library_obj = timedelta.Timedelta(days=2, hours=2) print(f"Library Timedelta: {td_library_obj}") # Example of initializing from a standard library timedelta difference now = datetime.now() then = now - stdlib_timedelta(days=1, minutes=30) diff_from_stdlib = now - then td_from_diff = timedelta.Timedelta(diff_from_stdlib) print(f"Library Timedelta from stdlib diff: {td_from_diff}") print(f"Days: {td_from_diff.days}, Hours: {td_from_diff.hours}")
Debug
Known issues
breakingThe `timedelta` library has not been updated since December 2020. It is effectively unmaintained and likely incompatible with newer Python versions or may contain unpatched security vulnerabilities.
fix
It is strongly recommended to use Python's built-in `datetime.timedelta` for time difference operations, or other actively maintained third-party libraries like `python-dateutil` for advanced features. Avoid this library for new projects.
affects: <=2020.12.3
gotchaThis library installs a module named `timedelta`, which directly clashes with and shadows Python's standard `datetime` module when using `import timedelta`. This can lead to significant confusion and unexpected behavior, as users often expect `datetime.timedelta` functionality.
fix
Always use `from datetime import timedelta` for the standard library's timedelta. If you must use this specific third-party library, consider importing it with an alias, e.g., `import timedelta as custom_timedelta`, to prevent naming conflicts.
affects: All versions
gotchaDespite being described as a 'replacement,' the `Timedelta` class from this library may not fully replicate all methods, attributes, or arithmetic behaviors of `datetime.timedelta`. Expecting full interchangeability can lead to subtle bugs.
fix
Thoroughly test any code that attempts to use `timedelta.Timedelta` interchangeably with `datetime.timedelta`. For reliable and complete functionality, prioritize `datetime.timedelta`.
affects: All versions
Upgrade
Version history
2020.12.3latest on PyPI
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources