reorganize into a pip-installable package

main
adam j hartz 2 months ago
parent d6ee570284
commit 591a4180b5
Signed by: hz
GPG Key ID: 5FDD2840E179AD62

17
.gitignore vendored

@ -0,0 +1,17 @@
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

@ -1,6 +1,19 @@
gradesoop: grading of printed exams within catsoop
install prereqs:
install prereqs and the gradesoop package:
$ sudo apt install poppler-utils libzbar-dev
$ pip install -r requirements.txt
$ pip install .
this will install the gradesoop command, which is the entry point for all of
the pdf processing stuff. run the following to get started:
$ gradesoop --help
all of the subcommands have a --help flag that shows usage, arguments, and
options. here they are, roughly in the order they're needed:
* `gradesoop add-qrs` for adding qr codes to exams
* `gradesoop parse-scans` for reading and organizing raw scan data
* `gradesoop separate` for generating per-student pdfs from scan data
* `gradesoop setup-catsoop-course` for adding the web interface to a course

@ -0,0 +1 @@
__version__ = "0.0.0"

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import click
from .cli.add_qrs import main as add_qrs
from .cli.gather_scan_data import main as gather_scan_data
from .cli.separate_exams import main as separate_exams
main = click.Group()
main.add_command(add_qrs, "add-qrs")
main.add_command(gather_scan_data, "parse-scans")
main.add_command(separate_exams, "separate")
if __name__ == "__main__":
main()

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import io
import os
import hashlib
@ -14,7 +16,7 @@ from matplotlib.backends.backend_pdf import FigureCanvasPdf as mpl_FigureCanvasP
BAD_NUMBERS = set(map(str, (14, 69, 88, 420)))
from geometry import PAGE_SIZE, QR_SIZE, QR_LOCS
from ..geometry import PAGE_SIZE, QR_SIZE, QR_LOCS
@click.command()

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import io
import os
import sys

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import io
import os
import numpy
@ -10,7 +12,7 @@ import img2pdf
from PIL import Image, ImageTransform
from pypdf import PdfReader
from geometry import (
from ..geometry import (
PAGE_SIZE,
QR_EXPECTED_POINTS,
find_transform_matrix,

@ -8,3 +8,4 @@ black
pillow
pyzbar
img2pdf
catsoop

@ -0,0 +1,43 @@
from setuptools import setup
from gradesoop import __version__ as VERSION
def main():
with open(os.path.join(os.path.dirname(__file__), "requirements.txt"), "r") as f:
requirements = f.read().split("\n")
with open(os.path.join(os.path.dirname(__file__), "README"), "r") as f:
readme = f.read()
setup(
name="gradesoop",
version=VERSION,
author="adam j hartz",
author_email="hz@mit.edu",
packages=["gradesoop", "gradesoop.cli"],
package_dir={"gradesoop": "gradesoop"},
scripts=[],
url="https://catsoop.org/git/catsoop/gradesoop",
license="AGPLv3+",
description="gradesoop: grading of printed exams within catsoop",
long_description=readme,
long_description_content_type="text/plain",
include_package_data=True,
entry_points={"console_scripts": ["gradesoop = gradesoop.__main__:main"]},
install_requires=requirements,
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Environment :: Console",
"Environment :: Web Environment",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Education",
"Topic :: Education",
],
)
if __name__ == "__main__":
main()
Loading…
Cancel
Save