dedupe-variable-datetime
raw JSON → 2.0.0 verified Fri May 01 auth: no python
DateTime variable type extension for the dedupe library, used for fuzzy matching datetime fields. Current version 2.0.0. Updated irregularly; last release 2023.
pip install dedupe-variable-datetime Common errors
error ModuleNotFoundError: No module named 'dedupe.variables.datetime' ↓
cause Attempting to import from wrong path or package not installed with matching version.
fix
Install dedupe-variable-datetime: pip install dedupe-variable-datetime, then import using from dedupe.variables.datetime import DateTimeType.
error TypeError: __init__() got an unexpected keyword argument 'field' ↓
cause Using incorrect constructor signature; DateTimeType may not accept field as a direct argument.
fix
Define fields in the Datamodel dictionary with 'type': 'DateTime', not by instantiating DateTimeType directly.
Warnings
gotcha DateTimeType expects date strings in ISO 8601 format (YYYY-MM-DD) or similar parseable formats; inconsistent formats may cause errors. ↓
fix Preprocess datetime fields to a consistent format before passing to dedupe.
deprecated The package may rely on old-style dedupe API; check compatibility with dedupe >=2.0. ↓
fix Use dedupe v2.x and ensure dedupe-variable-datetime is updated to 2.0.0.
gotcha Time zones are not handled; naive datetimes assumed. Potential mismatch when comparing across time zones. ↓
fix Convert all datetimes to UTC or naive before comparison.
Imports
- DateTimeType
from dedupe.variables.datetime import DateTimeType
Quickstart
from dedupe import Datamodel
from dedupe.variables.datetime import DateTimeType
# Define fields including a datetime field
fields = [
{'field': 'date', 'type': 'DateTime'},
{'field': 'name', 'type': 'String'}
]
datamodel = Datamodel(fields)
print('Datetime variable loaded successfully')