Skip to main content

Support tool and library for EOCube.Ro

Project description

EOCube.RO Tools

Grant Funded pipeline status

This repository holds the eocube python library currently providing a set of minimal tools aimed to be used on the STAC Catalogs and data hosted by the ROCS Project

Installing

Option 1: From PyPi

pip install "eocube[cli]"

Visit https://pypi.org/project/eocube/ for more oficial packages.

Option 2: From GitLab Package Registry

pip install eocube[cli] --index-url https://gitlab.dev.info.uvt.ro/api/v4/projects/3491/packages/pypi/simple

Visit the GitLab Package Registry for available development packages

Option 3: From Git (development branch)

pip install "eocube[cli] @ git+https://gitlab.dev.info.uvt.ro/rocs/tools/eocube-tools.git@main"

Command Line Tools

You can use the command line tool by calling the eocube library.

Usage: eocube [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  services

🔐 Authentication

Login

In order to authenticate against our service provider you need to call:

eocube auth login

This will open a browser window and perform the standard authentication.

Logout

In order to invalidate the session and delete local token issue you need to call:

eocube auth login

User Info

For obtaining user information you can call:

eocube auth login

🧰 Internal Services

🌍 External Services

Geo-Spatial.Org Services

Some basic services from the Geo-Spatial.Org are provided. All the tools provide the option to save the result in a GeoJSON file.

Usage: eocube services geospatialorg [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  get-administrative-unit-by-code
                                  Uses the SIRUTA Code to retrieve the...
  get-administrative-unit-by-name
                                  Retrieves the administrative unit by name
  get-county-by-mnemonic          Retrieves the county by mnemonic
  get-county-by-name              Retrieves the county by name

Library Tools

Raster

  • eocube.raster.utils.get_raster_patches(): Function generating patches over an rasterio DatasetReaser

We welcome contributions! If you'd like to improve eocube, fix bugs, or propose new features, follow the steps below to set up your development environment.

🛠️ Development Setup (with Poetry)

This project uses Poetry for dependency management and packaging.

1. Install Poetry

Follow the official instructions:
👉 https://python-poetry.org/docs/#installation

Or, if you're on a Unix-like system:

pip install poetry

Or

curl -sSL https://install.python-poetry.org | python3 -

Make sure it’s available:

poetry --version

2. Clone the repository

git clone https://gitlab.dev.info.uvt.ro/rocs/tools/eocube-tools.git
cd eocube-tools

3. Create a feature branch

Never commit directly to main!

Create a new branch for your work:

git checkout -b my-feature-branch # Replace with something meaningful

4. Install development dependencies

poetry install --with dev

This will install both the main library and the development tools (black, pip-audit, twine, etc).

5. Activate the shell (optional)

poetry shell

You can now run commands like eocube, pytest, or black directly.

✅ Submitting Changes

  1. Push your branch to GitLab:
    git push --set-upstream origin my-feature-branch
    
  2. Open a Merge Request (MR) via the GitLab UI.
  3. Your MR will be reviewed and must be approved by a project maintainer before it can be merged.

🧹 Code Style

Make sure your code is properly formated. Non-compliant code will be rejected. We use Black for consistent formatting. Before committing:

poetry run black .

🙏 Acknowledgements

This work was supported by a grant of the Ministry of Research, Innovation and Digitization, CCCDI - UEFISCDI, project number PN-IV-P6-6.3-SOL-2024-2-0248, within PNCDI IV.

📜 Licensing

After updating do not forget to update the NOTICE file with:

pip-licenses --from=mixed --format=plain --with-urls -i eocube > NOTICE

🚀 Releasing a new version

Publication to PyPi is intentionally manual. Each released wheel embeds the git commit it was built from, surfaced via eocube --version:

$ eocube --version
eocube 0.1.2, commit 5ba2a1f8f812 (clean)

The (clean) marker is only present when the working tree had no uncommitted changes at build time — releases must always be (clean).

Recommended flow: scripts/release.sh

The repository ships a release helper that enforces a clean build, embeds the git provenance, sanity-checks the produced wheel, and uploads it to PyPi:

# 1. Bump the version and commit everything
poetry version patch                               # 0.1.1 → 0.1.2
git add pyproject.toml
git commit -m "release v$(poetry version -s)"
git tag "v$(poetry version -s)"

# 2. Build, verify, and publish
./scripts/release.sh

release.sh will:

  1. Refuse to proceed if the working tree has uncommitted changes or untracked files under src/ — guaranteeing a (clean) stamp.
  2. Wipe dist/, stamp src/eocube/_build_info.py with the current git rev-parse HEAD, run poetry build, then restore the placeholder _build_info.py so the stamped values never land in the repository.
  3. Install the produced wheel into a throwaway virtualenv and assert that eocube --version reports (clean). If not, the upload is aborted.
  4. Prompt for confirmation, then run poetry run twine upload --verbose -s -i 5C5D049F dist/*.

Useful flags:

Flag Purpose
--no-publish Build + verify only, skip the PyPi upload
--yes / -y Skip the confirmation prompt (CI-friendly)
--help Print the inline usage block

Adapt the GPG key id (5C5D049F) inside scripts/release.sh to match your own signing key if you maintain a fork.

After a successful upload, push the tag:

git push --tags

Manual fallback

If you need to build/publish without the helper script, the equivalent commands are:

rm -fr build/ dist/*
./scripts/stamp-build-info.sh                              # embed git provenance
poetry build
git checkout -- src/eocube/_build_info.py                  # restore the placeholder
poetry run twine upload --verbose -s -i 5C5D049F dist/*

Skipping stamp-build-info.sh is allowed but the resulting wheel will report eocube X.Y.Z with no commit suffix.

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

eocube-0.1.6.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

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

eocube-0.1.6-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file eocube-0.1.6.tar.gz.

File metadata

  • Download URL: eocube-0.1.6.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for eocube-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a98f9d3d5079fe426d0ae13a7eb35e5111748826f2a0f99e070dd781dee05bfd
MD5 cc821babb0207a6504661677a31262a1
BLAKE2b-256 d93825bf5c00990e3ff10b1717b8214ae1bb25c11f5a096cc0971c2bd4e95729

See more details on using hashes here.

File details

Details for the file eocube-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: eocube-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for eocube-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b41c64c0216150256fadff353f00fe9fdd1393ffbebadf671933d52d8b50797d
MD5 e4e06a18135c613e158dff84753c6be6
BLAKE2b-256 a97fa63af4425024a3a322a420c23d8f4efc98a2005d36fc8f372a34b34b1384

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