Skip to main content

datetime_extractor

The main intent of this project is to extract mostly all possible timestamps from a given string where date and time written together. It extracts timestaamps in a string format. Later one can convert extracted timestamp to python timestamp using pandas datetime package.

How to install the package

	pip install datetime-extractor

Example1

  from datetime_extractor import DateTimeExtractor

  import pandas as pd
  import re

  samplestring = 'scala> val xorder= new order(1,"2016-02-22 00:00:00.00",100,"COMPLETED")'

  DateTimeExtractor(samplestring)

  Out: ['2016-02-22 00:00:00.00']

Example2

Suppose if one has a dataframe with text column where timestamps written, the above function can be used to create a new column with extracted timestamp strings. One can use below command in this case

  data = pd.read_csv('sampledata.csv')
  data['textcolumn'] = data['textcolumn'].fillna('')

  data['ExtractedTimestamp'] = data['textcolumn'].apply(lambda x: DateTimeExtractor(str(x)))

Release files for datetime-extractor 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datetime-extractor 0.5
File Size Uploaded
datetime_extractor-0.5.tar.gz 2.4 kB Details

Release files / datetime_extractor-0.5.tar.gz

Download URL datetime_extractor-0.5.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9706118af2c423dc3a23875651fe910a12fedb3fb1f31e44d6177be3e33a6234
BLAKE2b-256 checksum
How to use checksums
b9666b28056bdb706794db2c1546659d0417d18248b0efaf9b2c10e59efb678e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.5 This release

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release 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