Skip to main content

Extra utility functions for X-Midas.

Project description

xmextras

Extra helper functionality for X-Midas.

XMSessionContext

Wraps an XMSession in with a context manager to ensure it gets ended correctly when exiting.

import xmextras as xmx

with xmx.XMSessionContext() as session:
    session.xm('res answer 42')

    # or
    from pymidas.xmidas import xm
    xm.res('answer', 42)

    answer = session.xmpy.res['answer']

info

Returns a dictionary of information about the X-Midas instance, which can be useful for tagging metrics and benchmarks for comparison.

import xmextras as xmx

with xmx.XMSessionContext() as session:
    info = xmx.info(session)  # also works with a normal XMSession instance

J1950

Conversion functions for dealing with J1950 times (seconds since January 1, 1950).

dt = j1950_to_datetime(2191001400.0)
j = datetime_to_j1950(dt)
e = j1950_to_epoch(2191001400.0)
j = epoch_to_to_j1950(1559849400.0)

power2

Calculates the next power of two greater than or equal to x.

power2(3)  # returns 4

bluefile

xmextras locates the system installation of bluefile.py so it can be imported outside of an X-Midas environment.

from xmextras import bluefile
header = bluefile.readheader('some_bluefile.tmp')

mcrlint

The mcrlint command is also included as part of xmextras. It can be used for linting X-Midas macro code. Use mcrlint --help for more information.

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

xmextras-2026.135.1200.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

xmextras-2026.135.1200-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file xmextras-2026.135.1200.tar.gz.

File metadata

  • Download URL: xmextras-2026.135.1200.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xmextras-2026.135.1200.tar.gz
Algorithm Hash digest
SHA256 8022c5d0963259a78ff195fc7ee4c4dc479579d82ff5db9b09d774718d05181c
MD5 3daecd47e99d16dca7685d5d986ba72f
BLAKE2b-256 5dc085eebdee8c81e6ea869182d7001f37eac457850854ff41f2da0f7dbc95cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmextras-2026.135.1200.tar.gz:

Publisher: CI.yml on spectriclabs/xmextras

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xmextras-2026.135.1200-py3-none-any.whl.

File metadata

File hashes

Hashes for xmextras-2026.135.1200-py3-none-any.whl
Algorithm Hash digest
SHA256 16a0a08f830678d0c86b93b65d71645b2edaad796fc49b4bc59c5ed2f047e7e3
MD5 22502ff95210fbfce5283aa2a075e943
BLAKE2b-256 8707ec7aacf2834ef67419ab3a472eee22eed127cea25228f13c79d94abc9af8

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmextras-2026.135.1200-py3-none-any.whl:

Publisher: CI.yml on spectriclabs/xmextras

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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