Registry / ai-ml / date-spacy

date-spacy

JSON →
library0.0.1pypypiunverified

A spaCy extension for enhanced date and number entity recognition and extraction as structured data. Current version 0.0.1, early release.

pip install date-spacy
INSTALL
IMPORT
SIG · DATE-SPACY
D
date-spacy
ai-mlpythonv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

DateMatcher
from date_spacy import DateMatcher
from date_spacy.date_matcher import DateMatcher
older docs or examples may show wrong import

Basic usage: load a spaCy model, add date_matcher pipe, process text and access ._.date attribute.

import spacy from date_spacy import DateMatcher nlp = spacy.load('en_core_web_sm') nlp.add_pipe('date_matcher', config={'use_number_matcher': True}) doc = nlp("The event is on 2024-03-15 at 10am") for ent in doc.ents: if ent.label_ == 'DATE': print(ent.text, ent._.date) # Access structured date via extension
Debug
Known issues
gotchaThe date_matcher pipe requires a spaCy model to be loaded before adding; adding the pipe before loading may cause silent failure.
fix
Ensure nlp is loaded (e.g., nlp = spacy.load('en_core_web_sm')) before calling nlp.add_pipe('date_matcher').
affects: all
deprecatedThe old import path 'date_spacy.date_matcher.DateMatcher' is deprecated; use 'from date_spacy import DateMatcher'.
fix
Use the correct import: from date_spacy import DateMatcher
affects: 0.0.1
gotchaNumber recognition is optional and disabled by default. To enable, set config={'use_number_matcher': True} when adding pipe.
fix
Add the pipe with config: nlp.add_pipe('date_matcher', config={'use_number_matcher': True})
affects: 0.0.1
Upgrade
Version history
0.0.1latest on PyPI · released Aug 24, 2023
Audit
Dependencies
spacyrequiredCore dependency for pipeline integration
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
date-spacy — pip install date-spacy · libregistry