{"id":13520719,"url":"https://github.com/maehw/nami-efz-check","last_synced_at":"2025-03-31T18:31:15.832Z","repository":{"id":65421002,"uuid":"591667642","full_name":"maehw/nami-efz-check","owner":"maehw","description":"Check of EfZ-Nachweis via DPSG NaMi 2.2 web interface ","archived":false,"fork":false,"pushed_at":"2023-08-12T16:36:28.000Z","size":494,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-02T04:33:05.651Z","etag":null,"topics":["dpsg","jugendarbeit","nami","scouting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maehw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-21T13:30:46.000Z","updated_at":"2023-01-30T21:22:43.000Z","dependencies_parsed_at":"2024-11-02T04:31:52.561Z","dependency_job_id":"ab737af1-fda3-4304-afec-07638128b32d","html_url":"https://github.com/maehw/nami-efz-check","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maehw%2Fnami-efz-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maehw%2Fnami-efz-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maehw%2Fnami-efz-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maehw%2Fnami-efz-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maehw","download_url":"https://codeload.github.com/maehw/nami-efz-check/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246517752,"owners_count":20790480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dpsg","jugendarbeit","nami","scouting"],"created_at":"2024-08-01T06:00:20.525Z","updated_at":"2025-03-31T18:31:15.570Z","avatar_url":"https://github.com/maehw.png","language":"Python","funding_links":[],"categories":["NaMi Helper Tools"],"sub_categories":[],"readme":"# nami-efz-check\n\nCheck of EfZ-Nachweis via [DPSG NaMi](https://nami.dpsg.de) 2.2 web interface\n\nThe Python scripts in this repository are used to send HTTP requests to the official DPSG NaMi server and checks the \"erweiterte Führungszeugnisse\" for validity.\n\nThe inputs required to send the requests are:\n\n* First name(s) (\"Vorname(n)\"),\n* Surname (\"Nachname\"),\n* EfZ ID (\"EfZ-Nummer\"; \"Identifikationsnummer SGB VIII-Bescheinigung\" from \"Meine Bescheinigungen\" inside NaMi) and\n* date of birth (\"Geburtsdatum\").\n\nIf any item of the input data set is missing, the check is skipped.\n\nThere are currently three ways to perform the check:\n\n1. `gui.py`: a GUI where you can drag \u0026 drop single PDF files (\"Bescheinigungen\") downloaded from NaMi to be checked\n2. `check.py`: a command line tool that can take bulk input data (data from multiple \"Bescheinigungen\") from an Excel spreadsheet and can write check results back to it\n3. Use the Python class `BescheinigungsCheck` inside `bescheinigungs_check.py` in your own software project\n\n\n# Installation\n\nThere's currently no standalone/pre-built version available.\n\nYou will need a Python 3 environment and the Python script as source code.\n\n```\npython -m venv .venv\n. .venv/bin/activate\npip install -r requirements.txt\n```\n\nReady to go...\n\n# Usage\n\n## GUI tool to check single \"Bescheinigung\" `gui.py`\n\nRun `gui.py`, drag \u0026 drop a PDF file.\n\n![Before check](./doc/gui_start.png)\n\n⬇\n\n![After check](./doc/gui_success.png)\n\n## Command line utility to bulk-check data from an Excel spreadsheet `check.py`\n\nThe validity status of the data set can be displayed on the command line (optional) and also be stored back in the Excel file  (optional) along with a timestamp (also optional).\n\nTypical use cases: check EfZ validity of members of participants of certain events.\n\nThere is a variety of command line options, e.g. to perform dry-runs or define a custom order of columns where to take the input data from.\n\n\u003e **Disclaimer**\n\u003e There's no warranty that this script breaks your Excel file - either by misusing it or by accident. Remember to backup your data!\n\u003e \nFor the spreadsheet-based script (`check.py`):\n\n![Before check](./doc/before-check.png)\n\n⬇\n\n```\npython check.py test.xlsx\n```\n\n⬇\n\n![After check](./doc/after-check.png)\n\n\nFor the script checking NaMi's PDF file directly (`check_pdf.py`):\n\n```commandline\ncheck_pdf.py sgb-acht-bescheinigung_m4g1c.pdf\n[2023-07-01 23:42:13] \u003cVorname\u003e \u003cNachname\u003e   Gültig\n```\n\n\n## Command line options\n\nCall `python check.py --help` to get a detailed list of command line options:\n\n```\nusage: check.py [-h] [-c COLUMNS [COLUMNS ...]] [-n] [-dp] [-sr START_ROW] [-v] filename\n\ncheck.py checks EfZ-Nachweise in DPSG NaMi 2.2 using Excel and HTTP requests\n\npositional arguments:\n  filename              path to Excel input/output file\n\noptions:\n  -h, --help            show this help message and exit\n  -c COLUMNS [COLUMNS ...], --columns COLUMNS [COLUMNS ...]\n                        column numbers for the Excel workbook in the order Vorname (prename), Nachname (surname), Geburtsdatum (date of birth), EfZ ID (EfZ-\n                        Nummer), Status and Timestamp where the first column has number 1 (not 0)\n  -n, --dry-run         Dont actually send the HTTP requests to the server and dont write back to the Excel file. just parse the input data.\n  -dp, --dont-print     Dont print the data on the standard output.\n  -sr START_ROW, --start-row START_ROW\n                        Start row (to skip parsing of header lines); the first row has number 1 (not 0).\n  -v, --verbose         log level (-v: INFO, -vv: DEBUG)\n```\n\n## Options and customizations (with examples)\n\n### Default\n\n![Default column order](./doc/default-col-order.png)\n\nWhen not further specified, the script assumes that the **input data** is given in the default column order:\n\n1. First name,\n1. Surname,\n1. EfZ ID and\n1. Date of birth.\n\nAssumes that the columns for **output data** are given in the default column order (following the columns right after the input columns):\n\n1. Status and\n1. timestamp of the check.\n\n```\npython check.py test.xls\n                      ID                 Vorname             Nachname   Status\n----------------------------------------------------------------------------------------------------\n[2023-01-23 11:15:55] #1                   Erika           Mustermann   Ungültig oder Abfrage fehlerhaft\n[2023-01-23 11:15:56] #2                   Erika               Gabler   Ungültig oder Abfrage fehlerhaft\n[2023-01-23 11:15:56] #3                    Otto                        Eingangsdaten unvollständig\n[2023-01-23 11:15:56] #4                            Normalverbraucher   Eingangsdaten unvollständig\n[2023-01-23 11:15:56] #5                     Max           Mustermann   Eingangsdaten unvollständig\n[2023-01-23 11:15:56] #6                    Otto    Normalverbraucher   Eingangsdaten unvollständig\n```\n\n### Custom column order\n\nThe default column order may not be the best fit for your input data and you may want to define your own one - but how to do it?\n\nLet's assume your data looks like the following:\n\n![Custom column order](./doc/custom-col-order.png)\n\nThe spreadsheet has some additional columns irrelevant for the EfZ validity check itself - such as favorite color (\"Lieblingsfarbe\"), place of residence (\"Wohnort\") or favorite fruit (\"Lieblingsfrucht\").\n\nWe need to tell the script where to find what data. This is done by giving it the column numbers (first column has number 1, not 0) of the fields in the following order:\n\n1. First name,\n1. Surname,\n1. EfZ ID,\n1. Date of birth,\n1. Status (optional) and\n1. timestamp of the check (optional).\n\nFor the example from the screenshot:\n\n```\npython check.py test-special.xlsx --columns 2 1 6 5 8 9\n```\n\nMeaning:\n\n* First name is taken from column #2, surname from #1, EfZ ID from #5 and date of birth from #6.\n* Status will be stored in column #8.\n* Timestamp will be stored in column #9.\n\nIf you're not sure about it and want to check before sending hundreds of invalid queries or breaking your Excel files: verbosity flags (limit output, add explanations) and dry-runs (suppresses requests) can help. Read on for more info.\n\n\n### Custom start row\n\nThis script assumes that there is one row in the table that serves as the table's \"head\". Your data may have a bigger head (more than one line) or no head at all. This is why you can define a custom start row using command line parameter `--start-row` (`-sr`). Define the row number where the first row number is 1 (and not 0).\n\n**Use case #1:** Two head rows, i.e. start row is `3`:\n\n![Two head rows](./doc/longer-head.png)\n\n```\npython check.py test.xls --start-row 3\n```\n\n**Use case #2:** No head rows, i.e. start row is `1`:\n\n![Two head rows](./doc/no-head.png)\n\n```\npython check.py test.xls --start-row 1\n```\n\n### Verbosity\n\nAdd `-v` for additional output at log level `INFO` and `--vv` for additional log level `DEBUG`.\n\n```\npython check.py test.xls -v\n```\n```\npython check.py test.xls -vv\n```\n\nYou can provide the flag `--dont-print` (`-dp`) if the query input data and the EfZ validity status result and timestamp shall not be displayed on the standard output (and only written back to the Excel file):\n\n```\npython check.py test.xls --dont-print\n```\n\nArbitrary combinations are allowed, e.g.:\n\n```\ncheck.py test.xlsx --dont-print -vv \n[   DEBUG] Processing file 'test.xlsx'\n[   DEBUG] Start row: 2\n[    INFO] Number of columns in workbook sheet: 6\n[   DEBUG] Number of rows in workbook sheet to be processed: 7\n[   DEBUG] First name is taken from column #1, surname from #2, EfZ ID from #4 and date of birth from #3.\n[    INFO] Status will be stored in column #5.\n[    INFO] Timestamp will be stored in column #6.\n[   DEBUG] Need to store workbook after processing: True\n[   DEBUG] Starting new HTTPS connection (1): nami.dpsg.de:443\n[   DEBUG] https://nami.dpsg.de:443 \"POST /ica/sgb-acht-bescheinigung-pruefen HTTP/1.1\" 200 1010\n[   DEBUG] Starting new HTTPS connection (1): nami.dpsg.de:443\n[   DEBUG] https://nami.dpsg.de:443 \"POST /ica/sgb-acht-bescheinigung-pruefen HTTP/1.1\" 200 1011\n```\n\n\n### Don't write (everything) back to Excel file\n\nMultiple use cases may exist where you do not want to write something back to the Excel file.\n\n\n**Use case #1**: Perform a dry-run, just to check if the input data is okay (also does not send queries to the web server); use `--dry-run` (`-n`) flag:\n\n```\ncheck.py test.xlsx --dry-run\n                      ID                 Vorname             Nachname   Status\n----------------------------------------------------------------------------------------------------\n[2023-01-23 11:24:07] #1                   Erika           Mustermann   Nicht angefragt\n[2023-01-23 11:24:07] #2                   Erika               Gabler   Nicht angefragt\n[2023-01-23 11:24:07] #3                    Otto                        Nicht angefragt\n[2023-01-23 11:24:07] #4                            Normalverbraucher   Nicht angefragt\n[2023-01-23 11:24:07] #5                     Max           Mustermann   Nicht angefragt\n[2023-01-23 11:24:07] #6                    Otto    Normalverbraucher   Nicht angefragt\n```\n\n\n**Use case #2**: Omit storing the timestamp, only store the status: use `--columns` (`-c`) to omit the last column number for the status. For clarity of this example, the `-v` flag is used in addition:\n\n```\ncheck.py test.xlsx --columns 1 2 3 4 5 -v \n[    INFO] Number of columns in workbook sheet: 6\n[    INFO] Status will be stored in column #5.\n[    INFO] Won't store timestamp (no valid column number given).\n                      ID                 Vorname             Nachname   Status\n----------------------------------------------------------------------------------------------------\n[2023-01-23 11:25:57] #1                   Erika           Mustermann   Ungültig oder Abfrage fehlerhaft\n[2023-01-23 11:25:57] #2                   Erika               Gabler   Ungültig oder Abfrage fehlerhaft\n[2023-01-23 11:25:57] #3                    Otto                        Eingangsdaten unvollständig\n[2023-01-23 11:25:57] #4                            Normalverbraucher   Eingangsdaten unvollständig\n[2023-01-23 11:25:57] #5                     Max           Mustermann   Eingangsdaten unvollständig\n[2023-01-23 11:25:57] #6                    Otto    Normalverbraucher   Eingangsdaten unvollständig\n```\n\n**Use case #3**: Query the data from the web server but do not write back anything to the Excel source file. Again, for clarity of this example, the `-v` flag is used in addition:\n\n```\ncheck.py test.xlsx --columns 1 2 3 4 -v \n[    INFO] Only 4 column numbers given. Won't write back status and timestamp to Excel file (read-only).\n[    INFO] Number of columns in workbook sheet: 6\n[    INFO] Won't store status (no valid column number given).\n[    INFO] Won't store timestamp (no valid column number given).\n                      ID                 Vorname             Nachname   Status\n----------------------------------------------------------------------------------------------------\n[2023-01-23 11:28:59] #1                   Erika           Mustermann   Ungültig oder Abfrage fehlerhaft\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaehw%2Fnami-efz-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaehw%2Fnami-efz-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaehw%2Fnami-efz-check/lists"}