PyWeekends: Weekend Dates Formatter
PyWeekends is a Python package that provides a convenient way to generate weekend dates based on the Calendar.
It includes a class named Weekend to generate weekend dates and an OutputFormatter class to format
the generated dates into JSON.
Features
- Generate weekend dates for all months in a given year.
- Generate weekend dates for a specific month.
- Format the generated dates as JSON.
Installation
To install the package, use pip:
pip install PyWeekends
Usage
from PyWeekends import Weekend, WeekendStart
# Generate weekend dates for a specific month and format as JSON
w = Weekend(year=2024)
january_weekends = w.month_weekends("January")
json_data = january_weekends.as_json()
print(json_data)
# Output
# ["6", "7", "13", "14", "20", "21", "27", "28"]
# Generate weekend dates for all months and format as JSON
all_month_weekends = w.all_weekends()
json_data_all_months = all_month_weekends.as_json()
print(json_data_all_months)
#Output
# {"1": ["6", "7", "13", "14", "20", "21", "27", "28"], "2": ["3", "4", "10", "11", "17", "18", "24", "25"],
# "3": ["2", "3", "9", "10", "16", "17", "23", "24", "30", "31"], "4": ["6", "7", "13", "14", "20", "21", "27", "28"],
# "5": ["4", "5", "11", "12", "18", "19", "25", "26"], "6": ["1", "2", "8", "9", "15", "16", "22", "23", "29", "30"],
# "7": ["6", "7", "13", "14", "20", "21", "27", "28"], "8": ["3", "4", "10", "11", "17", "18", "24", "25", "31"],
# "9": ["1", "7", "8", "14", "15", "21", "22", "28", "29"], "10": ["5", "6", "12", "13", "19", "20", "26", "27"],
# "11": ["2", "3", "9", "10", "16", "17", "23", "24", "30"], "12": ["1", "7", "8", "14", "15", "21", "22", "28", "29"]}
Changelog
See Changelog
License
Metadata
Release files for PyWeekends 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyWeekends-0.0.2.tar.gz | 4.9 kB | Without provenance | Details for PyWeekends-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyWeekends-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for PyWeekends-0.0.2-py3-none-any.whl |
Total release size: 11.4 kB
Release files / PyWeekends-0.0.2.tar.gz
| Download URL | PyWeekends-0.0.2.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f60cb46d19804a72b965fb4b12a5f46d46a24b79ef17ef23576bb756343010aa
|
|
BLAKE2b-256 checksum How to use checksums |
7e6ff74224c3486a08ee2b4cd06c33ccfbfb610f004841f75ad2444ab8d9e1a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / PyWeekends-0.0.2-py3-none-any.whl
| Download URL | PyWeekends-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
551a71ba675e8ca481c03c97d3a19cfb1c4c33cc8641d7f0ba9944e18bb0d000
|
|
BLAKE2b-256 checksum How to use checksums |
6a326a0d1f904e5cb39b54537bb6cd7a32c791e50486db8a0a707023808f520a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Security for PyWeekends 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.