PyGlove

0.4.5 · active · verified Wed Apr 15

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.

Warnings

Install

Imports

Quickstart

Define a symbolic class using `@pg.symbolize` and instantiate it. The object can then be used like a regular Python object.

import pyglove as pg

@pg.symbolize
class Hello:
  def __init__(self, subject):
    self._greeting = f'Hello, {subject}!'

  def greet(self):
    print(self._greeting)

hello = Hello('World')
hello.greet()

view raw JSON →