Simple Python script to generate a printable calendar
Project description
Kalente
Kalente is a simple Python script for generating PDF calendars.
It can be used to generate weekly and monthly calendars at the moment, and it will be extended to support yearly calendars as well.
Currently, Kalente can only generate calendars in English, but support for other languages will be added in the future. Also, calendars are currently generated in A4 landscape format, but support for other formats will be added in the future. If you can help with any of these, please feel free to open a pull request.
Requirements
Kalente should work with any Python version from 3.8 onwards.
It also requires wkhtmltopdf to be installed on your system. You can find instructions on how to install it on your system on the project's website.
Installation
First, set up a virtual environment for Kalente:
python -m venv venv
Then, activate the virtual environment:
source venv/bin/activate
You can install Kalente using pip:
pip install kalente
Usage
Kalente can be used as a command line tool to generate calendars. You can generate weekly calendars using the following command:
kalente --type weekly --date 2021-01-01 --output weekly.pdf
This will generate a weekly calendar for the week of January 1st, 2021. The
calendar will be saved to the file weekly.pdf
.
You can also generate monthly calendars using the following command:
kalente --type monthly --date 2021-08-01 --output monthly.pdf
This will generate a monthly calendar for August 2021 and save it to the file
monthly.pdf
.
You can also use the --help
option to get more information about the
available options:
kalente --help
For example, you may want to look into the --end-date
and --count
options
to generate calendars for multiple weeks or months.
Programmatic Usage
Kalente can also be used programmatically. Here's an example of how you can generate a weekly calendar using Kalente:
from kalente import Calendar
from datetime import date
# Create a Calendar object, optionally specifying the country to use
# for holidays, and a date format.
calendar = Calendar(country_code="AT", date_format="%d %B %Y")
# Get week data for the week of January 1st, 2021.
data = calendar.get_week(date(2021, 1, 1))
# Generate HTML for the week.
html = Calendar.generate_html(data, type="weekly")
# Generate a PDF file for the week.
Calendar.convert_html_to_pdf(html, "weekly.pdf")
License
Kalente is licensed under the MIT license. See the LICENSE file for more information.
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
Built Distribution
File details
Details for the file kalente-0.2.1.tar.gz
.
File metadata
- Download URL: kalente-0.2.1.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c041ddffdd4287d826d6d44cbcdb94d404da418e23b7966a3f8415802bd1c047 |
|
MD5 | cb70e0d7fea70ab2d6f77f9346cebf95 |
|
BLAKE2b-256 | c5d97a450a592bebf627426cd596f19aca7903a4e84b603c3dcb86f8dd13130b |
File details
Details for the file kalente-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: kalente-0.2.1-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 344eda58fb494710253fee7685943c4e9321cb36905e5489350b5723751b2a97 |
|
MD5 | c35a2beff78aa45a2ffba5b22667192e |
|
BLAKE2b-256 | f13ea44b4a8635676e70478cf05ebf3ac03b11f4fd85204a35e0a98084ac3574 |