{"id":6798,"library":"pyglove","title":"PyGlove","description":"PyGlove is a general-purpose Python library for manipulating Python objects, introducing symbolic object-oriented programming (SOOP). It facilitates meta-program writing and is used in complex machine learning scenarios like AutoML, evolutionary computing, and daily programming tasks by providing a mutable symbolic object model and a rich set of object manipulation operations. It is currently at version 0.4.5 and actively maintained with regular updates.","status":"active","version":"0.4.5","language":"en","source_language":"en","source_url":"https://github.com/google/pyglove","tags":["python","object-manipulation","symbolic-programming","automl","machine-learning","hyperparameter-tuning","evolutionary-computing"],"install":[{"cmd":"pip install pyglove","lang":"bash","label":"Install PyGlove"}],"dependencies":[],"imports":[{"symbol":"pyglove","correct":"import pyglove as pg"}],"quickstart":{"code":"import pyglove as pg\n\n@pg.symbolize\nclass Hello:\n  def __init__(self, subject):\n    self._greeting = f'Hello, {subject}!'\n\n  def greet(self):\n    print(self._greeting)\n\nhello = Hello('World')\nhello.greet()","lang":"python","description":"Define a symbolic class using `@pg.symbolize` and instantiate it. The object can then be used like a regular Python object."},"warnings":[{"fix":"Add the `@pg.explicit_method_override` decorator to any overridden `__init__` method in `pg.Object` subclasses.","message":"When overriding `pg.Object.__init__`, it is now mandatory to apply the `@pg.explicit_method_override` decorator. Failing to do so will result in an error, as it prevents accidental overrides of core PyGlove-managed methods.","severity":"breaking","affected_versions":">=0.4.2"},{"fix":"Update usage to the new private API names (e.g., `__schema__`) or avoid direct use of removed internal components. Refer to release notes for precise renamings.","message":"Several internal APIs were renamed. `pg.Object.schema` became `pg.Object.__schema__`, `pg.Object.type_name` became `pg.Object.__type_name__`, and `pg.Object.serialization_key` moved to `pg.JSONConvertible.__serialization_key__`. Similarly, `pg.Functor.signature` was renamed to `pg.Functor.__signature__`. Additionally, `pg.ContextualValue`, `pg.symbolic.GetAttributeContext`, and related methods were removed.","severity":"deprecated","affected_versions":">=0.3.0 (specific changes vary)"},{"fix":"Carefully review PyGlove's documentation on symbolic object-oriented programming (SOOP) and mutation. Be prepared for potential refactoring and validation efforts when integrating with complex or highly customized object hierarchies.","message":"PyGlove operates on a mutable programming paradigm, which can introduce complexities and limitations, especially when refactoring existing code. Adapting models and trainers to conform to PyGlove's symbolic object constraints, particularly for generic subclassed models, can be more challenging than expected, as symbolic nodes constructed by initialization parameters might not behave as anticipated.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Migrate from `pg.members` or `pg.schema` to using Python type annotations (e.g., `field_name: pg.typing.Int()` or `field_name: int = pg.symbolic.Field(...)`) for declaring symbolic fields within `@pg.symbolize`d classes.","message":"The `pg.members` function and its alias `pg.schema` were replaced by symbolic member declaration using field annotations as the recommended approach for defining symbolic fields within classes.","severity":"deprecated","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}