> ## Documentation Index
> Fetch the complete documentation index at: https://docs.expectedparrot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shared object methods

> Understand common serialization and persistence methods on EDSL objects.

Surveys, agents, scenarios, and results share methods for copying, saving, and inspecting their contents. Use this reference when you want to revise an independent copy, examine an object's definition as Python data, or move it between local files and Expected Parrot. For the everyday save-and-reopen workflow, start with [Saving objects](https://docs.expectedparrot.com/en/latest/guides/saving_objects.md).

## Serialize and reconstruct

**Serialization** means representing an object as data that can be stored or transferred. Here `to_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.

```python theme={null}
from edsl import QuestionFreeText, Survey

survey = Survey([
    QuestionFreeText(question_name="feedback", question_text="What should improve?")
])
payload = survey.to_dict()
restored = Survey.from_dict(payload)
assert restored.to_dict() == payload
```

`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

Use `object.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="collaborator@example.com")` for access. `unshare()` removes a recipient's access and `delete()` removes the remote object. The [Coop guide](https://docs.expectedparrot.com/en/latest/coop.md#update-and-share) 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](https://docs.expectedparrot.com/en/latest/guides/background_jobs.md) to manage executions and Results object methods to share completed data.

For durable files, use [Saving objects](https://docs.expectedparrot.com/en/latest/guides/saving_objects.md). For version history and package internals, see [.ep packages](https://docs.expectedparrot.com/en/latest/survey_ep_format.md). For uploads and shared-object operations, see [Expected Parrot objects](https://docs.expectedparrot.com/en/latest/coop.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.