A parser library built for parsing the english language into datetime objects.
Project description
datetimeparser
A python parser library made for parsing english language into datetime objects
made with ❤️ by aridevelopment.de
Report an issue
·
Request a new feature
About The Project
Datetimeparser is a python library capable of parsing the english language into datetime objects.
It was created due to the lack of such library and need for it. We knew that there was dateutil but we wanted a more powerful parsing library.
Datetimeparser can even parse complex grammar and sentence structure.
Latest Change
Examples
Below you can find some examples of how datetimeparser can be used.
from datetimeparser import parse
print(parse("next 3 years and 2 months"))
# 2025-04-06 11:43:28
print(parse("begin of advent of code 2022"))
# 2022-12-01 06:00:00
print(parse("in 1 Year 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds"))
# 2023-05-01 17:59:52
print(parse("10 days and 2 hours after 3 months before christmas 2020"))
# 2020-10-05 02:00:00
Installation
Use pip to install the library:
$ pip install python-datetimeparser
Contributing
If you want to contribute to datetimeparser, please use feature branches. If possible, name them after an already opened issue (e.g. feature/131).
We highly appreciate everyone who wants to help our project!
List of Constants
All Normal-Constants
christmas
- xmas
silvester
- new years eve
eastern
- easter
nicholas
- nicholas day
halloween
april fools day
- april fool day
thanksgiving
saint patrick's day
- saint patricks day
- st. patrick's day
- saint pt. day
- st patrick's day
- st patricks day
valentines day
- valentine
- valentine day
summer end
- end of summer
- end of the summer
winter end
- end of winter
- end of the winter
spring end
- end of spring
- end of the spring
fall end
- end of fall
- end of the fall
- autumn end
- end of autumn
- end of the autumn
summer begin
- summer
- begin of summer
- begin of the summer
winter begin
- winter
- begin of winter
- begin of the winter
spring begin
- spring
- begin of spring
- begin of the spring
fall begin
- fall
- begin of fall
- begin of the fall
- autumn begin
- autumn
- begin of autumn
- begin of the autumn
morning
- at morning
evening
- at evening
lunchtime
- lunch
aoc begin
- aoc
- begin of aoc
- begin of the aoc
- advent of code begin
- advent of code
- begin of advent of code
- begin of the advent of code
aoc end
- end of aoc
- end of the aoc
- advent of code end
- end of advent of code
- end of the advent of code
end of year
- the end of year
- the end of the year
- end of the year
begin of year
- the begin of year
- the begin of the year
- begin of the year
infinity
- inf
today
tomorrow
yesterday
now
- at the moment
- current time
- current time now
All Day-Constants
morning
afternoon
evening
night
morning night
daylight change
- daylight saving
- daylight saving time
midnight
midday
dawn
dusk
sunrise
sunset
lunch
- lunchtime
dinner
- dinnertime
breakfast
All Weekday-Constants
monday
tuesday
wednesday
thursday
friday
saturday
sunday
All Month-Constants
january
- jan
february
- feb
march
- mar
april
- apr
may
june
- jun
july
- jul
august
- aug
september
- sep
october
- oct
november
- nov
december
- dec
All Datetime-Constants
seconds
- second
- sec
- secs
minutes
- minute
- min
- mins
hours
- hour
days
- day
weeks
- week
months
- month
years
- year
All Number-Constants
thirty one
- thirtyone
- thirty-one
thirty
twenty nine
- twentynine
- twenty-nine
twenty eight
- twentyeight
- twenty-eight
twenty seven
- twentyseven
- twenty-seven
twenty six
- twentysix
- twenty-six
twenty five
- twentyfive
- twenty-five
twenty four
- twentyfour
- twenty-four
twenty three
- twentythree
- twenty-three
twenty two
- twentytwo
- twenty-two
twenty one
- twentyone
- twenty-one
twenty
nineteen
eighteen
seventeen
sixteen
fifteen
fourteen
thirteen
twelve
eleven
ten
nine
eight
seven
six
five
four
three
two
one
All NumberCount-Constants
thirty first
- 31st
- 31.
- thirthyfirst
- thirty-first
thirtieth
- 30th
- 30.
twenty ninth
- 29th
- 29.
- twentyninth
- twenty-ninth
twenty eighth
- 28th
- 28.
- twentyeighth
- twenty-eighth
twenty seventh
- 27th
- 27.
- twentyseventh
- twenty-seventh
twenty sixth
- 26th
- 26.
- twentysixth
- twenty-sixth
twenty fifth
- 25th
- 25.
- twentyfifth
- twenty-fifth
twenty fourth
- 24th
- 24.
- twentyfourth
- twenty-fourth
twenty third
- 23rd
- 23.
- twentythird
- twenty-third
twenty second
- 22nd
- 22.
- twentysecond
- twenty-second
twenty first
- 21st
- 21.
- twentyfirst
- twenty-first
twentieth
- 20th
- 20.
nineteenth
- 19th
- 19.
eighteenth
- 18th
- 18.
seventeenth
- 17th
- 17.
sixteenth
- 16th
- 16.
fifteenth
- 15th
- 15.
fourteenth
- 14th
- 14.
thirteenth
- 13th
- 13.
twelfth
- 12th
- 12.
eleventh
- 11th
- 11.
tenth
- 10th
- 10.
ninth
- 9th
- 9.
eighth
- 8th
- 8.
seventh
- 7th
- 7.
sixth
- 6th
- 6.
fifth
- 5th
- 5.
fourth
- 4th
- 4.
third
- 3rd
- 3.
second
- 2nd
- 2.
first
- 1st
- 1.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-datetimeparser-0.4rc0.tar.gz
.
File metadata
- Download URL: python-datetimeparser-0.4rc0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be1cb297f09dc279c3b50a2ab962de0806bfb0eeddd2ca328101d46153ddebc9 |
|
MD5 | 44f6246d54120c35dcd52414d3bb4d51 |
|
BLAKE2b-256 | 42b6cb8defb6725aaf1a29377b5fc5bd5f3d9d29a0d671e2fdcedd7ef93aff6a |
File details
Details for the file python_datetimeparser-0.4rc0-py3-none-any.whl
.
File metadata
- Download URL: python_datetimeparser-0.4rc0-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d44565820a59d32f94754ed6748f48335ffbee96e4f124ffe3dfad4b5d50c0b |
|
MD5 | 40d721ff49bd8dfc4af95897e6825f0a |
|
BLAKE2b-256 | c176d623122167d7211c1b6d6c0901bff495366fe2553656ba1122f5588d0b96 |