{"id":28139,"library":"renew","title":"renew","description":"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.","status":"maintenance","version":"0.5.4","language":"python","source_language":"en","source_url":"https://github.com/nicolaiarocci/renew","tags":["serialization","pythonic","reproducible","renew"],"install":[{"cmd":"pip install renew","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Python 2/3 compatibility","package":"six","optional":false}],"imports":[{"note":"No top-level Renew class; use the module-level function renew.renew()","wrong":"from renew import Renew","symbol":"renew","correct":"import renew"},{"note":"rebuild is a module function, not a top-level package","wrong":"import rebuild","symbol":"rebuild","correct":"from renew import rebuild"},{"note":"RenewHandler is in the handler submodule","wrong":"from renew import RenewHandler","symbol":"RenewHandler","correct":"from renew.handler import RenewHandler"}],"quickstart":{"code":"import renew\nfrom renew import rebuild\n\n# Define a simple class\nclass MyClass:\n    def __init__(self, x):\n        self.x = x\n    def __repr__(self):\n        return f\"MyClass({self.x})\"\n\n# Create an object\nobj = MyClass(42)\n\n# Renew the object (serialize to Python source code)\nrenewed_code = renew.renew(obj)\nprint(renewed_code)\n# Output: something like \"MyClass(42)\"\n\n# Rebuild from the code\nnew_obj = rebuild(renewed_code)\nprint(new_obj)\n# Output: MyClass(42)\n","lang":"python","description":"Basic usage: serialize an object with renew.renew() and reconstruct with rebuild()."},"warnings":[{"fix":"Consider alternatives like dill or cloudpickle for serialization.","message":"Library is in maintenance mode; no updates since 2018. May not support newer Python versions (3.9+).","severity":"deprecated","affected_versions":">=0.5.4"},{"fix":"Ensure your class has a simple __init__ that directly assigns arguments to attributes. Test serialization on your objects.","message":"renew.renew() only works for objects with simple __init__ signatures; complex objects (e.g., with non-trivial constructor logic) may fail or produce incorrect code.","severity":"gotcha","affected_versions":"all"},{"fix":"Never rebuild untrusted serialized data. Use a sandbox or avoid using rebuild if data origin is not secure.","message":"The rebuild() function uses eval internally; it can execute arbitrary code from the serialized string. Only use on trusted data.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install renew' in your environment.","cause":"Library not installed or installed with different name.","error":"ImportError: No module named 'renew'"},{"fix":"Correct import: 'import renew' then use 'renew.renew()'.","cause":"Import statement used 'from renew import renew' but the module is imported as 'import renew'.","error":"AttributeError: module 'renew' has no attribute 'renew'"},{"fix":"Simplify the object's __init__ to directly assign all attributes from arguments. For complex objects, consider using dill or pickle.","cause":"renew works via __init__ signature analysis; objects with complex constructors or non-standard attributes cannot be serialized.","error":"TypeError: can't pickle ... objects"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}