Converts french text to python date object
Project description
fr-date
Date conversion (from numbers to letters or from letters to date object), in french.
Installation :
pip install fr-date
Usage :
The main method of this package is conv()
It takes one mandatory argument (the input to convert) and two optional boolean args :
- to_date (default = False) : set to True if you need to convert the input into a
datetime.date()
object - litteral (default = False) : set to True if you need to convert the input into a string object only using letters
Supported formats :
The input can be :
- a datetime.date object
- a datetime.datetime object
- a string representing a date, in any format,
- a list of the above elements
Examples:
from fr_date import conv
conv('14071789')
#'14 juillet 1789'
conv('17890714',to_date=True)
#datetime.date(1789, 7, 14)
conv('1789-07-14',litteral=True)
#'quatorze juillet mille sept cent quatre-vingt-neuf'
conv(['01/01/2000','2000-01-01',date(2000,1,1)])
#['1er janvier 2000','1er janvier 2000','1er janvier 2000']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fr_date-2.0.7.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file fr_date-2.0.7.tar.gz
.
File metadata
- Download URL: fr_date-2.0.7.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd751858226e533c94b7fc146d02ad59c49363a95898ab65770256ee86f30a9 |
|
MD5 | 9fa23884ee3448d079e601a0e55bf010 |
|
BLAKE2b-256 | 4febfe62689dc0c1da5b0a5e2043e0b0e1fa273978424d893d0ac7d2531dfc2e |
File details
Details for the file fr_date-2.0.7-py3-none-any.whl
.
File metadata
- Download URL: fr_date-2.0.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2d4466c925e66fe0daedb278ff6f2ade0990147553f453342628e2913c7c8bc |
|
MD5 | 363a21fec9ddffd79aee42c7a0d6053e |
|
BLAKE2b-256 | d884cf55cf0accd5b4a475e0d4e9b672dab3a0f39aed914a27942c98e016aee0 |