Giter Site home page Giter Site logo

papr's Introduction

papr - Generate Calendar Stationeries

Command line tool to generate a empty calendar templates to print.

ScreenShot

Info

Papr currently only produces a PDF output. When you are printing the PDF file make sure you have to automated positioning or resizing features of your printer enabled!

Quick start

Example:

> python3 ./papr/papr.py -y 2023 -m 2 -f='Avenir Next' -p A3 oneyear
usage: papr.py [-h] [-o OUT] [-A] [-a] [-b BRAND] [-c] [-f FONT [FONT ...]]
                   [-l LOCALE] [-m MONTH] [-y YEAR]
                   [-p {A5,A4,A3,A2,A1,A0,USLetter}] [--margin MARGIN] [-v] [-d]
                   LAYOUT

    Create a Calendar

    positional arguments:
      LAYOUT                choose calendar layout: ('classic', 'column',
                            'oneyear')

    optional arguments:
      -h, --help            show this help message and exit
      -o OUT, --out OUT     specify output file
      -A, --abbreviate_all  use abbreviations for weekdays and months
      -a, --abbreviate      use abbreviations for weekdays
      -b BRAND, --brand BRAND
                            assign a brand string
      -c, --color           color date numbers
      -f FONT [FONT ...], --fonts FONT [FONT ...]
                            choose which font to use
      -l LOCALE, --locale LOCALE
                            choose locale to use (default en_US.UTF8, check
                            'locale -a' for available locales)
      -m MONTH, --month MONTH
                            specify the starting month as a number (1-12), default
                            is the current month (3).
      -y YEAR, --year YEAR  specify the year the calendar should start, default is
                            the current year (2016).
      -p {A5,A4,A3,A2,A1,A0,USLetter}, --paper {A5,A4,A3,A2,A1,A0,USLetter}
                            choose which paper dimensions should be used ('A5',
                            'A4', 'A3', 'A2', 'A1', 'A0', 'USLetter') default is
                            A4
      --margin MARGIN       specify the margin of the calendar in millimeters.
                            Used to adapt to your printer, default ist 5mm
      -v, --verbose         print status messages to stdout
      -d, --debug           print status and debug messages to stdout

Installation

Mac OS

  1. Install git and python3 run this in your terminal:
xcode-select --install
  1. Install pygobject3 for python3 using homebrew
brew install pygobject3
  1. Clone repository using git
git clone https://github.com/peetzweg/papr.git
  1. Use papr CLI arguments to create your calendar, see Quick Star Section

Layouts

oneyear

ScreenShot

papr's People

Contributors

jpzk avatar kspi avatar pczek avatar peetzweg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kspi

papr's Issues

Add option to include holidays

How about adding support for holidays? Simply add the holiday name at the bottom of the box of a day. The holidays should be country specific, i think for the first implementation it is fine to use the locale which can be choosen with '-l'.

But where to get the holiday information from? Web or python package?

Add new big international paper sizes

The oneyear layout needs bigger paper sizes to make sense. Currently is only one big paper size supported, A3. It should support multiple big sizes of US paper sizes as well as bigger DIN paper sizes.

Support US Letter

Currently only ISO A4 paper is supported, it should support US Letter format aswell by an extra option.

default font's are not set correctly due to new two font option

Error due to new option to use 2 fonts

./papr.py -p A3 oneyear
Traceback (most recent call last):
File "./papr.py", line 136, in
sys.exit(main())
File "./papr.py", line 109, in main
environment.font = environment.fonts.pop() # last provided font is used generally
AttributeError: 'str' object has no attribute 'pop'

branding crashes the program

Using the -b option to put a branding string on the calendar crashes the program.

> ./papr.py -b=test                                                                                                                                        
Traceback (most recent call last):
  File "./papr.py", line 317, in <module>
    sys.exit(main())
  File "./papr.py", line 312, in main
    drawCalendar(enviroment)
  File "./papr.py", line 216, in drawCalendar
    drawText(cr, env, env.brand, env.height - env.page_width + env.safety, env.width / 2 + 3, 6)
  File "./papr.py", line 69, in drawText
    layoutDay.set_text(text.split()[1])

Implement two new designs

For the upcoming new year it would be cool have two additional calendar layouts.

  1. A whole year calendar column style, like the A0 print out ones from businesses
  2. A condensed version of the first. A foldable one but with columns instead of big rectangles.

Duplex mode

For duplex capable printers it would be cool to be able to print 4 month on one sheet, for that we need to create a two page pdf file with overall 4 month.

Use more than one font

It would be cool to be able to specify more fonts on the cli to write the Month title and the day in different fonts. May be even a third font for the numbers?

Make the print margin adjustable

The fixed print margin of 5mm may not be suited for all printers. Making it adjustable should help with printers with smaller print areas. The size of the days should properly adapt to the new print margin.

Add papr to homebrew

get rid of the easy install stuff and remove from pip, instead change to homebrew.

huge accents on print out

A user of the web interface noted that the accents of his polish calendar are fine in the pdf but as soon as he prints it they're becoming huge. I was able to recreate the issue. My first guess is that it might have something todo with the font, we are currently using 'Merriweather' for the server generated calendars.

Add option to specify the year

New Year is approaching and papr is not able to generate a calendar for the next year. If you are generating the calendar from december trough january it works fine, but if you want to start from january it uses the current year! I need to specify the specific year to be able to generate a calendar starting from January 2015 in 2014!

Introduce automated testing

Currently discovering I broke a couple of cli arguments during the change from optparse to argparse. I should implement some automated testing to discover those errors before checking in.

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.