Skip to main content

A command line tool for sending and receiving XÖV Transport Adapter (XTA) messages.

Project description

xta-tool

A command line tool for sending and receiving XÖV Transport Adapter (XTA) messages.

PyPI - Version

Usage

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

  Send and receive xta messages.

Options:
  -c, --config PATH   Use an extra configuration directory or file.
  -p, --profile TEXT  Use comma-separated configuration profiles.
  --version           Show the version and exit.
  --help              Show this message and exit.

Commands:
  close        Close a message by its ID, acknowledging it has been read.
  get          Get a message by ID and save it to PATH.
  inspect      Inspect a message by ID, showing its transport report.
  ls           List open messages by id.
  new          Get a new message id from the server.
  send         Send a message with ID from PATH.
  show-config  Show the active configuration values.

Config

The tool loads configuration values from $XDG_CONFIG_HOME/xta/config.toml and uses these values as defaults:

# Base URL for all three XTA service ports
base-url: str = "https://localhost:8443"
# Path to ManagementPort
management-port-path = "/services/XTAService/ManagementPort"
# Path to MsgBoxPort
msg-box-port-path = "/services/XTAService/MsgBoxPort"
# Path to SendXtaPort
send-port-path = "/services/XTAService/SendXtaPort"
# Enable verification of XTA server certificate
verify = true
# Root CA certificate, or empty to use system defaults (where path is relative to any config directory)
cafile = "ca.crt"
# Client certificate, or empty to use none (where path is relative to any config directory)
certfile = "tls.crt"
# Private key of client certificate, or empty to use none (where path is relative to any config directory)
keyfile = "tls.key"
# User-Agent in HTTP header, or empty to use none
user-agent = "Apache-CXF/4.0.7"
# Host in HTTP header, or empty to use default
host = ""
# Print response HTTP headers and SOAP envelope to stderr
verbose = false
# Limit size of file download when encoding to base64 (default 1 MiB)
max-save-base64-size = 1048576
# Limit size of response envelope (default 10 MiB)
max-response-envelope-size = 10485760
# Max entries when listing open messages
max-list-items = 100

# XTA PartyIdentifier used to identify this client
[self-identifier]
# Type
typ = "xoev"
# Category, or empty to use none
category = ""
# Name, or empty to use none
name = ""
# Certified identifier (for instance: "praefix:behoerdenschluessel"), or Wildcard identifier "*"
value = "*"

Configuration values may be overridden by profile configuration files. For instance, if XTA_TOOL_CONFIG=path/to/config.toml XTA_TOOL_PROFILE=profile1,profile2,profile3 is set, it reads values from path/to/config.toml and then from path/to/config-profile{1,2,3}.toml.

Send Message

Upload a message to the XTA server by:

xta send new xta-message.yaml

where xta-message.yaml contains, for instance:

metadata:
  service: "urn:fim:Wohngeld-Mietzuschuss:1.5"
  businessScenario:
    code: "FIM-WOHNGELD_DATA"
    listUri: "urn:de:xta:codeliste:business.scenario"
    listVersionId: "3.6"
  messageType:
    code: "fim.S05000227.05000227001005"
  messageTypePayloadSchema: "urn:xoev-de:xfall:standard:fim-s05000227_1.5"
  author:
    category: "Wohngeldportal"
    value: "wgp:010500100000"
  reader:
    category: "Wohngeldbehörde"
    value: "wgb:051110000000"

message:
  fileName: main.xml
  content: ./path/to/main.xml
  contentType: application/xml
attachments:
  - fileName: extra.txt
    content: ./path/to/extra.txt
    contentType: plain/txt

If a content path points to a directory, the tool sends all files in the directory as a ZIP archive.

If a content file path ends in .jinja, the tool sends the file after rendering it as a jinja2 template with config, metdata, message and attachments in the templating context.

Get Message

Download a message by its ID from the XTA server by:

xta get urn:some:message:id path/to/message

If path/to/message is an existing directory, the tool downloads attached files into the directory and references them in a message yaml path/to/message/xta-message.yaml, for instance, with content: main.xml.

If the output path is not an existing directory, the tool writes attached files directly as Base64 strings, meaning content: base64:..., into the message yaml path/to/message.

Install

Install xta as a command line tool by

uv tool install .

References

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

xta_tool-0.6.0.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

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

xta_tool-0.6.0-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file xta_tool-0.6.0.tar.gz.

File metadata

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

File hashes

Hashes for xta_tool-0.6.0.tar.gz
Algorithm Hash digest
SHA256 ebaeb29ce114bec02ef099a544c7e6d049b853bd9c79ada7f8016ce108df5e89
MD5 cb359c2e280b2431d1ff6a755e880f6c
BLAKE2b-256 9fc317b3da5b79f26a72243366db67a1d6d82e01ea1c72b54c2a38d26c2c9b17

See more details on using hashes here.

File details

Details for the file xta_tool-0.6.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for xta_tool-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40be6e4aba4873cc6c1a4437ebeb9c4adc04e3e78bf5d970f506802cd1ecb30f
MD5 b784702d7d0d88bbf264bdb4bfe876d1
BLAKE2b-256 f675d65a615cc629a2b3155a420947e8c56df3e1e9fda9ea9c00e096b8514e43

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