Skip to main content

Yuck!

Yuck! is a library that is helpful when you need to create a singleton instance of a function.

Just decorate the function you want to singletonize, call it once with setup arguments and subsequent calls will use the already setup function call.

Example

from yuck import yuck


@yuck
def db(connection_string: str):
    connection = connect(connection_string)

    query = yield
    while True:
        query = yield connection.execute(query)


# Initial setup
db_instance = db("sqlite:///:memory:")

# Use the singleton instance
result = db_instance.send("SELECT * FROM users")
print(result)

NOTE: I'm not entirely sure this really works but I'm too lazy to even check :D.

Metadata

Release files for pyuck 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 pyuck 0.1.0
File Size Uploaded
pyuck-0.1.0.tar.gz 2.7 kB Details

Built distribution (wheel)

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

Total release size: 5.9 kB

Release files / pyuck-0.1.0.tar.gz

Download URL pyuck-0.1.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9501d54946b544ffb1152429f6622ba4063dd5fe5a0424a39f48b094aaac11c0
BLAKE2b-256 checksum
How to use checksums
7b234b2078e0544606dd50778acb6e73d238a40362a28e291426586a7d7894bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / pyuck-0.1.0-py3-none-any.whl

Download URL pyuck-0.1.0-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46f4cabd97e09bdf0a19464ef8fdd8249a67819cc8922e25063fe48ae632a751
BLAKE2b-256 checksum
How to use checksums
2ac431ff4cb574005ccfcf2114df82de992a705644771145d3ae677b199d2b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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