Registry / serialization / renew
library0.5.4pypypi✓ verified 86d ago

A Python library for reproducible object serialization in a 100% Pythonic format. It provides a consistent way to represent Python objects, enabling easy reconstruction and debugging. Current version: 0.5.4. Release cadence: low, with no recent releases.

pip install renew
INSTALL
IMPORT
SIG · RENEW
R
renew
serializationpythonv0.5.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

renew
import renew
from renew import Renew
No top-level Renew class; use the module-level function renew.renew()
rebuild
from renew import rebuild
import rebuild
rebuild is a module function, not a top-level package
RenewHandler
from renew.handler import RenewHandler
from renew import RenewHandler
RenewHandler is in the handler submodule

Basic usage: serialize an object with renew.renew() and reconstruct with rebuild().

import renew from renew import rebuild # Define a simple class class MyClass: def __init__(self, x): self.x = x def __repr__(self): return f"MyClass({self.x})" # Create an object obj = MyClass(42) # Renew the object (serialize to Python source code) renewed_code = renew.renew(obj) print(renewed_code) # Output: something like "MyClass(42)" # Rebuild from the code new_obj = rebuild(renewed_code) print(new_obj) # Output: MyClass(42)
Debug
Known issues
deprecatedLibrary is in maintenance mode; no updates since 2018. May not support newer Python versions (3.9+).
fix
Consider alternatives like dill or cloudpickle for serialization.
affects: >=0.5.4
gotcharenew.renew() only works for objects with simple __init__ signatures; complex objects (e.g., with non-trivial constructor logic) may fail or produce incorrect code.
fix
Ensure your class has a simple __init__ that directly assigns arguments to attributes. Test serialization on your objects.
affects: all
gotchaThe rebuild() function uses eval internally; it can execute arbitrary code from the serialized string. Only use on trusted data.
fix
Never rebuild untrusted serialized data. Use a sandbox or avoid using rebuild if data origin is not secure.
affects: all
Errors
Common errors & fixes
ImportError: No module named 'renew'
Library not installed or installed with different name.
fix
Run 'pip install renew' in your environment.
AttributeError: module 'renew' has no attribute 'renew'
Import statement used 'from renew import renew' but the module is imported as 'import renew'.
fix
Correct import: 'import renew' then use 'renew.renew()'.
TypeError: can't pickle ... objects
renew works via __init__ signature analysis; objects with complex constructors or non-standard attributes cannot be serialized.
fix
Simplify the object's __init__ to directly assign all attributes from arguments. For complex objects, consider using dill or pickle.
Upgrade
Version history
0.5.4latest on PyPI · released Jun 3, 2019
Audit
Dependencies
sixrequiredPython 2/3 compatibility
Agent activity
10 hits · last 30 days
node
10
Resources
renew — pip install renew · libregistry