Base

Base class

Base class for all classes in the package. It provides rich printing and persistence of objects.

class edsl.Base.Base[source]

Bases: RichPrintingMixin, PersistenceMixin, DiffMethodsMixin, ABC

Base class for all classes in the package.

abstract code()[source]

This method should be implemented by subclasses.

abstract example()[source]

This method should be implemented by subclasses.

abstract from_dict()[source]

This method should be implemented by subclasses.

keys()[source]

Return the keys of the object.

abstract rich_print()[source]

This method should be implemented by subclasses.

show_methods(show_docstrings=True)[source]

Show the methods of the object.

abstract to_dict()[source]

This method should be implemented by subclasses.

to_json()[source]
values()[source]

Return the values of the object.

class edsl.Base.DiffMethodsMixin[source]

Bases: object

class edsl.Base.PersistenceMixin[source]

Bases: object

Mixin for saving and loading objects to and from files.

classmethod delete(uuid: str | UUID | None = None, url: str | None = None)[source]

Delete the object from coop.

classmethod load(filename)[source]

Load the object from a file.

>>> obj = cls.load("obj.json.gz")
static open_compressed_file(filename)[source]
static open_regular_file(filename)[source]
classmethod patch(uuid: str | UUID | None = None, url: str | None = None, description: str | None = None, value: Any | None = None, visibility: str | None = None)[source]

Patch an uploaded objects attributes. - description changes the description of the object on Coop - value changes the value of the object on Coop. has to be an EDSL object - visibility changes the visibility of the object on Coop

classmethod pull(uuid: str | UUID | None = None, url: str | None = None, expected_parrot_url: str | None = None)[source]

Pull the object from coop.

push(description: str | None = None, visibility: str | None = 'unlisted', expected_parrot_url: str | None = None)[source]

Post the object to coop.

save(filename, compress=True)[source]

Save the object to a file as zippped JSON.

>>> obj.save("obj.json.gz")
classmethod search(query)[source]

Search for objects on coop.

class edsl.Base.RegisterSubclassesMeta(name, bases, namespace, /, **kwargs)[source]

Bases: ABCMeta

Metaclass for registering subclasses.

static get_registry()[source]

Return the registry of subclasses.

class edsl.Base.RichPrintingMixin[source]

Bases: object

Mixin for rich printing and persistence of objects.

print()[source]

Print the object to the console.