Skip to main content

Command line tool and Python library for working with STAC.

Project description

stactools

Build Status Documentation License

stactools is a command line tool and library for working with STAC based on PySTAC.

Installation

Installing the base package

> pip install stactools

From source repository:

> git clone https://github.com/stac-utils/stactools.git
> cd stactools
> pip install .

To install stactools with all subpackages, use:

> git clone https://github.com/stac-utils/stactools.git
> cd stactools
> pip install .[all]

Installing additional subpackages and plugins

stactools is composed of a namespace package with individual sub-packages installable on their own. This allows users to install only the parts of stactools that they need, and for new plugins with heavy dependencies to be developed without effecting the overall

> pip install stactools[all]

to install

> pip install stactools_planet
> pip install stactools[planet]
install command description
pip install stactools[all] Installs all available subpackages contained in the stac-tools repo
pip install stactools[planet] Installs the planet subpackage for working with planet data

Running

> stactools --help

Documentation

See the documentation page for the latest docs.

Developing

Using virtualenv

It's recommended to use virtualenv to keep isolate the python environment used to develop stactools. See virtualenv documentation for more detailed information, but as a shortcut here's some quick steps:

  • Make sure virtualenv is installed
  • Run virtualenv venv
  • Activate the virtualenv with source venv/bin/active

Installing development requirements

To install all the requirements for subpackages and the development requirements, use:

> scripts/update

Running the CLI against development code

You can run the CLI through the source code by running

> scripts/stac --help

Sub-packages

stactools is comprised of subpackages that provide library and CLI functionality. Below is a list of available subpackages.

subpackage description
stactools_core Contains core library functionality that is used across the other projects
stactools_cli Contains the command line interface (cli) for running the stactools command
stactools_planet Contains methods and commands for working with planet data
stactools_landsat Contains methods and commands for working with landsat data (TODO)
stactools_browse Contains a command for launching stac-browser against a local STAC

Subpackages are symlinked to the stactools directory in this repo to allow them to be importable for python running at the top level directory of the repository clone.

Unit Tests

Unit tests are in the tests folder. To run unit tests, use unittest:

> python -m unittest discover tests

To run linters, code formatters, and test suites all together, use test:

> ./scripts/test

Code quality checks

stactools uses flake8 and yapf for code formatting and style checks.

To run the flake8 style checks:

> flake8 stactools_* tests

To format code:

> yapf -ipr stactools_* tests

To check for spelling mistakes in modified files:

> git diff --name-only | xargs codespell -I .codespellignore -f

You can also run the ./scripts/test script to check for linting, spelling, and run unit tests.

Documentation

To build and develop the documentation locally, make sure sphinx is available (which is installed with requirements-dev.txt), and use the Makefile in the docs folder:

> cd docs
> make html
> make livehtml

Use 'make' without arguments to see a list of available commands.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stactools-0.1.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

stactools-0.1.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page