Registry / serialization / neotime

neotime

JSON →
library1.7.4pypypi✓ verified 85d ago

neotime provides nanosecond-precision temporal types for Python, offering classes like Duration, Date, Time, and DateTime, similar to the standard library's datetime module but with enhanced precision. The library is currently abandoned, as its core temporal type implementations have been rolled into the Neo4j Python driver (version 4.0 and later). The last release was 1.7.4 in December 2018.

pip install neotime
INSTALL
IMPORT
SIG · NEOTIME
N
neotime
serializationpythonv1.7.4
Install
2.8s avg
Import
157ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7.4 · 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.160s · 22.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.8s · import 0.153s · 23MB
20MB installed
● package 20MB
Code
Verified usage

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

Date
from neotime import Date
Time
from neotime import Time
DateTime
from neotime import DateTime
Duration
from neotime import Duration

This quickstart demonstrates how to create nanosecond-precision DateTime and Duration objects, perform basic arithmetic with them, and access their individual components.

from neotime import DateTime, Duration # Create a DateTime object now = DateTime.now() print(f"Current nanosecond-precision time: {now}") # Create a Duration object delta = Duration(days=1, seconds=3600, nanoseconds=500_000_000) print(f"A duration: {delta}") # Perform arithmetic future_time = now + delta print(f"Time in the future: {future_time}") # Access components print(f"Year: {now.year}, Nanosecond: {now.nanosecond}")
Debug
Known issues
breakingThe `neotime` library has been officially abandoned. Its temporal type implementations were integrated directly into the `neo4j-driver` project starting with version 4.0. Users of `neo4j-driver` should use `neo4j.time` types instead of `neotime`.
fix
For new projects or existing projects using `neo4j-driver` 4.0 or higher, remove `neotime` and use types from `neo4j.time` (e.g., `neo4j.time.DateTime`) instead.
affects: All versions (since neo4j-driver 4.0+ was released)
gotchaThis library is no longer maintained. There will be no further updates, bug fixes, or new feature development for the standalone `neotime` package.
fix
Avoid using `neotime` for new development. If you require nanosecond-precision temporal types outside of `neo4j-driver`, consider alternative maintained libraries or implementing custom solutions.
affects: All versions (since 1.7.4, released Dec 2018)
gotchaMixing `neotime` objects with `datetime` module objects or `neo4j.time` objects can lead to `TypeError` or unexpected behavior due to differing internal representations and precision.
fix
Ensure consistency in your codebase. If interacting with Neo4j driver 4.0+, convert `neotime` objects to `neo4j.time` objects or standard `datetime` objects before passing them to functions expecting other types.
affects: All versions
Errors
Common errors & fixes
TypeError: 'neotime.DateTime' object is not JSON serializable
neotime objects are custom types and do not have a default JSON serialization method, which is common when trying to send them via APIs or save them to JSON.
fix
Implement a custom JSON encoder or convert neotime objects to standard ISO-8601 strings (e.g., `str(my_datetime)`) or Python `datetime` objects before serialization.
AttributeError: module 'neotime' has no attribute 'xyz'
This error often occurs when users expect specific functionality (e.g., a constant or a utility function) that is either not part of the `neotime` API, or they are mistakenly trying to access a `neo4j.time` attribute from `neotime` (or vice-versa) after migrating.
fix
Refer to the `neotime` documentation (or the `neo4j.time` documentation if you are in a Neo4j 4.0+ context) for available attributes and methods. Ensure you are importing and using the correct module for the desired types.
Upgrade
Version history
1.7.4latest on PyPI · released Dec 4, 2018
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
neotime — pip install neotime · libregistry