Skip to main content

MAJIS Operations Toolbox

Majis operations toolbox logo

Pipeline Status Test coverage Documentation Status Latest release

This toolbox aims to collect MAJIS Operations scripts in a common python package.

The full documentation of the package can be found in majis-ops.readthedocs.io

🚀 Installation

python -m pip install majis-ops

🛰️ Basic examples

🐍 As python package

  • Read a ITL file:
from majis import read_itl

# Load absolute time ITL as EventsDict object
itl_abs = read_itl('absolute_time.itl')

# Load relative time ITL as EventsList object
itl_rel = read_itl('relative_time.itl', refs='events.evf', flat=True)

Note: Relative datetime can be provided either with a EVF file or inline with one or multiple strings: DATETIME REF_NAME (COUNT = N)

  • Export one (or multiple) ITL blocks:
from majis import save_itl

# Export as absolute ITL
save_itl('output.itl', itl_abs, itl_rel, …)

# Export as relative ITL
save_itl('output.itl', itl_abs, itl_rel, …, ref='DATETIME  REF_NAME (COUNT = N)')

# Export as CSV
save_itl('output.csv', itl_abs, itl_rel, …)

# Export as XLSM timeline w.r.t. C/A reference (based on default template)
save_itl('output.xlsm', itl_abs, ca_ref='DATETIME  REF_CA (COUNT = N)')

# Append to an existing XLSM timeline
save_itl(None, itl_abs, timeline='timeline.xlsm')

Notes:

  • When multiple ITL are provided, they will be concatenate and ordered by date.

  • Absolute and relative ITL are compatible.

  • Export can be either absolute or relative to a reference.

  • Observation block must not overlap.

  • Manipulate MAJIS timeline (.xlsm file):

>>> from majis import Timeline

>>> timeline = Timeline(timeline='timeline.xlsm')

# Get template version
>>> template.version
<Version('2.6')>

# Get template changelog
>>> template.log
'>>>    2.6 | 2026-04-29 | Cydalise Dumesnil'
'Comment of max N despiking value corrected'
'...'
'>>>    1.0 | 2022-11-08 | François Poulet'
'creation'

# Get science changelog
>>> template.science
''  # Empty by default

# Get the number of observations
>>> len(timeline)
10

# Get the list of observations
>>> timeline['OBS_NAME']
['OBS_001', ...]

# Get an observation details
>>> timeline[1]
{'OBS_NAME': 'OBS_001', 'start_angle': 1.5, ...}

# Get an observation property
>>> timeline['start_angle', 1]
1.5

# Append new observations from ITL file
>>> timeline.append('absolute_time.itl')

# Edit a single field
>>> timeline['start_angle', 1] = -1.5
>>> timeline['start_angle', 1]
-1.5

# Save to the same XLSM timeline
>>> timeline.save()

# Create a new timeline from the default template and a relative ITL file
>>> timeline = Timeline('relative_time.itl', refs='events.evf')

# Compute all relative time w.r.t. to a C/A reference
>>> timeline.ca_ref = '2032-09-24T21:33:36 PERIJOVE_12PJ (COUNT = 1)'
>>> timeline['First CU_frame start wrt C/A', 1]
'-001.18:35:25'

# Export the timeline to a new file
>>> timeline.save('new_timeline.xlsm')

👾 As command line interface

$ majis-itl --help

usage: majis-itl [-h] [-o output.[itl|csv|xlsm]] [-f]
                 [-t "YYYY-MM-DDTHH:MM:SS REF_NAME (COUNT = N)"]
                 [-r "YYYY-MM-DDTHH:MM:SS REF_NAME (COUNT = N)"]
                 [--timeline timeline.xlsm] [--header "# my-custom-header"]
                 [--overlap] [--csv] [--csv-sep separator]
                 [input.itl ...]

MAJIS ITL toolbox

positional arguments:
  input.itl             Input ITL filename(s). If multiple files are provided
                        they will be concatenated.

options:
  -h, --help            show this help message and exit
  -o output.[itl|csv|xlsm], --output output.[itl|csv|xlsm]
                        Output filename, it could be either ITL, CSV or XLSM.
                        If none provided, the results will be displayed (only
                        for ITL and CSV).
  -f, --force           Overwrite the output file if already exists.
  -t "YYYY-MM-DDTHH:MM:SS REF_NAME (COUNT = N)", --time-ref "YYYY-MM-DDTHH:MM:SS REF_NAME (COUNT = N)"
                        Input events time reference(s). If multiple values are
                        required use an `events.evf` file.
  -r "YYYY-MM-DDTHH:MM:SS REF_NAME (COUNT = N)", --relative-to "YYYY-MM-DDTHH:MM:SS REF_NAME (COUNT = N)"
                        Reference time to be used for relative time output.
  --timeline timeline.xlsm
                        Original timeline to append. If no explicit `--output`
                        is provided new observations will be append in this
                        file.
  --header "# my-custom-header"
                        ITL custom file header.
  --overlap             Allow blocks overlap.
  --csv                 Display the ITL as CSV.
  --csv-sep separator   CSV separator (default: ";")

Examples:

  • Convert a single ITL with relative time as an absolute CSV ITL file:
majis-itl relative_time.itl --time-ref "2032-09-24T21:33:36 PERIJOVE_12PJ (COUNT = 1)" --output output.csv
  • Concatenate two ITL with absolute and relative times as an relative ITL file:
majis-itl absolute_time.itl relative_time.itl --ref-time events.evf --relative-to "2032-09-24T21:33:36 PERIJOVE_12PJ (COUNT = 1)" --output output.itl

Note: If no --output flag is present, the output is display in the console.

  • Create a new MAJIS timeline (.xlsm) from a ITL the default template.
majis-itl absolute_time.itl --output output.xlsm
  • Edit an existing MAJIS timeline to compute relative time w.r.t. C/A reference.
majis-itl --timeline timeline.xlsm --relative-to "2032-09-24T21:33:36 PERIJOVE_12PJ (COUNT = 1)"

Note: If no --output flag is present, the output will be save in the original template.

👐 Contribution

If you want to contribute to this project, you need to install hatch on your system, then clone the depot and install de default env:

git clone https://git.ias.u-psud.fr/majis_sgs/operations/majis-ops-toolbox.git
cd majis-ops-toolbox

# Install dev dependencies
hatch env create

# Setup pre-commit hook
hatch -e linter run pre-commit install

To lint and format the source code:

hatch -e linter run check
hatch -e linter run format

To test the module:

hatch -e tests run tests

To build the docs:

hatch -e docs run build

Metadata

Release files for majis-ops 1.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for majis-ops 1.2.8
File Size Uploaded Provenance Actions
majis_ops-1.2.8.tar.gz 157.8 kB Without provenance Details for majis_ops-1.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for majis-ops 1.2.8
File Interpreter ABI Platform Actions
majis_ops-1.2.8-py3-none-any.whl Python 3 none any Details for majis_ops-1.2.8-py3-none-any.whl

Total release size: 249.6 kB

Release files / majis_ops-1.2.8.tar.gz

Download URL majis_ops-1.2.8.tar.gz
Size 157.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f97ae3ee4239e0ea1e010fc2560a46bed4ae16430cb282a82bec3a352ef7570a
BLAKE2b-256 checksum
How to use checksums
8b679cda1c639cddb4e7ddaf17f2481cf34a56426ee76223483e39bce1c3caa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.2 {"ci":true,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.10.22"},"installer":{"name":"hatch","version":"1.18.2"},"openssl_version":"OpenSSL 3.5.7 9 Jun 2026","python":"3.10.22","system":{"name":"Linux","release":"6.12.113+deb13-amd64"}} HTTPX2/2.14.0

Release files / majis_ops-1.2.8-py3-none-any.whl

Download URL majis_ops-1.2.8-py3-none-any.whl
Size 91.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
756c4f41e832003fc8f514f5e34d0b0e0acfe8a2d275ba2a3f4221026f5614c0
BLAKE2b-256 checksum
How to use checksums
ea11f3a182c15516160234d492a3237ebe2b754f8d3baf5443fdf84434e8fe0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.2 {"ci":true,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.10.22"},"installer":{"name":"hatch","version":"1.18.2"},"openssl_version":"OpenSSL 3.5.7 9 Jun 2026","python":"3.10.22","system":{"name":"Linux","release":"6.12.113+deb13-amd64"}} HTTPX2/2.14.0

Security for majis-ops 1.2.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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