Skip to main content

regenerator

Create a reusable generator.

Depending on your process, it is likely faster to simply run the code to create your generator to create a "copy". However, if all you have is the generator itself, the regenerator package can create a copy. For large iterables, it is expected that copying the generator will offer speed-up. Furthermore, generators can be copied multiple times. The use-case therefore is in operations that need to be repeated, but creating a list out of the generator is too expensive.

Example use

# Import
from regenerator import Regenerator

# Create a generator
generator = (x for x in range(10))

# Create a Regenerator from generator
regenerator = Regenerator(generator)

# Run through generator once
for x in regenerator:
    print(x)

# Run through the generator again
for x in regenerator:
    print(x)

...

Installation

This package is available through pip,

pip install regenerator

Metadata

Release files for regenerator 0.1.2

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

Source distribution (sdist)

Source distribution for regenerator 0.1.2
File Size Uploaded
regenerator-0.1.2.tar.gz 22.4 kB Details

Built distribution (wheel)

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

Total release size: 26.5 kB

Release files / regenerator-0.1.2.tar.gz

Download URL regenerator-0.1.2.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
86879eb04e758a1a1f6251f3932536afd331d80639a0012cc785ef8973abcdfd
BLAKE2b-256 checksum
How to use checksums
901ae35a28b4d7ce59f213898e6545ed70fa4f8a514ff01c0171b8c5d432f1dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / regenerator-0.1.2-py3-none-any.whl

Download URL regenerator-0.1.2-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b80cb56299ed6f0e7b63417f0b7f966b50cada4187c128902f1e6cfbed2c55fe
BLAKE2b-256 checksum
How to use checksums
f67592c1f2f355f66c7ab682387fe4f2535a46480f345c2c4518f52d00df844e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.0

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