Skip to main content

Build Status

Requirements Status

Hex.pm

date-extractor

date-extractor helps you extract dates from text

Installation

pip3 install date-extractor

Use

from date_extractor import extract_dates

text = "I arrived in that city on January 4, 1937"
dates = extract_dates(text)
# [datetime.datetime(1937, 1, 4, 0, 0, tzinfo=<UTC>)]

Date extractor also works on dates with hours, minutes and seconds:

from date_extractor import extract_date

date = extract_date("2018-06-07 16:31:54")
# datetime.datetime(2018, 6, 7, 16, 31, 54, tzinfo=<UTC>)

Returning Precision

from date_extractor import extract_date

text = "I arrived in that city in 1937"
date, precision = extract_date(text, return_precision=True)
# precision = 'year'

Features

Languages Supported
Arabic
Chinese (incl. Taiwan)
English
French
Sorani (Kurdish)
Turkish

Testing

To test the package run

python3 -m unittest date_extractor.tests.test

Support

Contact Daniel Dufour at daniel.j.dufour@gmail.com

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

date-extractor-5.1.5.tar.gz (16.7 kB view details)

Uploaded Source

File details

Details for the file date-extractor-5.1.5.tar.gz.

File metadata

  • Download URL: date-extractor-5.1.5.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for date-extractor-5.1.5.tar.gz
Algorithm Hash digest
SHA256 d6e0744c913fe72e5bd7494902dc0939d39aba5019327efa6c88532952d974a7
MD5 5ad0fcd1fb8af019ab9f71bf9eebd110
BLAKE2b-256 d84c1075398fdb6033186d3c673f49b50fee41637b87d219de62e804bc2e5b4c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

5.1.5 This release

1 file

5.1.2

1 file

5.1.1

1 file

5.1.0

1 file

5.0.0

1 file

4.1.1

1 file

4.1.0

1 file

4.0.6

1 file

4.0.5

1 file

4.0.4

1 file

4.0.3

1 file

4.0.1

1 file

4.0.0

1 file

3.9.1

2 files

3.9.0

1 file

3.8

1 file

3.6

1 file

3.3

1 file

3.2

1 file

3.1

1 file

3.0

1 file

2.9

1 file

2.8

1 file

2.7

1 file

2.6

1 file

2.5

1 file

2.3

1 file

2.2

1 file

2.0

1 file

1.9

1 file

1.8

1 file

1.7

1 file

1.6

1 file

1.5

1 file

1.4

1 file

1.3

1 file

1.2

1 file

1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page