Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Geo Engine Python Package

CI

This package allows easy access to Geo Engine functionality from Python environments.

Test

Create a virtual environment

Create a virtual environment (e.g., python3 -m venv env).

# create new venv
python3 -m venv env
# activate new venv
source env/bin/activate

Re-create virtual environment

# go out of old venv
deactivate
# delete oldv env
rm -r env
# create new venv
python3 -m venv env
# activate new venv
source env/bin/activate

Install dependencies

Then, install the dependencies with:

python3 -m pip install -e .
python3 -m pip install -e .[test]

Run tests

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 package 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.

Type Checking

Our CI automatically checks for typing errors. We use mypy to check the code. You can check it by calling:

python3 -m mypy geoengine
python3 -m mypy tests

Using the config file mypy.ini, you can suppress missing stub errors for external libraries. You can ignore a library by adding two lines to the config file. For example, suppressing matplotlib would look like this:

[mypy-matplotlib.*]
ignore_missing_imports = True

If there are typing-stubs packages you can install using pip, you can use these packages instead of ignoring the reported errors. To find out, which packages could be installed you can use the following command:

python3 -m mypy geoengine --install-types
python3 -m mypy tests --install-types

Keep in mind, that you need to add the missing stubs by extending the dependencies in setup.cfg or ignoring them with mypy.ini.

Our tip is to activate type checking with mypy 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:

  1. in the initialize method: ge.initialize("https://nightly.peter.geoengine.io/api", ("email", "password"))
  2. as environment variables export GEOENGINE_EMAIL="email" and export GEOENGINE_PASSWORD="password"
  3. in a .env file in the current working directory with the content:
GEOENGINE_EMAIL="email"
GEOENGINE_PASSWORD="password"

Download files

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

Source Distribution

geoengine-0.8.0b2.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geoengine-0.8.0b2-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file geoengine-0.8.0b2.tar.gz.

File metadata

  • Download URL: geoengine-0.8.0b2.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for geoengine-0.8.0b2.tar.gz
Algorithm Hash digest
SHA256 e00a256092cc43944d77c01a1dd6cd9bb20b82ac276fc5256019d9412810ec13
MD5 7aa81e1fe3b0c285b4c923dcce3497a0
BLAKE2b-256 1241e9aa21da8ce5d60414314450042e27c93af527dd8d5ea5c85043e33b4ecc

See more details on using hashes here.

File details

Details for the file geoengine-0.8.0b2-py3-none-any.whl.

File metadata

  • Download URL: geoengine-0.8.0b2-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for geoengine-0.8.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a750f563acf10c8d439507deb69498617176961ebadd440088fc4ee54c7511
MD5 cf59c2f1599e31548c10af23b7b40098
BLAKE2b-256 e614db12f327421ea2cdfb4e6b2da7d781fe78ded532d235c91922bcc3e94dd6

See more details on using hashes here.

Supported by

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