Skip to content
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
17 changes: 0 additions & 17 deletions .flake8

This file was deleted.

14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "."
schedule:
interval: daily
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Configuration file for pre-commit (https://pre-commit.com/).
# Please run `pre-commit run --all-files` when adding or changing entries.

repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args: [--ignore-words=.codespellignore]
types_or: [jupyter, markdown, python, shell]
- repo: https://github.com/PyCQA/doc8
rev: 0.11.1
hooks:
- id: doc8
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.960
# hooks:
# - id: mypy
# files: "^pystac_client/.*\\.py$"
# args:
# - --ignore-missing-imports
# additional_dependencies:
# - pystac
# - types-requests
# - types-python-dateutil
2 changes: 0 additions & 2 deletions .style.yapf

This file was deleted.

15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,20 @@ $ pip install -e .
$ pip install -r requirements-dev.txt
```

To run just the tests
[pre-commit](https://pre-commit.com/) is used to ensure a standard set of formatting and
linting is run before every commit. These hooks should be installed with:

```shell
$ pre-commit install
```

These can then be run independent of a commit with:

```shell
$ pre-commit run --all-files
```

To run just the tests:

```shell
$ pytest -v -s --block-network --cov pystac_client --cov-report term-missing
Expand Down
23 changes: 12 additions & 11 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
API Reference
=============

This section is autogenerated from in-line code documentation. It is mostly useful as a reference for the various
classes, methods, and other objects in the library, but is not intended to function as a starting point for working
with ``pystac_client``.
This section is autogenerated from in-line code documentation. It is mostly useful as a
reference for the various classes, methods, and other objects in the library, but is
not intended to function as a starting point for working with ``pystac_client``.

Client
------

Client is the base PySTAC-Client that inherits from :class:`Catalog <pystac.Catalog>`.
In addition to the PySTAC functionality, Client allows opening of API URLs, understanding of
conformance, and support for searching and paging through results.
In addition to the PySTAC functionality, Client allows opening of API URLs,
understanding of conformance, and support for searching and paging through results.

.. autoclass:: pystac_client.Client
:members:
Expand All @@ -20,9 +20,10 @@ conformance, and support for searching and paging through results.
Collection Client
-----------------

Client is the a PySTAC-Client that inherits from :class:`Collection <pystac.Collection>`.
In addition to the PySTAC functionality, CollectionClient allows opening of API URLs, and iterating
through items at a search endpoint, if supported.
Client is the a PySTAC-Client that inherits from
:class:`Collection <pystac.Collection>`. In addition to the PySTAC functionality,
CollectionClient allows opening of API URLs, and iterating through items at a search
endpoint, if supported.

.. autoclass:: pystac_client.CollectionClient
:members:
Expand All @@ -40,10 +41,10 @@ The `ItemSearch` class represents a search of a STAC API.
STAC API IO
-----------

The StacApiIO class inherits from the :class:`Collection <pystac.DefaultStacIO>` class and allows
for reading over http, such as with REST APIs.
The StacApiIO class inherits from the :class:`Collection <pystac.DefaultStacIO>`
class and allows for reading over http, such as with REST APIs.

.. autoclass:: pystac_client.stac_api_io.StacApiIO
.. autoclass:: pystac_client.stac_api_io.StacApiIO
:members:
:undoc-members:
:show-inheritance:
Expand Down
48 changes: 27 additions & 21 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@

# -- Project information -----------------------------------------------------

project = 'pystac-client'
copyright = '2021, Jon Duckworth'
author = 'Matthew Hanson, Jon Duckworth'
github_user = 'stac-utils'
github_repo = 'pystac-client'
package_description = 'A Python client for the STAC and STAC-API specs'
project = "pystac-client"
copyright = "2021, Jon Duckworth"
author = "Matthew Hanson, Jon Duckworth"
github_user = "stac-utils"
github_repo = "pystac-client"
package_description = "A Python client for the STAC and STAC-API specs"

# The full version, including alpha/beta/rc tags
version = re.fullmatch(r'^(\d+\.\d+\.\d).*$', __version__).group(1)
version = re.fullmatch(r"^(\d+\.\d+\.\d).*$", __version__).group(1)
release = __version__


Expand All @@ -44,8 +44,14 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx', 'sphinx.ext.napoleon',
'sphinx.ext.extlinks', 'sphinxcontrib.fulltoc', 'nbsphinx', 'myst_parser'
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.extlinks",
"sphinxcontrib.fulltoc",
"nbsphinx",
"myst_parser",
]

extlinks = {
Expand All @@ -59,29 +65,29 @@
nbsphinx_allow_errors = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
source_suffix = [".rst", "*.md", "*.ipynb"]
exclude_patterns = ['build/*']
exclude_patterns = ["build/*"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"

html_theme_options = {
# 'sidebar_collapse': False,
'fixed_sidebar': True,
'github_button': True,
'github_user': github_user,
'github_repo': github_repo,
'description': package_description
"fixed_sidebar": True,
"github_button": True,
"github_user": github_user,
"github_repo": github_repo,
"description": package_description,
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand All @@ -91,10 +97,10 @@
# -- Options for intersphinx extension ---------------------------------------

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'requests': ('https://requests.readthedocs.io/en/master', None),
'pystac': ('https://pystac.readthedocs.io/en/latest', None),
'dateutil': ('https://dateutil.readthedocs.io/en/stable/', None),
"python": ("https://docs.python.org/3", None),
"requests": ("https://requests.readthedocs.io/en/master", None),
"pystac": ("https://pystac.readthedocs.io/en/latest", None),
"dateutil": ("https://dateutil.readthedocs.io/en/stable/", None),
}

# -- Options for autodoc extension -------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ way is to coordinate with the core developers via an issue or pull request conve

Development installation
^^^^^^^^^^^^^^^^^^^^^^^^
Fork PySTAC-Client into your GitHub account. Then, clone the repo and install it locally with
pip as follows:
Fork PySTAC-Client into your GitHub account. Then, clone the repo and install
it locally with pip as follows:

.. code-block:: bash

Expand Down Expand Up @@ -91,4 +91,4 @@ few steps:
PR.

For more information on changelogs and how to write a good entry, see `keep a changelog
<https://keepachangelog.com/en/1.0.0/>`_.
<https://keepachangelog.com/en/1.0.0/>`_.
7 changes: 4 additions & 3 deletions docs/design/design_decisions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ Design Decisions
================

`Architectural Design Records (ADRs)
<https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions>`__ for major design decisions related to the
library. In general, this library makes an attempt to follow the design patterns laid out in the PySTAC library.
<https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions>`__ for major
design decisions related to the library. In general, this library makes an attempt to
follow the design patterns laid out in the PySTAC library.

.. toctree::
:glob:
:maxdepth: 1

*
*
20 changes: 11 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
PySTAC Client Documentation
===========================

The STAC Python Client (``pystac_client``) is a Python package for working with STAC Catalogs and APIs
that conform to the `STAC <https://github.com/radiantearth/stac-spec>`__ and
The STAC Python Client (``pystac_client``) is a Python package for working with STAC
Catalogs and APIs that conform to the
`STAC <https://github.com/radiantearth/stac-spec>`__ and
`STAC API <https://github.com/radiantearth/stac-api-spec>`__ specs in a seamless way.
PySTAC Client builds upon PySTAC through higher-level functionality and ability to leverage
STAC API search endpoints.
PySTAC Client builds upon PySTAC through higher-level functionality and ability to
leverage STAC API search endpoints.

STAC Versions
=============
Expand All @@ -32,15 +33,16 @@ Installation

``pystac_client`` requires `Python >=3.7 <https://www.python.org/>`__.

This will install the dependencies :doc:`PySTAC <pystac:index>`, :doc:`python-dateutil <dateutil:index>`,
and :doc:`requests <requests:index>`.
This will install the dependencies :doc:`PySTAC <pystac:index>`,
:doc:`python-dateutil <dateutil:index>`, and :doc:`requests <requests:index>`.

Acknowledgements
----------------

This package builds upon the great work of the PySTAC library for working with STAC objects in Python.
It also uses concepts from the `sat-search <https://github.com/sat-utils/sat-search>`__ library
for working with STAC API search endpoints.
This package builds upon the great work of the PySTAC library for working with
STAC objects in Python. It also uses concepts from the
`sat-search <https://github.com/sat-utils/sat-search>`__ library for working with STAC
API search endpoints.

Table of Contents
-----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ another process such as
$ stac-client search ${STAC_API_URL} -c sentinel-s2-l2a-cogs --bbox -72.5 40.5 -72 41 --datetime 2020-01-01/2020-01-31 | stacterm cal --label platform

.. figure:: images/stacterm-cal.png
:alt:
:alt:

If the ``--save`` switch is provided instead, the results will not be
output to stdout, but instead will be saved to the specified file.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ CQL Filtering

- :tutorial:`GitHub version <cql2-filter.ipynb>`

This tutorial gives an introduction to using CQL-JSON filtering in searches to
search by arbitrary STAC Item properties.
This tutorial gives an introduction to using CQL-JSON filtering in searches to
search by arbitrary STAC Item properties.
Loading