A package for easy access to Geo Engine instances
Project description
Geo Engine Python Package
This package allows easy access to Geo Engine functionality from Python environments.
Test
Create a virtual environment (e.g., python3 -m venv env).
Then, install the dependencies with:
python3 -m pip install -e .
python3 -m pip install -e .[test]
Run tests with:
pytest
Dependencies
Since we use cartopy, you need to have the following system dependencies installed.
- GEOS
- PROJ
For Ubuntu, you can use this command:
sudo apt-get install libgeos-dev libproj-dev
Build
You can build the package with:
python3 -m pip install -e .[dev]
python3 -m build
Formatting
This packages is formatted according to pycodestyle.
You can check it by calling:
python3 -m pycodestyle
Our tip is to install autopep8 and use it to format the code.
Lints
Our CI automatically checks for lint errors.
We use pylint to check the code.
You can check it by calling:
python3 -m pylint geoengine
python3 -m pylint tests
Our tip is to activate linting with pylint in your IDE.
Documentation
Generate documentation HTML with:
pdoc3 --html --output-dir docs geoengine
Examples
There are several examples in the examples folder.
It is necessary to install the dependencies with:
python3 -m pip install -e .[examples]
Distribute to PyPI
Test-PyPI
python3 -m build
python3 -m twine upload --repository testpypi dist/*
PyPI
python3 -m build
python3 -m twine upload --repository pypi dist/*
Try it out
Start a python terminal and try it out:
import geoengine as ge
from datetime import datetime
ge.initialize("https://nightly.peter.geoengine.io/api")
time = datetime.strptime('2014-04-01T12:00:00.000Z', "%Y-%m-%dT%H:%M:%S.%f%z")
workflow = ge.workflow_by_id('4cdf1ffe-cb67-5de2-a1f3-3357ae0112bd')
print(workflow.get_result_descriptor())
workflow.get_dataframe(ge.Bbox([-60.0, 5.0, 61.0, 6.0], [time, time]))
Authentication
If the Geo Engine server requires authentication, you can set your credentials in the following ways:
- in the initialize method:
ge.initialize("https://nightly.peter.geoengine.io/api", ("email", "password")) - as environment variables
export GEOENGINE_EMAIL="email"andexport GEOENGINE_PASSWORD="password" - in a .env file in the current working directory with the content:
GEOENGINE_EMAIL="email"
GEOENGINE_PASSWORD="password"
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geoengine-0.7.0.tar.gz.
File metadata
- Download URL: geoengine-0.7.0.tar.gz
- Upload date:
- Size: 23.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
509b9832c73012f5b9409085752ccbc0f564d904f362dbbc74e31373cb2f41f2
|
|
| MD5 |
153d72fe14ce131216d619af97c2814a
|
|
| BLAKE2b-256 |
c07af93757b632d5cfe3a7e8d06fd4f5c20a6c203a63f143893392669c004c15
|
File details
Details for the file geoengine-0.7.0-py3-none-any.whl.
File metadata
- Download URL: geoengine-0.7.0-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d14b9884414824e6d68fadd15192d84e6a61738f8ae2c65a72214c777bbded
|
|
| MD5 |
29f28c58b49aadd88421c5941b158364
|
|
| BLAKE2b-256 |
630bda44be7bff520b68c34d15ab26346ba7ecdde4a2ff13cbfb12cd57de2f44
|