Giter Site home page Giter Site logo

pyearcal's Introduction

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.

Requirements

  • pillow or PIL
  • reportlab
  • DejaVu fonts (if you want pyearcal work out of the box)
  • BeautifulSoup (optional)
  • Python 3.8+

Installation

pipx install pyearcal

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: 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)

pyearcal's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jstony cemakpolat

pyearcal's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.