lr-gladiator 0.12.0__py3-none-any.whl
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.
Potentially problematic release.
This version of lr-gladiator might be problematic. Click here for more details.
- gladiator/__init__.py +7 -0
- gladiator/arena.py +1119 -0
- gladiator/checksums.py +31 -0
- gladiator/cli.py +433 -0
- gladiator/config.py +60 -0
- lr_gladiator-0.12.0.dist-info/METADATA +198 -0
- lr_gladiator-0.12.0.dist-info/RECORD +11 -0
- lr_gladiator-0.12.0.dist-info/WHEEL +5 -0
- lr_gladiator-0.12.0.dist-info/entry_points.txt +2 -0
- lr_gladiator-0.12.0.dist-info/licenses/LICENSE +25 -0
- lr_gladiator-0.12.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lr-gladiator
|
|
3
|
+
Version: 0.12.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,11 @@
|
|
|
1
|
+
gladiator/__init__.py,sha256=ZeHpVdzARFyIp9QbdTkX0jNqnbRFX5nFQ5RkEFzSRL0,208
|
|
2
|
+
gladiator/arena.py,sha256=LphoXXJh1QXB5A_67S-qGA2GQs2lPhbNbZUjTiodDkY,42808
|
|
3
|
+
gladiator/checksums.py,sha256=5_3ra5E6itOPhWkb9MAR1ywuMtnVa_CxdcAe8t5x3PM,934
|
|
4
|
+
gladiator/cli.py,sha256=o0GfY2APUoZVKIS6Z-uSMweFnwuejt9sIk4xO1CKlsI,14773
|
|
5
|
+
gladiator/config.py,sha256=jlSIeAXrYdcbgHiz5gX_DEYeUBxr87NMIbEMcdChYVI,1941
|
|
6
|
+
lr_gladiator-0.12.0.dist-info/licenses/LICENSE,sha256=2CEtbEagerjoU3EDSk-eTM5LKgI_RpiVIOh3_CV4kms,1069
|
|
7
|
+
lr_gladiator-0.12.0.dist-info/METADATA,sha256=a0PwsIatqneDZdbff3CvfwjlxVuHxLn1DZU7HmD3bJY,4899
|
|
8
|
+
lr_gladiator-0.12.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
lr_gladiator-0.12.0.dist-info/entry_points.txt,sha256=SLka4w7iGS2B8HrbeZyNk5mxaIC6QKcv93us1OaWNwQ,48
|
|
10
|
+
lr_gladiator-0.12.0.dist-info/top_level.txt,sha256=tfrcAmK7_7Lf63w7kWy0wv_Qg9RrcFWGoins1-jGUF4,10
|
|
11
|
+
lr_gladiator-0.12.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 Your Name
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gladiator
|