Skip to content

Python package that converts a date written as plain text to a datetime object.

License

Notifications You must be signed in to change notification settings

Eric-Mendes/textime

Repository files navigation

Convert plain text to datetime

PyPI version PyPI - Downloads License Code style: black

Currently only supporting English.

Python library that converts a date written as plain text to a datetime object.

How to use it 💻

First you install it in you environment like this

pip install textime

Then you can start using it already! Pass any string to the text parameter containing a date in the format: "DAY of MONTH of YEAR" where YEAR must be written out completely, like "first of May of two thousand and twenty one" or "second of August of one thousand nine hundred and ninety nine".

from datetime import datetime

from textime import textime


text_to_dt: datetime = textime.to_datetime(text="Fifteenth of July of two thousand and eight")

Contribution 📝

This project is open source. Contributions are welcome and appreciated. Please check our guide for contributing and our code of conduct as well.