Formats dates, numbers, etc. in a pretty, human readable format.
Project description
Sample code:
from datetime import datetime, timedelta now = datetime.now() hrago = now - timedelta(hours=1) yesterday = now - timedelta(days=1) tomorrow = now + timedelta(days=1) dayafter = now + timedelta(days=2) import pretty print pretty.date(now) # 'now' print pretty.date(hrago) # 'an hour ago' print pretty.date(hrago, short=True) # '1h ago' print pretty.date(hrago, asdays=True) # 'today' print pretty.date(yesterday, short=True) # 'yest' print pretty.date(tomorrow) # 'tomorrow'
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
py-pretty-1.zip
(1.7 kB
view details)
File details
Details for the file py-pretty-1.zip.
File metadata
- Download URL: py-pretty-1.zip
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07364e213272800864f506d454ac093ec85c645e0102a1124961c421627abd03
|
|
| MD5 |
bbbec2b4ef87c588bd50d1c8d734f5e0
|
|
| BLAKE2b-256 |
bedc4a66429e9b533bde6531903ed495fe90464b61d8c9688376cae9017e00ff
|