split_qr_exam
This program splits a pdf composed of scanned exams. The input is a pdf file containing multiple scanned exames. On each exam cover there should be a QR code identifying the student writing this exam. For each part of the exam a folder will be created and for each student a pdf will be created in that folder to allow for parallel evaluation. To ensure pseudonymity the files are named with the sha256 hash of the student id.
For this to work, you have to specify all the parts of the exam with the corresponding amount of pages.
Install
The program can be installed using pip
To get the latest release from PyPI
pip install split_qr_exam
To get the latest development snapshot
pip install git+https://github.com/christofsteel/split_qr_exam.git
Both will also install all needed requirements, namely pymupdf and python-opencv2-headless. Note: This will install the command split_qr_exam system wide. If you only want to install it as the current user, you should add --user to the pip install commands.
Usage
usage: split_qr_exam [-h] [-t THRESHOLD] [-s SHRINK] [-c CROP] [-T] [-S] [-C] -p PART [-d] [-b] pdf [dest]
Split a scanned examfile into folders for each student and tasks in seperate pdf files. The input PDF should have a QR code identifying the student on the cover of each exam.
positional arguments:
pdf The pdf file to split
dest Destination folder. Default is the current directory
optional arguments:
-h, --help show this help message and exit
-t THRESHOLD, --threshold THRESHOLD
Set the threshold for the cleanup phase. Values range from 0 to 255. Lower value means more grey is detected as white, higher value means more grey is detected as black. Only impacts the QR detection phase. Default: 127
-s SHRINK, --shrink SHRINK
Width of the image in pixel for the QR code detection phase. Lower value means more performance, higher value means more accuracy. Only impacts the QR detection phase, does not affect the output PDF. Default: 600
-c CROP, --crop CROP Fractional coordinates, that represent the area of the coverpage, where the QR code is located. The format is "x1,y1:x2,y2" where x1, x2, y1, y2 are values from 0 to 1. Default is "0,0.5:0.5,1" which corresponds to the top right
quartal of the image.
-T, --no-cleanup Skip cleanup phase
-S, --no-shrink Skip shrinking phase
-C, --no-crop Skip cropping phase
-p PART, --part PART Name and amount of pages for the parts of the exam, seperated by a colon. Can (and should) be issued multiple times (Example "-p Cover:1 -p Task1:2"). Should also include a part for the cover sheet, and empty bonus sheets. The
number of pages should not include the backsides, if the document is scanned in duplex. Use --is-double-sided instead
-d, --is-double-sided
The exam is scanned in duplex. The split output pdf will also include the last backside of the previous part, since students tend to also write solutions there
-b, --last-part-is-bonus
The last part are bonus sheets. There will be a seperate pdf for each bonus sheet.
Example of use:
split_qr_exam -p cover:1 -p task1:2 -p task2:3 -p task3:1 -p bonus:3 -b -d scanned_exams.pdf ~/splitexams/
Metadata
Release files for split-qr-exam 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| split_qr_exam-0.1.3.tar.gz | 10.9 kB | Without provenance | Details for split_qr_exam-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| split_qr_exam-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for split_qr_exam-0.1.3-py3-none-any.whl |
Total release size: 33.5 kB
Release files / split_qr_exam-0.1.3.tar.gz
| Download URL | split_qr_exam-0.1.3.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68feb3880f50a0e5f6601de5600c6630f80850687f2c898bafd4fbbe55710049
|
|
BLAKE2b-256 checksum How to use checksums |
f08a1a008504dd7b0dd319ed2b2fd9a35eb8c8a389de37a0807a4e9125c2e989
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / split_qr_exam-0.1.3-py3-none-any.whl
| Download URL | split_qr_exam-0.1.3-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc1ea2df8260c47ffc503402e2764a2bc8102cd4366a67d6092b2852792d72df
|
|
BLAKE2b-256 checksum How to use checksums |
3c4a427ff876336a45bc18348485661dd395b10e10c7d91e4e227fe900efdc9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Security for split-qr-exam 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.