Python library for working with Spatiotemporal Asset Catalog (STAC).
Project description
PySTAC
PySTAC is a library for working with SpatialTemporal Asset Catalog in Python 3.
Installation
PySTAC has a single dependency (python-dateutil
).
PySTAC can be installed from pip or the source repository.
> pip install pystac
if you'd like to enable the validation feature utilizing the jsonschema project, install with the optional validation
requirements:
> pip install pystac[validation]
From source repository:
> git clone https://github.com/stac-utils/pystac.git
> cd pystac
> pip install .
Versions
To install a specific versions of STAC, install the matching version of pystac.
> pip install pystac==0.5.*
The table below shows the corresponding versions between pystac and STAC:
pystac | STAC |
---|---|
0.5.x | 1.0.x |
0.4.x | 0.9.x |
0.3.x | 0.8.x |
Documentation
See the documentation page for the latest docs.
Developing
To ensure development libraries are installed, install everything in requirements-dev.txt
:
> pip install -r requirements-dev.txt
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
PySTAC uses flake8 and yapf for code formatting and style checks.
To run the flake8 style checks:
> flake8 pystac tests
To format code:
> yapf -ipr pystac tests
Note that you may have to use yapf3
explicitly depending on your environment.
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.
Continuous Integration
CI will run the scripts/test
script to check for code quality. If you have a Pull Request that fails CI, make sure to fix any linting, spelling or test issues reported by scripts/test
.
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.
Note: nbsphinx
requires that a local pystac
is installed; use pip install -e .
.
Running the quickstart and tutorials
There is a quickstart and tutorials written as jupyter notebooks in the docs/tutorials
folder.
To run the notebooks, run a jupyter notebook with the docs
directory as the notebook directory:
> PYTHONPATH=`pwd`:$PYTHONPATH jupyter notebook --ip 0.0.0.0 --port 8888 --notebook-dir=docs
You can then navigate to the notebooks and execute them.
Requires Jupyter be installed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pystac-0.5.6.tar.gz
.
File metadata
- Download URL: pystac-0.5.6.tar.gz
- Upload date:
- Size: 108.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee0da32e65e93b240dcdcf68f5a16fa2f3f9e937477161f574b04fc48682e84a |
|
MD5 | 793cc8bc8928455f5bb52656dae099b9 |
|
BLAKE2b-256 | ba028edc94906c6ad80cfcefd13c4a8a6c4de53222ee1b0f60aae33c6561088e |
Provenance
File details
Details for the file pystac-0.5.6-py3-none-any.whl
.
File metadata
- Download URL: pystac-0.5.6-py3-none-any.whl
- Upload date:
- Size: 136.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dfb9068169570714276e54a80832e555a136595a4d5316e6998bcc55cc2d639 |
|
MD5 | 57d935ab9440546ccbac9b79cd2a27bd |
|
BLAKE2b-256 | 69478a818d6f3d5352ce7f395cb2d4a19854abd79a107cb34cd5d279d26f2851 |