Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename scythe module to client #132

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/scythe.md → docs/api/client.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
::: oaipmh_scythe.scythe.Scythe
::: oaipmh_scythe.client.Scythe
options:
show_root_heading: true
6 changes: 3 additions & 3 deletions docs/customizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class MyRecord(Record):
Take a look at the implementation of [oaipmh_scythe.models.Record][] to get an idea of
how to do this.

Next, associate your implementation with OAI verbs in the [oaipmh_scythe.scythe.Scythe][] object.
In this case, we want the [oaipmh_scythe.scythe.Scythe][] object to use our implementation to represent items returned by
Next, associate your implementation with OAI verbs in the [oaipmh_scythe.client.Scythe][] object.
In this case, we want the [oaipmh_scythe.client.Scythe][] object to use our implementation to represent items returned by
ListRecords and GetRecord responses:

```python
Expand All @@ -32,7 +32,7 @@ scythe.class_mapping['GetRecord'] = MyRecord
```

If you need to rewrite *all* item implementations, you can also provide
a complete mapping to the [oaipmh_scythe.scythe.Scythe][] object at instantiation:
a complete mapping to the [oaipmh_scythe.client.Scythe][] object at instantiation:

```python
my_mapping = {
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ next(records)
```

Note that this works with all verbs that return more than one element.
These are: [list_records()][oaipmh_scythe.scythe.Scythe.list_records],
[list_identifiers()][oaipmh_scythe.scythe.Scythe.list_identifiers], [list_sets()][oaipmh_scythe.scythe.Scythe.list_sets],
and [list_metadata_formats()][oaipmh_scythe.scythe.Scythe.list_metadata_formats].
These are: [list_records()][oaipmh_scythe.client.Scythe.list_records],
[list_identifiers()][oaipmh_scythe.client.Scythe.list_identifiers], [list_sets()][oaipmh_scythe.client.Scythe.list_sets],
and [list_metadata_formats()][oaipmh_scythe.client.Scythe.list_metadata_formats].

The following example shows how to iterate over the headers returned by
`list_identifiers()`:
Expand Down Expand Up @@ -107,7 +107,7 @@ returned objects. The default mode returns OAI-specific *items*
(records, headers etc.) encoded as Python objects as seen earlier. If
you want to save the whole XML response returned by the server, you have
to pass the [OAIResponseIterator][oaipmh_scythe.iterator.OAIResponseIterator] during the instantiation of the
[Scythe][oaipmh_scythe.scythe.Scythe] object:
[Scythe][oaipmh_scythe.client.Scythe] object:

```python
from oaipmh_scythe.iterator import OAIResponseIterator
Expand All @@ -126,8 +126,8 @@ with open("response.xml", "w") as f:

## Ignoring Deleted Records

The [list_records()][oaipmh_scythe.scythe.Scythe.list_records] and
[list_identifiers()][oaipmh_scythe.scythe.Scythe.list_identifiers] methods accept an optional parameter `ignore_deleted`.
The [list_records()][oaipmh_scythe.client.Scythe.list_records] and
[list_identifiers()][oaipmh_scythe.client.Scythe.list_identifiers] methods accept an optional parameter `ignore_deleted`.
If set to `True`, the returned [OAIItemIterator][oaipmh_scythe.iterator.OAIItemIterator] will skip deleted records/headers:

```python
Expand Down
4 changes: 2 additions & 2 deletions src/oaipmh_scythe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#
# SPDX-License-Identifier: BSD-3-Clause

"""oaipmh-scythe. OAI-PMH for Humans."""
"""oaipmh-scythe: A Scythe for harvesting OAI-PMH repositories."""

from oaipmh_scythe.client import Scythe
from oaipmh_scythe.response import OAIResponse
from oaipmh_scythe.scythe import Scythe

__all__ = [
"Scythe",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause

"""The scythe module provides a client interface for interacting with OAI-PMH services.
"""The client module provides a client interface for interacting with OAI-PMH services.

This module defines the Scythe class, which facilitates the harvesting of records, identifiers, and sets
from OAI-PMH compliant repositories. It handles various OAI-PMH requests, manages pagination with resumption tokens,
Expand Down