Skip to main content

From string input to french date

Project description

frdate

Date conversion (from numbers to letters or from letters to date object), in french.

Installation :

pip install frdate

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 frdate 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

frdate-1.0.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

frdate-1.0.0-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page