Skip to main content

Ptr Editor

PyPI PyPI - Python Version PyPI - License Coookiecutter - Wolt


Documentation: https://juice-soc-public.io.esa.int/python/ptr-editor/main/

Source Code: https://juice-soc-public.io.esa.int/python/ptr-editor/main/

PyPI: https://pypi.org/project/ptr-editor/


Installation

Basic Installation

pip install ptr-editor

Optional Features

CLI Module

To use the command-line interface (optional), install with CLI dependencies:

pip install "ptr-editor[cli]"

Then you can use commands like:

ptr-editor validate path/to/file.ptx

Configuration

Logging

By default, logging is disabled in non-Jupyter environments and set to WARNING level in Jupyter notebooks. You can configure the log level using a .env file:

  1. Copy the example environment file:

    cp .env.example .env
    
  2. Edit .env and set your desired log level:

    PTR_EDITOR_LOG_LEVEL=INFO
    

Valid log levels are: TRACE, DEBUG, INFO, SUCCESS, WARNING, ERROR, CRITICAL

Alternatively, you can set the environment variable directly:

export PTR_EDITOR_LOG_LEVEL=DEBUG

Or in Python before importing ptr_editor:

import os
os.environ["PTR_EDITOR_LOG_LEVEL"] = "DEBUG"
import ptr_editor

Development

  • Clone this repository
  • Requirements:
    • uv
    • Python 3.10+
  • Create a virtual environment and install the dependencies, by:
cd ptr-editor
uv sync --all-groups

Running

The package is mainly intended to be used as a library within jupyter notebooks or python scripts.

To quickly start a jupyter notebook with the package installed, you can use:

uv run jupyter lab tutorial

note: for this to work you need to have installed the package with uv as above.

Testing

uv run pytest

Documentation

Documentation is currently available here, as part of the tutorials verion.

to be updated: The documentation is automatically generated from the content of the docs directory and from the docstrings of the public signatures of the source code. The documentation is updated and published as a Github Pages page automatically as part each release.

Tutorials

A collection of example notebooks is available in the tutorial folder and distributed in Gitlab Pages though the CI. They can be rebuild them locally with:

uv run --group tutorials jupyter book start

Releasing

Manual release

Releases are done with the command, e.g. incrementing patch:

uv run just bump patch
# also push, of course:
git push origin main --tags

this will update the changelog, commit it, and make a corresponding tag.

as the CI is not yet configured for publish on pypi it can be done by hand:

uv build
uv publish --build path/to/wheel

Automatic release - to be fixed

Trigger the Draft release workflow (press Run workflow). This will update the changelog & version and create a GitHub release which is in Draft state.

Find the draft release from the GitHub releases and publish it. When a release is published, it'll trigger release workflow which creates PyPI release and deploys updated documentation.

Updating with copier

To update the skeleton of the project using copier:

uvx copier update --defaults

Pre-commit

Pre-commit hooks run all the auto-formatting (ruff format), linters (e.g. ruff and mypy), and other quality checks to make sure the changeset is in good shape before a commit/push happens.

You can install the hooks with (runs for each commit):

pre-commit install

Or if you want them to run only for each push:

pre-commit install -t pre-push

Or if you want e.g. want to run all checks manually for all files:

pre-commit run --all-files

Development Tools

This project was developed with assistance from AI tools, particularly Claude Sonnet 3.5, which was used extensively for:

  • Initial boilerplate code creation
  • Bootstrapping the test suite
  • General text file editing and modification
  • Code refactoring and improvements

While AI tools provided significant assistance in accelerating development, all code has been reviewed, tested, and integrated by human developers.


This project was generated using a fork of the wolt-python-package-cookiecutter template.

Download files

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

Source Distribution

ptr_editor-0.4.3.tar.gz (341.5 kB view details)

Uploaded Source

Built Distribution

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

ptr_editor-0.4.3-py3-none-any.whl (408.0 kB view details)

Uploaded Python 3

File details

Details for the file ptr_editor-0.4.3.tar.gz.

File metadata

  • Download URL: ptr_editor-0.4.3.tar.gz
  • Upload date:
  • Size: 341.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ptr_editor-0.4.3.tar.gz
Algorithm Hash digest
SHA256 e619173dd1afccda1f6124008d1723fee837656e15f1244834b3e0e6ae30eb2a
MD5 35000cf0ec13801812bf4936bd5d8f1b
BLAKE2b-256 6035cd587d9ebe602aa764e6758a02609f2c4395a12dc3ceee282536853a8e23

See more details on using hashes here.

File details

Details for the file ptr_editor-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: ptr_editor-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 408.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ptr_editor-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d2560c746c9e6cd6f609f1a8a759b33000128c94ccf897befe170ed04ca33958
MD5 1fa4598789bb129708d5901ef396a5d5
BLAKE2b-256 8c7baf2e416d67787580e725a02bf2b1e6381f02313ebc3dc7aa1d80b04960d3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page