Skip to content

Fix docs for StacIO.read/write_text #835

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

Merged
merged 2 commits into from
Jun 29, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- "How to create STAC catalogs" tutorial ([#775](https://github.com/stac-utils/pystac/pull/775))
- Add a `variables` argument, to accompany `dimensions`, for the `apply` method of stac objects extended with datacube ([#782](https://github.com/stac-utils/pystac/pull/782))
- Deepcopy collection properties on clone. Implement `clone` method for `Summaries` ([#794](https://github.com/stac-utils/pystac/pull/794))
- Docstrings for `StacIO.read_text` and `StacIO.write_text` now match the type annotations for the `source` argument. ([#835](https://github.com/stac-utils/pystac/pull/835))

## [v1.4.0]

Expand Down
19 changes: 10 additions & 9 deletions pystac/stac_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class StacIO(ABC):
def read_text(self, source: HREF, *args: Any, **kwargs: Any) -> str:
"""Read text from the given URI.

The source to read from can be specified as a string or a
:class:`~pystac.Link`. If it is a string, it must be a URI or local path from
which to read. Using a :class:`~pystac.Link` enables implementations to use
additional link information, such as paging information contained in the
extended links described in the `STAC API spec
The source to read from can be specified as a string or :class:`os.PathLike`
object (:class:`~pystac.Link` is a path-like object). If it is a string, it
must be a URI or local path from which to read. Using a :class:`~pystac.Link`
enables implementations to use additional link information, such as paging
information contained in the extended links described in the `STAC API spec
<https://github.com/radiantearth/stac-api-spec/tree/master/item-search#paging>`__.

Args:
Expand All @@ -71,10 +71,11 @@ def write_text(
) -> None:
"""Write the given text to a file at the given URI.

The destination to write to from can be specified as a string or a
:class:`~pystac.Link`. If it is a string, it must be a URI or local path from
which to read. Using a :class:`~pystac.Link` enables implementations to use
additional link information.
The destination to write to can be specified as a string or
:class:`os.PathLike` object (:class:`~pystac.Link` is a path-like object). If
it is a string, it must be a URI or local path from which to read. Using a
:class:`~pystac.Link` enables implementations to use additional link
information.

Args:
dest : The destination to write to.
Expand Down