Skip to main content

Kalente

Kalente logo

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.

Release files for kalente 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kalente 0.2.2
File Size Uploaded
kalente-0.2.2.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for kalente 0.2.2
File Interpreter ABI Platform
kalente-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.4 MB

Release files / kalente-0.2.2.tar.gz

Download URL kalente-0.2.2.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
5fa6d31c60aae17885851c6545004e8c3f43f512009002799fb75ab486be98eb
BLAKE2b-256 checksum
How to use checksums
2db0290244511c57342db2f8022bff02a75749d61e796e7196929746870c4c00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / kalente-0.2.2-py3-none-any.whl

Download URL kalente-0.2.2-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
256a94a646aa8500d0067c83aa48ab6a723a419a5af18f4ba1a1d177b8b1ddbe
BLAKE2b-256 checksum
How to use checksums
3d5cc74ce0c75a49cfbd7ab502b659312be6faee5c94cf9f54309afd143f7e39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page