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

gladiator-arena

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

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 --format json

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

gladiator bom 890-1001

Recursively expand subassemblies up to two levels deep:

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

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"

3) Output control

Most commands support a JSON output mode.
Example:

gladiator 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 --format 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
    }
  ]
}

Programmatic use

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)

Development

python -m pip install -e .[dev]
python -m build

FAQ

  • Where is the config kept? ~/.config/gladiator/login.json (override with GLADIATOR_CONFIG)

  • 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.13.0.tar.gz (25.4 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.13.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lr_gladiator-0.13.0.tar.gz
  • Upload date:
  • Size: 25.4 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.13.0.tar.gz
Algorithm Hash digest
SHA256 87a33476538787f337222554d1f1b745a6daec66c9b99c96a6ff2a12300e82b1
MD5 c18c19ff1e57e85289ddf298f61f4c62
BLAKE2b-256 15871c08a45acd755cc1c8d2a691c4a5248d5131fd0d26ddcf6062955d08119c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lr_gladiator-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 19.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.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 077ae75c19ca8d66655ea661b94574c513ec97b60d370dd9983e51dcb76fd74c
MD5 de633f19c57535446683f0e0441d4ebc
BLAKE2b-256 6dae58e59a8f0cb8d2ca6a71b0765cbdf11cf9f2f0fabc51b0559fd510521517

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