Metadata-Version: 2.4
Name: kalente
Version: 0.2.2
Summary: Simple Python script to generate a printable calendar
Project-URL: Homepage, https://kumig.it/kumitterer/kalente
Project-URL: Bug Tracker, https://kumig.it/kumitterer/kalente/issues
Author-email: Kumi Mitterer <kalente@kumi.email>
License: Copyright (c) 2023 Kumi Mitterer <kalente@kumi.email>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: holidays
Requires-Dist: jinja2
Requires-Dist: pdfkit
Requires-Dist: python-dateutil
Description-Content-Type: text/markdown

# Kalente

<img src="src/kalente/static/logo.png" alt="Kalente logo" width="200" height="200" align="right">

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](https://wkhtmltopdf.org/).

## Installation

First, set up a virtual environment for Kalente:

```bash
python -m venv venv
```

Then, activate the virtual environment:

```bash
source venv/bin/activate
```

You can install Kalente using pip:

```bash
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:

```bash
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:

```bash
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:

```bash
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:

```python
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](LICENSE) file for
more information.
