Registry / serialization / beautiful-date

beautiful-date

JSON →
library2.3.0pypypi✓ verified 84d ago

A Python library providing a simple and beautiful way to create date and datetime objects using natural language-like expressions. Current version 2.3.0, requires Python >=3.5. Release cadence is low, with occasional updates. Maintained by kuzmoyev.

pip install beautiful-date
INSTALL
IMPORT
SIG · BEAUTIFUL-DATE
B
beautiful-date
serializationpythonv2.3.0
Install
1.6s avg
Import
22ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.024s · 18.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.020s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

beautiful_date
from beautiful_date import beautiful_date
import beautiful_date
importing the module directly gives access to the function; the correct usage is to import the function explicitly.
beautiful_time
from beautiful_date import beautiful_time
beautiful_datetime
from beautiful_date import beautiful_datetime
beautiful
from beautiful_date import beautiful_date as bd
Aliasing is common but not required.

Creates date objects using month names. bd.January(1, 2023) returns a datetime.date(2023,1,1).

from beautiful_date import beautiful_date as bd print(bd.January(1, 2023)) print(bd.today()) print(bd.now())
Debug
Known issues
gotchabeautiful_date returns datetime.date objects, not custom types. Do not expect additional methods beyond standard date methods.
fix
Use standard date methods or cast to datetime if needed.
affects: all
gotchaMonth names are English only. Locale or non-English month names will raise AttributeError.
fix
Always use English month names (January, February, etc.).
affects: all
deprecatedbeautiful_time and beautiful_datetime are deprecated in favor of using beautiful_date with datetime.time objects.
fix
Use beautiful_date for dates; for times, construct datetime.time manually.
affects: >=2.0.0
Errors
Common errors & fixes
AttributeError: module 'beautiful_date' has no attribute 'beautiful_date'
Importing the module incorrectly. The function is inside the module but imported as a symbol.
fix
Use: from beautiful_date import beautiful_date
AttributeError: module 'beautiful_date' has no attribute 'January'
Trying to use month names directly after importing the module without importing the function.
fix
Correct import: from beautiful_date import beautiful_date as bd; then use bd.January(...)
ValueError: day is out of range for month
Passing invalid day number for given month, e.g., February 30.
fix
Check the day number is valid for the month. For February, days 1-28 (or 29 in leap year).
Upgrade
Version history
2.3.0latest on PyPI · released Sep 15, 2023
Audit
Dependencies
python-dateutiloptionalUsed internally for date parsing
pytzoptionalFor timezone support
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
beautiful-date — pip install beautiful-date · libregistry