Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add 2024 badges #12

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
!imgs/2023/fossgis2023_background.pdf
!namensschilder/bin/
*.log
*.fls
*.fdb_latexmk
*.aux
*.pyc
*.out
*.synctex.gz
*.synctex.gz.properties
imgs/signature.png
pretix.csv
namensschilder/workshopliste.tex
*.synctex(busy)
25 changes: 25 additions & 0 deletions namensschilder/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
20 changes: 20 additions & 0 deletions namensschilder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ubuntu:24.10
LABEL Name=fossgis-namensschilder Version=0.0.2
RUN apt update
RUN apt install -y pandoc
RUN apt install -y texlive
RUN apt install -y texlive-fonts-extra
RUN apt install -y texlive-bibtex-extra
RUN apt install -y texlive-latex-base
RUN apt install -y texlive-latex-extra
RUN apt install -y texlive-font-utils
RUN apt install -y texlive-lang-german
RUN apt install -y curl locales && \
apt clean && \
rm -rf /var/lib/apt/lists/*

RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=de_DE.UTF-8
ENV LANGUAGE=de_DE.UTF-8 LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8
WORKDIR /home/ubuntu
19 changes: 19 additions & 0 deletions namensschilder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,26 @@ Dies LaTeX scripte lesen die CSV um ein PDF für die Aussen- und Innenseite zu e


5.## (optional) PDFs mixen
### CLI tool

[qpdf](https://packages.debian.org/bookworm/qpdf) ist hier sehr hilfreich weil automatisierbar ...

```
apt update && apt install qpdf
```

Zum verbinden der beiden Ausgangsdatein deren Pfad/Name angeben und bestätigen - herauskommt eine out.pdf die Vorder- und Innenseite beinhaltet. Beim druck auf duplex achten 😇

```
qpdf --empty --collate=1 --pages namensschilder2024_sichtbar.pdf namensschilder2024_inn
en.pdf -- out.pdf
```

### GUI tools
#### pdf24 🐑
https://help.pdf24.org/de/fragen/frage/pdf-per-reissverschlussverfahren-zusammenfuehren-sortieren/

#### PDF SAM 📎
Nun kann man noch beiden PDFs zu einem machen, indem jede 2. Seite, d.h. die Rückseite eines A4 Blattes, die Innenseite
eines Badges darstellt.

Expand Down
69 changes: 69 additions & 0 deletions namensschilder/api_get.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import requests
import json

# URL-endpoints
BASEURL = "https://pretix.eu/api/v1/organizers/fossgis/events/"
EVENT_ID = "demo-2020"
# https://docs.pretix.eu/en/latest/api/resources/orders.html#get--api-v1-organizers-(organizer)-events-(event)-orders-
ORDER_URL = BASEURL + EVENT_ID + "/orders/"
# https://docs.pretix.eu/en/latest/api/resources/invoices.html#get--api-v1-organizers-(organizer)-events-(event)-invoices-
INVOICE_URL = BASEURL + EVENT_ID + "/invoices/"
# ?????????????????
NREI_URL = BASEURL + EVENT_ID + "/orders?identifier=dekodi_nrei"
# https://docs.pretix.eu/en/latest/api/resources/items.html#get--api-v1-organizers-(organizer)-events-(event)-items-
ITEMS_URL = BASEURL + EVENT_ID + "/items/"

# Auth*
headers = {
"Authorization": "Token INSERTTOKENHERE"
}


def getOrders():
# Get orders
orders = requests.get(ORDER_URL, headers=headers)
order_data = orders.json().get("results", [])

# Save orders to a file
with open("./data/orders.json", "w") as orders_file:
json.dump(order_data, orders_file, indent=4)


def getInvoices():
# Get invoices
invoices = requests.get(INVOICE_URL, headers=headers)
invoice_data = invoices.json().get("results", [])

# Save invoices to a file
with open("./data/invoices.json", "w") as invoices_file:
json.dump(invoice_data, invoices_file, indent=4)


def getNREI():
# Get nrei
nrei = requests.get(NREI_URL, headers=headers)
nrei_data = nrei.json().get("results", [])

# Save nrei to a file
with open("./data/nrei.json", "w") as nrei_file:
json.dump(nrei_data, nrei_file, indent=4)


def getItems():
# Get items/products
items = requests.get(ITEMS_URL, headers=headers)
items_data = items.json().get("results", [])

# Save items to a file
with open("./data/items.json", "w") as items_file:
json.dump(items_data, items_file, indent=4)


# Call the functions to execute the code
getOrders()
getInvoices()
getNREI()
getItems()
Loading