lr-gladiator 0.3.0__tar.gz → 0.13.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lr_gladiator-0.13.0/PKG-INFO +198 -0
- lr_gladiator-0.13.0/README.md +171 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/pyproject.toml +2 -2
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/src/gladiator/__init__.py +1 -1
- lr_gladiator-0.13.0/src/gladiator/arena.py +1151 -0
- lr_gladiator-0.13.0/src/gladiator/checksums.py +31 -0
- lr_gladiator-0.13.0/src/gladiator/cli.py +433 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/src/gladiator/config.py +16 -8
- lr_gladiator-0.13.0/src/lr_gladiator.egg-info/PKG-INFO +198 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/src/lr_gladiator.egg-info/SOURCES.txt +3 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/src/lr_gladiator.egg-info/requires.txt +4 -0
- lr_gladiator-0.13.0/tests/test_arena_client.py +801 -0
- lr_gladiator-0.13.0/tests/test_checksums.py +48 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/tests/test_smoke.py +1 -0
- lr_gladiator-0.3.0/PKG-INFO +0 -90
- lr_gladiator-0.3.0/README.md +0 -67
- lr_gladiator-0.3.0/src/gladiator/arena.py +0 -506
- lr_gladiator-0.3.0/src/gladiator/cli.py +0 -157
- lr_gladiator-0.3.0/src/lr_gladiator.egg-info/PKG-INFO +0 -90
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/LICENSE +0 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/setup.cfg +0 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/src/lr_gladiator.egg-info/dependency_links.txt +0 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/src/lr_gladiator.egg-info/entry_points.txt +0 -0
- {lr_gladiator-0.3.0 → lr_gladiator-0.13.0}/src/lr_gladiator.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lr-gladiator
|
|
3
|
+
Version: 0.13.0
|
|
4
|
+
Summary: CLI and Python client for Arena PLM (app.bom.com): login, get revisions, list/download attachments, and upload to working revisions.
|
|
5
|
+
Author-email: Jonas Estberger <jonas.estberger@lumenradio.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: Arena,PLM,BOM,attachments,CLI
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: requests>=2.32
|
|
15
|
+
Requires-Dist: typer>=0.12
|
|
16
|
+
Requires-Dist: rich>=13.7
|
|
17
|
+
Requires-Dist: pydantic>=2.8
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: build>=1.2.1; extra == "dev"
|
|
20
|
+
Requires-Dist: twine>=5.1.1; extra == "dev"
|
|
21
|
+
Requires-Dist: wheel; extra == "dev"
|
|
22
|
+
Requires-Dist: pytest>=8.4.2; extra == "dev"
|
|
23
|
+
Requires-Dist: black>=25.9.0; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-html; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# gladiator-arena
|
|
29
|
+
|
|
30
|
+
CLI + Python client for interacting with the Arena PLM.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install lr-gladiator
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Quick start
|
|
39
|
+
|
|
40
|
+
### Login
|
|
41
|
+
|
|
42
|
+
Interactive login (prompts for username/password):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
gladiator login
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Non-interactive (for CI/CD):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
export GLADIATOR_USERNAME="<insert username>"
|
|
52
|
+
export GLADIATOR_PASSWORD="<insert password>"
|
|
53
|
+
gladiator login --ci
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
By default, this stores session details at:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
~/.config/gladiator/login.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Commands
|
|
63
|
+
|
|
64
|
+
Get the latest approved revision for an item:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
gladiator latest-approved 890-1001
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
List all files on an item (defaults to the latest approved revision):
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
gladiator list-files 890-1001
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Output JSON instead of a table:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
gladiator list-files 890-1001 --format json
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
List the Bill of Materials (BOM) for an item:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
gladiator bom 890-1001
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Recursively expand subassemblies up to two levels deep:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
gladiator bom 890-1001 --recursive --max-depth 2
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Download attached files to a directory named after the article:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
gladiator get-files 890-1001
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Specify a different output directory:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
gladiator get-files 890-1001 --out downloads/
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Recursively download all files in the full BOM tree:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
gladiator get-files 890-1001 --recursive
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Upload or update a file on the working revision:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
gladiator upload-file 890-1001 ./datasheet.pdf --category "CAD Data" --title "Datasheet"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 3) Output control
|
|
119
|
+
|
|
120
|
+
Most commands support a JSON output mode.
|
|
121
|
+
Example:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
gladiator bom 890-1001 --output json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Example sessions
|
|
128
|
+
|
|
129
|
+
#### Human-readable
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
$ gladiator list-files 101-1031
|
|
133
|
+
Files for 101-1031 rev (latest approved)
|
|
134
|
+
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┓
|
|
135
|
+
┃ Name ┃ Size ┃ Edition ┃ Type ┃ Location ┃
|
|
136
|
+
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━┩
|
|
137
|
+
│ 101-1907 E.PDF │ 171396 │ 1 │ FILE │ │
|
|
138
|
+
└─────────────────┴──────────┴─────────┴──────┴──────────┘
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### JSON output
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
$ gladiator list-files 101-1031 --format json
|
|
145
|
+
{
|
|
146
|
+
"article": "101-1031",
|
|
147
|
+
"revision": null,
|
|
148
|
+
"files": [
|
|
149
|
+
{
|
|
150
|
+
"id": "00000000000000000000",
|
|
151
|
+
"fileGuid": "11111111111111111111",
|
|
152
|
+
"name": "101-1907 E.PDF",
|
|
153
|
+
"filename": "101-1907 E.PDF",
|
|
154
|
+
"size": 171396,
|
|
155
|
+
"haveContent": true,
|
|
156
|
+
"downloadUrl": "https://api.arenasolutions.com/v1/files/11111111111111111111/content",
|
|
157
|
+
"edition": "1",
|
|
158
|
+
"updatedAt": "2016-12-06T12:31:33Z",
|
|
159
|
+
"attachmentGroupGuid": "22222222222222222222",
|
|
160
|
+
"storageMethodName": "FILE",
|
|
161
|
+
"location": null
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Programmatic use
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
from gladiator import ArenaClient, load_config
|
|
171
|
+
|
|
172
|
+
client = ArenaClient(load_config())
|
|
173
|
+
rev = client.get_latest_approved_revision("890-1001")
|
|
174
|
+
files = client.list_files("890-1001", rev)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Development
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
python -m pip install -e .[dev]
|
|
181
|
+
python -m build
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## FAQ
|
|
185
|
+
|
|
186
|
+
- **Where is the config kept?**
|
|
187
|
+
`~/.config/gladiator/login.json` (override with `GLADIATOR_CONFIG`)
|
|
188
|
+
|
|
189
|
+
- **How do I run non-interactively?**
|
|
190
|
+
Make sure to give all required arguments. Also pass `--ci` to stop output of sensitive information such as username or passwords.
|
|
191
|
+
|
|
192
|
+
- **What does `--recursive` do?**
|
|
193
|
+
Expands subassemblies and downloads or lists all contained items up to the given `--max-depth`.
|
|
194
|
+
|
|
195
|
+
- **How does Gladiator handle authentication?**
|
|
196
|
+
It performs a `/login` call and stores the resulting `arenaSessionId` for reuse. If it expires, re-run `gladiator login`.
|
|
197
|
+
|
|
198
|
+
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# gladiator-arena
|
|
2
|
+
|
|
3
|
+
CLI + Python client for interacting with the Arena PLM.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install lr-gladiator
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
### Login
|
|
14
|
+
|
|
15
|
+
Interactive login (prompts for username/password):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
gladiator login
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Non-interactive (for CI/CD):
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export GLADIATOR_USERNAME="<insert username>"
|
|
25
|
+
export GLADIATOR_PASSWORD="<insert password>"
|
|
26
|
+
gladiator login --ci
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
By default, this stores session details at:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
~/.config/gladiator/login.json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Commands
|
|
36
|
+
|
|
37
|
+
Get the latest approved revision for an item:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
gladiator latest-approved 890-1001
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
List all files on an item (defaults to the latest approved revision):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
gladiator list-files 890-1001
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Output JSON instead of a table:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
gladiator list-files 890-1001 --format json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
List the Bill of Materials (BOM) for an item:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
gladiator bom 890-1001
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Recursively expand subassemblies up to two levels deep:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
gladiator bom 890-1001 --recursive --max-depth 2
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Download attached files to a directory named after the article:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
gladiator get-files 890-1001
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Specify a different output directory:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
gladiator get-files 890-1001 --out downloads/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Recursively download all files in the full BOM tree:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
gladiator get-files 890-1001 --recursive
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Upload or update a file on the working revision:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
gladiator upload-file 890-1001 ./datasheet.pdf --category "CAD Data" --title "Datasheet"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 3) Output control
|
|
92
|
+
|
|
93
|
+
Most commands support a JSON output mode.
|
|
94
|
+
Example:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
gladiator bom 890-1001 --output json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Example sessions
|
|
101
|
+
|
|
102
|
+
#### Human-readable
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
$ gladiator list-files 101-1031
|
|
106
|
+
Files for 101-1031 rev (latest approved)
|
|
107
|
+
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━┓
|
|
108
|
+
┃ Name ┃ Size ┃ Edition ┃ Type ┃ Location ┃
|
|
109
|
+
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━┩
|
|
110
|
+
│ 101-1907 E.PDF │ 171396 │ 1 │ FILE │ │
|
|
111
|
+
└─────────────────┴──────────┴─────────┴──────┴──────────┘
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### JSON output
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
$ gladiator list-files 101-1031 --format json
|
|
118
|
+
{
|
|
119
|
+
"article": "101-1031",
|
|
120
|
+
"revision": null,
|
|
121
|
+
"files": [
|
|
122
|
+
{
|
|
123
|
+
"id": "00000000000000000000",
|
|
124
|
+
"fileGuid": "11111111111111111111",
|
|
125
|
+
"name": "101-1907 E.PDF",
|
|
126
|
+
"filename": "101-1907 E.PDF",
|
|
127
|
+
"size": 171396,
|
|
128
|
+
"haveContent": true,
|
|
129
|
+
"downloadUrl": "https://api.arenasolutions.com/v1/files/11111111111111111111/content",
|
|
130
|
+
"edition": "1",
|
|
131
|
+
"updatedAt": "2016-12-06T12:31:33Z",
|
|
132
|
+
"attachmentGroupGuid": "22222222222222222222",
|
|
133
|
+
"storageMethodName": "FILE",
|
|
134
|
+
"location": null
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Programmatic use
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from gladiator import ArenaClient, load_config
|
|
144
|
+
|
|
145
|
+
client = ArenaClient(load_config())
|
|
146
|
+
rev = client.get_latest_approved_revision("890-1001")
|
|
147
|
+
files = client.list_files("890-1001", rev)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Development
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
python -m pip install -e .[dev]
|
|
154
|
+
python -m build
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## FAQ
|
|
158
|
+
|
|
159
|
+
- **Where is the config kept?**
|
|
160
|
+
`~/.config/gladiator/login.json` (override with `GLADIATOR_CONFIG`)
|
|
161
|
+
|
|
162
|
+
- **How do I run non-interactively?**
|
|
163
|
+
Make sure to give all required arguments. Also pass `--ci` to stop output of sensitive information such as username or passwords.
|
|
164
|
+
|
|
165
|
+
- **What does `--recursive` do?**
|
|
166
|
+
Expands subassemblies and downloads or lists all contained items up to the given `--max-depth`.
|
|
167
|
+
|
|
168
|
+
- **How does Gladiator handle authentication?**
|
|
169
|
+
It performs a `/login` call and stores the resulting `arenaSessionId` for reuse. If it expires, re-run `gladiator login`.
|
|
170
|
+
|
|
171
|
+
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "lr-gladiator"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.13.0"
|
|
8
8
|
description = "CLI and Python client for Arena PLM (app.bom.com): login, get revisions, list/download attachments, and upload to working revisions."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -32,4 +32,4 @@ package-dir = {"" = "src"}
|
|
|
32
32
|
packages = ["gladiator"]
|
|
33
33
|
|
|
34
34
|
[project.optional-dependencies]
|
|
35
|
-
dev = ["build>=1.2.1", "twine>=5.1.1", "wheel"]
|
|
35
|
+
dev = ["build>=1.2.1", "twine>=5.1.1", "wheel", "pytest>=8.4.2", "black>=25.9.0", "pytest-html", "pytest-cov"]
|