Skip to main content

homework

This library lets you easily set up programing homeworks.

Let's say you are teaching about neural networks and you wnat your students to implement gradient descent on their own. You could write the solution code in a file called ./source/gradient_descent.py as follows:

## homework:replace:on
# dw = 
# w = 
dw = compute_gradients()
w -= alpha * dw
## homework:replace:off

then, call homework ./source and it will generate a new folder source_homework, where the file ./source_homework/gradient_descent.py has be rewriten as:

## homework:start
dw = 
w = 
## homework:end

You can also create a delete block, which will produce output removing any existing code, for example, the code:

class A:
    def public(self, key: str) -> bool:
        ## homework:replace:on
        return self._private(key) is not None
        ## homework:replace:off

    ## homework:delete:on
    def _private(self, key: str) -> str | None:
        if key != "hello"
            return None
        return key
    ## homework:delete:off

will result in

class A:
    def public(self, key: str) -> bool:
        ## homework:replace:on
        ## homework:replace:off

Metadata

Release files for homework 2.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for homework 2.0.6
File Size Uploaded Provenance Actions
homework-2.0.6.tar.gz 5.5 kB Without provenance Details for homework-2.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for homework 2.0.6
File Interpreter ABI Platform Actions
homework-2.0.6-py3-none-any.whl Python 3 none any Details for homework-2.0.6-py3-none-any.whl

Total release size: 9.9 kB

Release files / homework-2.0.6.tar.gz

Download URL homework-2.0.6.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d34b65f69066b63ddeff4eb228992f675705a9c9779b4e49976c6ad229920a72
BLAKE2b-256 checksum
How to use checksums
31b7eeaec0d9b7b06fa4fb461938b80f75ee689e9cdc29b5bd7c5194d93a7624
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.12

Release files / homework-2.0.6-py3-none-any.whl

Download URL homework-2.0.6-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86d5bbc979a27a7d26736eaae3e1d4c9e942221ca3233d7843d3326d8f3c20a5
BLAKE2b-256 checksum
How to use checksums
63711c14677de17f4806c562b496d8ca639c17c8ebb328aeee84c07e5266579b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.12

Security for homework 2.0.6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page