Skip to main content

Year calendar creation in Python

Project description

Latest Version

pyearcal

Generate your year calendar in Python. The result is a PDF file with 12 pages containing an image and a grid of days.

Installation

We recommend using uv tool to use and/or install pyearcal as a tool.

uv tool install pyearcal

or you can use it without installation (via uvx)

Usage

  1. Prepare a directory with 12 images (different image providers are planned)
  2. Initialize calendar with all options.
    • Language (locales for English, Czech, Slovak, Italian)
    • Special days (national holidays are included + add your own)
    • Fonts, colours
  3. Render it to PDF

Usage of the script

Usage: uvx pyearcal [OPTIONS] [OUTPUT]

Options:
  -s, --source PATH
  -l, --locale [en|cs|it|sk]
  -y, --year INTEGER
  -f, --font TEXT
  -d, --special-days TEXT

Example code

# Import important modules
from pyearcal import YearCalendar
from pyearcal.image_sources import UnsortedImageDirectory
from datetime import date
from pyearcal.l10n import CzechLocale

year = date.today().year + 1

# Use all pictures from "images" directory
image_source = UnsortedImageDirectory("images")

# Use Czech locale and holidays
locale = CzechLocale()

# Set a few special days
special_days = [
    date(year, 1, 31) # Guido van Rossum's birthday
]

calendar = YearCalendar(year, image_source, locale, special_days)
calendar.render("calendar.pdf")

You can take FlickrDownloader as an inspiration for developing a more sophisticated image source.

Example with real pictures

India Faces Calendar 2014 (80 MB)

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

pyearcal-2025.12.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyearcal-2025.12.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file pyearcal-2025.12.0.tar.gz.

File metadata

  • Download URL: pyearcal-2025.12.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for pyearcal-2025.12.0.tar.gz
Algorithm Hash digest
SHA256 d2922b355c2da24e6957e95d81900403ab7d1323a473e39042b5b17f12659db7
MD5 3fc96b4b39c597949873408b7c7a34cc
BLAKE2b-256 fce6c41dd9e36a51cee0e58ad340643ab070d2b270aabb8750f0a7a90e18dbc7

See more details on using hashes here.

File details

Details for the file pyearcal-2025.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyearcal-2025.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1532aed0ff99c385ca56dce331f32c1fcbc342cf126acf9a64879e6e941f28e9
MD5 91703c83a835bc943dbf5cb76b6d19ed
BLAKE2b-256 57045fc858a542594b7dbec1373296a9fecf106e6febda84f2059ec316a189c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page