Bakery Support Library
A collection of tools to help students write code, meant for the Python Bakery CS1 curriculum.
For now, mostly improved assertions.
Installation
Install from PyPi:
pip install bakery
Or install from: https://github.com/python-bakery/bakery-support-library
Examples
from bakery import assert_equal
def halve(number):
return number / 2
# Correctly handles floating points
assert_equal(halve(10), 5.0)
Output
This library will print a message to STDOUT if an assertion fails, and returns True/False. It does not raise an exception or print to STDERR.
Supported Types
Numbers: strictly compares numeric types, but allows floats to have imprecision, defaults to 4 places
Strings: can strictly compare types with exact_strings=True, but defaults to ignore whitespace on newlines and capitalization
Lists, Tuples: applies same rules to inner types as container types
Sets, Frozensets, Dictionary: checks that all elements are contained in both, in any order
Generators: functions like enumerate and .items() that produce generators are converted to lists and sets (as appropriate), then checked that their values match.
Other types should work as well, but require that the result of type match, and that x == y
Metadata
Release files for bakery 1.0.0
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 | |
|---|---|---|---|---|
| bakery-1.0.0.tar.gz | 9.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bakery-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.6 kB
Release files / bakery-1.0.0.tar.gz
| Download URL | bakery-1.0.0.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
850df636d16ee4b7e05e805bf7785f210c63ff6969d49b8596f0f19d8809ae2a
|
|
BLAKE2b-256 checksum How to use checksums |
cbc505ee26a56a007eb475927a90bd94de75526057e96aef242448870a335b66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / bakery-1.0.0-py3-none-any.whl
| Download URL | bakery-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2b3441b1bd7eccf8dd6fc2734f6262df670eddf41eacd15d971bcb8f4beecf2
|
|
BLAKE2b-256 checksum How to use checksums |
7daab4fc22b4253d59bf447b854db5669b0e21350fa87af9f85c6ad732cb6503
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for bakery 1.0.0
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.