Library converting string date expressions to seconds [int].
Project description
Better Time
Better Time - is a Python library, converting string date expressions to seconds [int].
Installition
PyPI:
$ [py -m] pip install bettertime
GitHub:
$ git clone https://github.com/DarkJoij/bettertime
Examples
Converting from string expressions to seconds:
from bettertime import to_seconds
print(to_seconds('5hours 30minutes'))
19800
Converting from seconds to string expressions:
from bettertime import to_string
print(to_string(793800, language='en'))
9d 4h 30m
- Function
to_secondstake parameterexpression: str. - Function
to_stringtake 2 parameters:seconds: int,language: 'ru' | 'en' = 'ru'.
To see all dates aliases check file bettertime/parser.py.
Sweet using and building your lovely dsbots)
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
bettertime-1.0.0.tar.gz
(4.2 kB
view details)
File details
Details for the file bettertime-1.0.0.tar.gz.
File metadata
- Download URL: bettertime-1.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89e96d34a809c424f6feff1a8d74791ab79e6c08a6dba8a1faa125d3b866b8ad
|
|
| MD5 |
8b7ea2e782d08050bc5edddc98141b0f
|
|
| BLAKE2b-256 |
097154a711604727aab4a0d0803561ec37472cad4a116e54f3520869f26731b6
|