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 timedeltaVerified import paths — ran on the pinned version, not inferred.
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`.
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.
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.
Thoroughly test any code that attempts to use `timedelta.Timedelta` interchangeably with `datetime.timedelta`. For reliable and complete functionality, prioritize `datetime.timedelta`.
No dependency data recorded yet.