Skip to main content

CLI and Python client for Arena PLM (app.bom.com): login, get revisions, list/download attachments, and upload to working revisions.

Project description

lr-gladiator

CLI + Python client for interacting with the Arena PLM.

Install

pip install lr-gladiator

Quick start

Login

Interactive login (prompts for username/password):

gladiator login

Non-interactive (for CI/CD):

export GLADIATOR_USERNAME="<insert username>"
export GLADIATOR_PASSWORD="<insert password>"
gladiator login --ci

By default, this stores session details at:

~/.config/gladiator/login.json

Commands

Get the latest approved revision for an item:

gladiator latest-approved 890-1001

Search for items by number pattern:

gladiator list-items 104*

Output JSON instead of a table:

gladiator list-items 104* --output json

Search for items by free text (matches Item Name and Description):

gladiator search-item "wireless module"

Output JSON instead of a table:

gladiator search-item "wireless module" --output json

List all files on an item (defaults to the latest approved revision):

gladiator list-files 890-1001

Output JSON instead of a table:

gladiator list-files 890-1001 --output json

Display a quick summary for an item revision (number, name, description, category, lifecycle, etc.):

gladiator info 890-1001

Emit machine-readable JSON instead of the Rich table:

gladiator info 890-1001 --output json

The summary includes the Arena web URL (Item URL) so you can click straight into the item from the terminal output.

Download the item's thumbnail (saved as <item>.png/.jpg) while fetching the summary:

gladiator info 890-1001 --picture --rev WORKING

List the Bill of Materials (BOM) for an item:

gladiator get-bom 890-1001

Recursively expand subassemblies up to two levels deep:

gladiator get-bom 890-1001 --recursive --max-depth 2

Add or update a BOM line on the working revision:

gladiator add-to-bom 890-1001 510-0005 --qty 2 --refdes R1

Target a different revision or inspect the raw API response:

gladiator add-to-bom 890-1001 510-0005 --parent-rev EFFECTIVE --output json

Download attached files to a directory named after the article:

gladiator get-files 890-1001

Specify a different output directory:

gladiator get-files 890-1001 --out downloads/

Recursively download all files in the full BOM tree:

gladiator get-files 890-1001 --recursive

Upload or update a file on the working revision:

gladiator upload-file 890-1001 ./datasheet.pdf --category "CAD Data" --title "Datasheet"

Inspect a change and see which views are affected (columns show * when the view is included in the change):

gladiator get-change CCO-0006

Show the raw change payload instead of the Rich table:

gladiator get-change CCO-0006 --output json

Add an item (WORKING revision by default) to an existing change:

gladiator add-to-change --change CCO-0003 510-0001

Create a new change order (effectivity and deadline flags optional):

gladiator create-change --title "Fan bracket update" --description "Replace bracket" --category "Engineering Change Order"

The command prints a summary table with the newly assigned change number. Use --output json to inspect the raw response payload.

Install the LLM skill

Install the bundled skill for Claude Code and GitHub Copilot (run from your project root):

gladiator install-skill

This installs to:

  • ~/.claude/skills/lr-gladiator/ — Claude Code
  • .github/instructions/lr-gladiator.instructions.md — GitHub Copilot
  • .vscode/settings.json — enables Copilot instruction files

Print the skill to stdout (pipe to any LLM):

gladiator install-skill --show

Output control

Most commands support a JSON output mode. Example:

gladiator get-bom 890-1001 --output json

Example sessions

Human-readable

$ gladiator list-files 101-1031
         Files for 101-1031 rev (latest approved)
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┓
┃ Name                 Size  Edition  Type  Location ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━┩
│ 101-1907 E.PDF     171396  1        FILE           │
└─────────────────┴──────────┴─────────┴──────┴──────────┘

JSON output

$ gladiator list-files 101-1031 --output json
{
  "article": "101-1031",
  "revision": null,
  "files": [
    {
      "id": "00000000000000000000",
      "fileGuid": "11111111111111111111",
      "name": "101-1907 E.PDF",
      "filename": "101-1907 E.PDF",
      "size": 171396,
      "haveContent": true,
      "downloadUrl": "https://api.arenasolutions.com/v1/files/11111111111111111111/content",
      "edition": "1",
      "updatedAt": "2016-12-06T12:31:33Z",
      "attachmentGroupGuid": "22222222222222222222",
      "storageMethodName": "FILE",
      "location": null
    }
  ]
}

Change inspections use a tabular view that highlights impacted areas. Example output for gladiator get-change CCO-0006:

                Affected items for CCO-0006
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━┓
┃ Item Number  Affected Rev  New Rev  Disposition    Notes   BOM  Specs  Files  Source  Cost ┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━┩
│ 510-0001     A             B        In Stock: Use  Review   *            *              *  │
└─────────────┴──────────────┴─────────┴───────────────┴────────┴─────┴───────┴───────┴────────┴──────┘

Programmatic use

Using an existing session

from gladiator import ArenaClient, load_config

client = ArenaClient(load_config())
rev = client.get_latest_approved_revision("890-1001")
files = client.list_files("890-1001", rev)

Programmatic login

Option 1: Direct function call (recommended)

from gladiator import ArenaClient, load_config, arena_login

# Authenticate and save config to current working directory as login.json
arena_login(
    username="username@company.com",
    password="password",
)

# Now use the client
client = ArenaClient(load_config())

Option 1b: Save to custom path

from pathlib import Path
from gladiator import ArenaClient, load_config, arena_login

# Save config to a specific location
arena_login(
    username="username@company.com",
    password="password",
    config_path=Path.home() / ".config/gladiator/login.json",
)

# Now use the client
client = ArenaClient(load_config())

Option 2: Login without saving to disk

from gladiator import ArenaClient, arena_login

# Authenticate but don't save
config = arena_login(
    username="username@company.com",
    password="password",
    save_to_disk=False,
)

# Use the config directly
client = ArenaClient(config)

Option 3: Using environment variables with CLI

import subprocess
import os

# Set credentials
os.environ["GLADIATOR_USERNAME"] = "username@company.com"
os.environ["GLADIATOR_PASSWORD"] = "password"

# Run login command
subprocess.run(["gladiator", "login", "--ci"], check=True)

# Now use the client
from gladiator import ArenaClient, load_config
client = ArenaClient(load_config())

FAQ

  • Where is the config kept?

    • CLI: ~/.config/gladiator/login.json (override with GLADIATOR_CONFIG)
    • Programmatic arena_login(): Saves to ~/.config/gladiator/login.json by default, or custom path via config_path parameter
  • How do I run non-interactively? Make sure to give all required arguments. Also pass --ci to stop output of sensitive information such as username or passwords.

  • What does --recursive do? Expands subassemblies and downloads or lists all contained items up to the given --max-depth.

  • How does Gladiator handle authentication? It performs a /login call and stores the resulting arenaSessionId for reuse. If it expires, re-run gladiator login.

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

lr_gladiator-0.38.0.tar.gz (60.0 kB view details)

Uploaded Source

Built Distribution

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

lr_gladiator-0.38.0-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file lr_gladiator-0.38.0.tar.gz.

File metadata

  • Download URL: lr_gladiator-0.38.0.tar.gz
  • Upload date:
  • Size: 60.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for lr_gladiator-0.38.0.tar.gz
Algorithm Hash digest
SHA256 6dc612b455f07e5e0f13de051dfbc8fec29cf5b3ea941ec062c4fc12da93e4bb
MD5 cfcebe2649503b4b31103120fdcc2c26
BLAKE2b-256 db2a20c3caeffdf1476b415039e1f26955e2c0b04e5257d9d20f182473100f99

See more details on using hashes here.

File details

Details for the file lr_gladiator-0.38.0-py3-none-any.whl.

File metadata

  • Download URL: lr_gladiator-0.38.0-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for lr_gladiator-0.38.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf51044542d0d9691b2f1d7f4074f2077f8b7f4c7a6f83951718c3368181aa24
MD5 c6afee00e593694e8845f9c91abf0789
BLAKE2b-256 d793fbe9a2fe3db4ec0523cc67c649e760f14151c5a3fa4355f7d7831b6b21b4

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