Skip to main content

A package to create programming assignments

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

homework-2.0.6.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

homework-2.0.6-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file homework-2.0.6.tar.gz.

File metadata

  • Download URL: homework-2.0.6.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for homework-2.0.6.tar.gz
Algorithm Hash digest
SHA256 d34b65f69066b63ddeff4eb228992f675705a9c9779b4e49976c6ad229920a72
MD5 2472ccc522a2d2333a54fdebb50c52d0
BLAKE2b-256 31b7eeaec0d9b7b06fa4fb461938b80f75ee689e9cdc29b5bd7c5194d93a7624

See more details on using hashes here.

File details

Details for the file homework-2.0.6-py3-none-any.whl.

File metadata

  • Download URL: homework-2.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for homework-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 86d5bbc979a27a7d26736eaae3e1d4c9e942221ca3233d7843d3326d8f3c20a5
MD5 89e3cd2b8b2b4a357ab53339ad96df8d
BLAKE2b-256 63711c14677de17f4806c562b496d8ca639c17c8ebb328aeee84c07e5266579b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page