Skip to main content

No dependencies, no paradigm - Just a Bunch Of Code

A small collection of some useful code that didn't fit into any package that I know of.

Examples

Turn a generator function into a function that returns a list:

from jboc import collect


@collect
def odd_numbers(n):
    for i in range(n):
        yield 2 * i + 1


# not a generator anymore
odd_numbers(3) == [1, 3, 5] 

Same as before, but gather the values into a different container, e.g. a dict:

from jboc import composed


@composed(dict)
def vals_to_squares(values):
    for v in values:
        yield v, v ** 2


# the pairs are gathered in a dict
vals_to_squares([3, 2, 8]) == {3: 9, 2: 4, 8: 64}

Install

pip install jboc

Metadata

Release files for jboc 0.1.0

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

Source distribution (sdist)

Source distribution for jboc 0.1.0
File Size Uploaded Provenance Actions
jboc-0.1.0.tar.gz 3.9 kB Without provenance Details for jboc-0.1.0.tar.gz

Release files / jboc-0.1.0.tar.gz

Download URL jboc-0.1.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1aa4826885950b0846f2bc8e99f504cc7d134ac24f82b99ae8005c7055b5d5d8
BLAKE2b-256 checksum
How to use checksums
92dffd9017ee8c3bad85ea4d84b8a828acaae97486373430586e7dedb1c56c91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for jboc 0.1.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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