Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mc-cat-tty/tombolacardpdf
Tombola card pdf generator from html format template
https://github.com/mc-cat-tty/tombolacardpdf
bingo bingo-cards bingo-game bingo-generator boardgame cards-set christmas epiphany game games html jinja2 jinja2-templates new-year pdf pdf-formatter python3 template tombola tombola-cards
Last synced: 11 days ago
JSON representation
Tombola card pdf generator from html format template
- Host: GitHub
- URL: https://github.com/mc-cat-tty/tombolacardpdf
- Owner: mc-cat-tty
- Created: 2021-01-01T14:59:04.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-27T11:00:53.000Z (over 2 years ago)
- Last Synced: 2024-10-28T00:21:29.679Z (about 2 months ago)
- Topics: bingo, bingo-cards, bingo-game, bingo-generator, boardgame, cards-set, christmas, epiphany, game, games, html, jinja2, jinja2-templates, new-year, pdf, pdf-formatter, python3, template, tombola, tombola-cards
- Language: HTML
- Homepage:
- Size: 1.73 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# TombolaCardPDF
Tombola card pdf generator from html format template## Results
![Result](Result.png)
![Card](CardResult.png)## Setting up
```
pip3 install jinja2
pip3 install pdfkit
pip3 install PyPDF2
sudo apt install wkhtmltopdf
```or
```
pip3 install -r requirements.txt
```## Run the script
```
cat cards_set.txt > python3 pdf_formatter.py
```OR
Pipe generator output directly into pdf_formatter
```
python3 generator.py | python3 pdf_formatter.py -b "place your bottom text here"
```### _generator.py_ arguments
-n Number of card sets. Default value is 1### _pdf_formatter.py_ Arguments
-b Bottom text-l Logo filename
-t Template (HTML) filename
-o Output PDF filename
### Genrate multiple card sets
![Results](Results.png)This command will generate 5 card sets:
```
python3 generator.py -n 5 | python3 pdf_formatter.py -b "place your bottom text here" -l logo.jpeg
```All the sets will be merged into a single pdf file
### Bottom text on multiple lines
```
python3 pdf_formatter.py -b "First line
second line
third line"
```
Divide multiple lines with "<br>" HTML tag## _cards_set.txt_ sample
Input must be formatted in the following way: [cards_set.txt sample](cards_set.txt)Formatting rules:
- there must be two lines for each card:
- the first one is the name of that card inside the set
- the second one is a Python list containing one list of integers for each row (of that card)
- everything after the last pair of lines will be discarded (odd line)
- blank fileds placeholder is -1