Serialize and reconstruct
Serialization means representing an object as data that can be stored or transferred. Hereto_dict() produces a dictionary containing the survey’s questions and settings, and from_dict() turns it back into a usable Survey. This is useful when another Python tool needs to inspect or exchange the definition; use save() and load() for ordinary files.
restored contains the same questionnaire. Reconstructing it generates no answers; it is ready to edit, attach to a job, or publish for people to answer.
Copies, text representations, and files
Useobject.duplicate() on core study objects when you want an independent object to revise. Methods such as question.copy() and survey.copy() are also available. Collection transformations can return a new object or mutate the original; the object guides call out the distinction.
object.to_json() and object.to_yaml() provide readable serialized representations on objects that support them. to_dict() produces Python data; use the matching class’s from_dict() to reconstruct the object. Survey.from_jsonl(...), ScenarioList.from_jsonl(...), AgentList.from_jsonl(...), ModelList.from_jsonl(...), Jobs.from_jsonl(...), and Results.from_jsonl(...) read their EDSL JSONL representations. These are structured EDSL formats, not interchangeable readers for arbitrary row data.
object.save("study.ep") and ObjectClass.load("study.ep") preserve core study objects as packages. Use an explicit .json or .json.gz filename for JSON storage. save_json() and load_json() are the explicit JSON-only methods. A data export such as results.select(...).to_csv(...) preserves selected table columns; it does not preserve the entire study object.
Remote object shortcuts
For supported object classes,ObjectClass.list(page=1, page_size=20, search_query="pilot") lists remote objects of that type. ObjectClass.pull(uuid) downloads one object, and object.push(description="...", visibility="private") uploads it. These call Expected Parrot and require the appropriate access.
Use ObjectClass.patch(uuid, value=updated_object) to replace remote content, ObjectClass.patch_metadata(uuid, description="...") for metadata, and ObjectClass.share(uuid, username_or_email="[email protected]") for access. unshare() removes a recipient’s access and delete() removes the remote object. The Coop guide explains the corresponding client methods and when each operation is appropriate.
Jobs have different remote semantics: Jobs.list(job_status="completed", page=1, page_size=20) lists executions, and Jobs.pull(job_uuid) retrieves a submitted job’s specification. The metadata and access shortcuts above are not supported for Jobs; use background job methods to manage executions and Results object methods to share completed data.
For durable files, use Saving objects. For version history and package internals, see .ep packages. For uploads and shared-object operations, see Expected Parrot objects.