# oarepo\_oaipmh\_harvester.oai\_harvester.resource

## `oarepo_oaipmh_harvester.oai_harvester.resource`

OAI Harvester HTTP resource.

### `AdministrationDetailJSONSerializer`

Bases: `JSONSerializer`

JSON serializer for administration API.

#### `serialize_object(obj: Any) -> str`

Serialize a single harvester into the administration detail form.

#### `serialize_object_list(obj_list: list[Any]) -> str`

Serialize a list of harvesters into the administration detail form.

### `AdministrationEditJSONSerializer`

Bases: `JSONSerializer`

JSON serializer for the administration edit form.

The form edits `transformers`, `writers` and `harvest_managers` in textareas - they are serialized as newline separated text, managers as their e-mail addresses. The schema accepts the same text back (OAIHarvesterSchema).

#### `serialize_object(obj: Any) -> str`

Serialize a single harvester for the edit form.

### `OAIHarvesterResourceConfig`

Bases: `RecordResourceConfig`, `ConfiguratorMixin`

OAI-PMH harvester resource configuration.

### `OAIHarvesterResource`

Bases: `RecordResource`

REST resource for OAI-PMH harvesters.

#### `p(prefix: str, route: str) -> str`

Prefix a route with the URL prefix.

#### `create_url_rules() -> list[dict[str, Any]]`

Create the URL rules for the harvester resource.

#### `search() -> tuple[dict[str, Any], int]`

Search harvesters.

#### `read() -> tuple[dict[str, Any], int]`

Read a single harvester.

#### `harvest() -> tuple[dict[str, Any], int]`

Harvest the source - all records unless the payload has `all_records: false`.

### `data_to_html_yaml(data: Any) -> str`

Convert data to HTML-formatted YAML string.
