shellsmith 0.2.1__tar.gz → 0.4.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.
- shellsmith-0.4.0/.gitignore +20 -0
- shellsmith-0.4.0/PKG-INFO +188 -0
- shellsmith-0.4.0/README.md +123 -0
- shellsmith-0.4.0/pyproject.toml +111 -0
- shellsmith-0.4.0/src/shellsmith/__init__.py +50 -0
- shellsmith-0.4.0/src/shellsmith/__main__.py +6 -0
- shellsmith-0.4.0/src/shellsmith/api.py +529 -0
- shellsmith-0.4.0/src/shellsmith/cli/app.py +44 -0
- shellsmith-0.4.0/src/shellsmith/cli/args.py +30 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/decode.py +13 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/encode.py +13 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/groups/__init__.py +0 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/groups/create.py +79 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/groups/delete.py +83 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/groups/get.py +165 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/groups/update.py +111 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/info.py +71 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/nuke.py +66 -0
- shellsmith-0.4.0/src/shellsmith/cli/commands/upload.py +32 -0
- shellsmith-0.4.0/src/shellsmith/cli/formats.py +13 -0
- shellsmith-0.4.0/src/shellsmith/cli/handlers.py +31 -0
- shellsmith-0.4.0/src/shellsmith/cli/opts.py +41 -0
- shellsmith-0.4.0/src/shellsmith/cli/pretty.py +142 -0
- shellsmith-0.4.0/src/shellsmith/cli/resolve.py +30 -0
- shellsmith-0.4.0/src/shellsmith/cli/simplify.py +74 -0
- shellsmith-0.4.0/src/shellsmith/clients.py +1388 -0
- shellsmith-0.4.0/src/shellsmith/config.py +41 -0
- shellsmith-0.4.0/src/shellsmith/extract.py +13 -0
- shellsmith-0.4.0/src/shellsmith/mcp/__init__.py +5 -0
- shellsmith-0.4.0/src/shellsmith/mcp/server.py +613 -0
- shellsmith-0.4.0/src/shellsmith/neo4j.py +163 -0
- shellsmith-0.4.0/src/shellsmith/services.py +184 -0
- shellsmith-0.4.0/src/shellsmith/types.py +5 -0
- shellsmith-0.4.0/src/shellsmith/upload.py +44 -0
- shellsmith-0.4.0/src/shellsmith/utils.py +95 -0
- shellsmith-0.2.1/PKG-INFO +0 -221
- shellsmith-0.2.1/README.md +0 -174
- shellsmith-0.2.1/pyproject.toml +0 -41
- shellsmith-0.2.1/setup.cfg +0 -4
- shellsmith-0.2.1/src/shellsmith/__init__.py +0 -18
- shellsmith-0.2.1/src/shellsmith/__main__.py +0 -4
- shellsmith-0.2.1/src/shellsmith/cli/commands/__init__.py +0 -6
- shellsmith-0.2.1/src/shellsmith/cli/commands/info.py +0 -52
- shellsmith-0.2.1/src/shellsmith/cli/commands/nuke.py +0 -9
- shellsmith-0.2.1/src/shellsmith/cli/commands/shell.py +0 -17
- shellsmith-0.2.1/src/shellsmith/cli/commands/sme.py +0 -13
- shellsmith-0.2.1/src/shellsmith/cli/commands/submodel.py +0 -16
- shellsmith-0.2.1/src/shellsmith/cli/commands/upload.py +0 -14
- shellsmith-0.2.1/src/shellsmith/cli/main.py +0 -62
- shellsmith-0.2.1/src/shellsmith/cli/parser.py +0 -97
- shellsmith-0.2.1/src/shellsmith/config.py +0 -19
- shellsmith-0.2.1/src/shellsmith/crud/shells.py +0 -61
- shellsmith-0.2.1/src/shellsmith/crud/submodels.py +0 -126
- shellsmith-0.2.1/src/shellsmith/neo4j.py +0 -115
- shellsmith-0.2.1/src/shellsmith/services.py +0 -131
- shellsmith-0.2.1/src/shellsmith/upload.py +0 -40
- shellsmith-0.2.1/src/shellsmith/utils.py +0 -35
- shellsmith-0.2.1/src/shellsmith.egg-info/PKG-INFO +0 -221
- shellsmith-0.2.1/src/shellsmith.egg-info/SOURCES.txt +0 -35
- shellsmith-0.2.1/src/shellsmith.egg-info/dependency_links.txt +0 -1
- shellsmith-0.2.1/src/shellsmith.egg-info/entry_points.txt +0 -2
- shellsmith-0.2.1/src/shellsmith.egg-info/requires.txt +0 -13
- shellsmith-0.2.1/src/shellsmith.egg-info/top_level.txt +0 -1
- shellsmith-0.2.1/tests/test_cli.py +0 -110
- shellsmith-0.2.1/tests/test_cli_integration.py +0 -59
- shellsmith-0.2.1/tests/test_crud.py +0 -123
- shellsmith-0.2.1/tests/test_neo4j.py +0 -138
- shellsmith-0.2.1/tests/test_upload.py +0 -12
- shellsmith-0.2.1/tests/test_utils.py +0 -27
- {shellsmith-0.2.1 → shellsmith-0.4.0}/LICENSE +0 -0
- {shellsmith-0.2.1 → shellsmith-0.4.0}/src/shellsmith/cli/__init__.py +0 -0
- {shellsmith-0.2.1/src/shellsmith/crud → shellsmith-0.4.0/src/shellsmith/cli/commands}/__init__.py +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shellsmith
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: A Python SDK and CLI for Eclipse BaSyx to manage Asset Administration Shells (AAS)
|
|
5
|
+
Project-URL: Homepage, https://github.com/SmartFactory-KL/shellsmith
|
|
6
|
+
Project-URL: Issues, https://github.com/SmartFactory-KL/shellsmith/issues
|
|
7
|
+
Project-URL: Documentation, https://shellsmith.pages.dev
|
|
8
|
+
Author-email: Peter Stein <peter.stein@dfki.de>
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2025 Peter Stein
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Keywords: aas,asset-administration-shell,basyx,cli,digital-twin,eclipse-basyx,i40,industry40,python,rest-client,typer
|
|
32
|
+
Classifier: Environment :: Console
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
42
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
43
|
+
Requires-Python: >=3.10
|
|
44
|
+
Requires-Dist: fastmcp
|
|
45
|
+
Requires-Dist: httpx
|
|
46
|
+
Requires-Dist: pydantic-settings
|
|
47
|
+
Requires-Dist: pyyaml
|
|
48
|
+
Requires-Dist: typer
|
|
49
|
+
Provides-Extra: docs
|
|
50
|
+
Requires-Dist: mkdocs; extra == 'docs'
|
|
51
|
+
Requires-Dist: mkdocs-material; extra == 'docs'
|
|
52
|
+
Requires-Dist: termynal; extra == 'docs'
|
|
53
|
+
Provides-Extra: neo4j
|
|
54
|
+
Requires-Dist: neo4j; extra == 'neo4j'
|
|
55
|
+
Provides-Extra: test
|
|
56
|
+
Requires-Dist: mypy; extra == 'test'
|
|
57
|
+
Requires-Dist: pytest; extra == 'test'
|
|
58
|
+
Requires-Dist: pytest-asyncio; extra == 'test'
|
|
59
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
60
|
+
Requires-Dist: pytest-dotenv; extra == 'test'
|
|
61
|
+
Requires-Dist: ruff; extra == 'test'
|
|
62
|
+
Requires-Dist: types-pyyaml; extra == 'test'
|
|
63
|
+
Requires-Dist: types-requests; extra == 'test'
|
|
64
|
+
Description-Content-Type: text/markdown
|
|
65
|
+
|
|
66
|
+
<div align="center">
|
|
67
|
+
<img src="https://raw.githubusercontent.com/SmartFactory-KL/shellsmith/main/docs/images/logo-purple-500.png" alt="shellsmith">
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div align="center">
|
|
71
|
+
<a href="https://github.com/SmartFactory-KL/shellsmith/actions/workflows/test.yaml"><img src="https://github.com/SmartFactory-KL/shellsmith/actions/workflows/test.yaml/badge.svg" alt="Test"></a>
|
|
72
|
+
<a href="https://codecov.io/gh/SmartFactory-KL/shellsmith"><img src="https://codecov.io/gh/SmartFactory-KL/shellsmith/branch/main/graph/badge.svg" alt="codecov"></a>
|
|
73
|
+
<a href="https://pypi.org/project/shellsmith"><img src="https://img.shields.io/pypi/v/shellsmith?color=%2334D058" alt="PyPI - Version"></a>
|
|
74
|
+
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<p align="center">
|
|
78
|
+
<b>Documentation</b>: <a href="https://shellsmith.pages.dev/" target="_blank">https://shellsmith.pages.dev</a>
|
|
79
|
+
</p>
|
|
80
|
+
|
|
81
|
+
**Shellsmith** is a Python SDK and CLI for managing [Asset Administration Shells (AAS)](https://industrialdigitaltwin.org/en/content-hub/aasspecifications), Submodels, and Submodel Elements via the [Eclipse BaSyx](https://www.eclipse.org/basyx/) REST API.
|
|
82
|
+
|
|
83
|
+
It provides full client-side access to AAS resources with a clean Python interface and a powerful `typer`-based CLI — ideal for scripting, automation, and digital twin integration workflows.
|
|
84
|
+
|
|
85
|
+
### Features
|
|
86
|
+
|
|
87
|
+
- 🐍 **Python SDK** for full CRUD access to Shells, Submodels, and Submodel Elements
|
|
88
|
+
- ⚡ **CLI tool** powered by [Typer](https://typer.tiangolo.com/) for fast scripting and automation
|
|
89
|
+
- ⚙️ Simple `.env`-based configuration for flexible environment switching
|
|
90
|
+
- 🔁 Seamless integration with the [Eclipse BaSyx](https://www.eclipse.org/basyx/) Environment REST API
|
|
91
|
+
|
|
92
|
+
## 🚀 Installation
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip install shellsmith
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Requires**: Python 3.10+
|
|
99
|
+
|
|
100
|
+
## 🧠 CLI Usage
|
|
101
|
+
|
|
102
|
+
Shellsmith provides a powerful command-line interface:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
aas --help
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Command | Description |
|
|
109
|
+
|----------|----------------------------------------------------------|
|
|
110
|
+
| `info` | Display the current Shell tree and identify issues. |
|
|
111
|
+
| `upload` | Upload a single AAS file or all AAS files from a folder. |
|
|
112
|
+
| `nuke` | ☢️ Delete all Shells and Submodels (irrevocable). |
|
|
113
|
+
| `encode` | Encode a value (e.g. Shell ID) to Base64. |
|
|
114
|
+
| `decode` | Decode a Base64-encoded value. |
|
|
115
|
+
| `get` | Get Shells, Submodels, and Submodel Elements. |
|
|
116
|
+
| `delete` | Delete Shells, Submodels, or Submodel Elements. |
|
|
117
|
+
| `update` | Update Shells, Submodels, or Submodel Elements. |
|
|
118
|
+
| `create` | Create new Shells, Submodels, or Submodel Elements. |
|
|
119
|
+
|
|
120
|
+
> ℹ️ Run `aas <command> --help` to view subcommands and options.
|
|
121
|
+
|
|
122
|
+
➡️ Full CLI reference: [shellsmith.pages.dev/cli](https://shellsmith.pages.dev/cli)
|
|
123
|
+
|
|
124
|
+
## 🐍 Python API Usage
|
|
125
|
+
|
|
126
|
+
You can also use `shellsmith` as a Python client library to interact with the BaSyx Environment REST API.
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
import shellsmith
|
|
130
|
+
|
|
131
|
+
# Fetch all AAS Shells
|
|
132
|
+
shells = shellsmith.get_shells()
|
|
133
|
+
|
|
134
|
+
# Fetch a specific Submodel
|
|
135
|
+
submodel = shellsmith.get_submodel("https://example.com/submodels/my-submodel")
|
|
136
|
+
|
|
137
|
+
# Read and update a Submodel Element's value
|
|
138
|
+
value = shellsmith.get_submodel_element_value(submodel["id"], "temperature")
|
|
139
|
+
shellsmith.patch_submodel_element_value(submodel["id"], "temperature", "42.0")
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
> ℹ️ `shell_id` and `submodel_id` are automatically base64-encoded unless you pass `encode=False`.
|
|
143
|
+
|
|
144
|
+
➡️ Full Python API reference: [shellsmith.pages.dev/api](https://shellsmith.pages.dev/api)
|
|
145
|
+
|
|
146
|
+
## 🔧 Configuration
|
|
147
|
+
|
|
148
|
+
The default AAS environment host is:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
http://localhost:8081
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
You can override it in several ways:
|
|
155
|
+
|
|
156
|
+
- Set the environment variable:
|
|
157
|
+
```bash
|
|
158
|
+
SHELLSMITH_BASYX_ENV_HOST=https://your-host:1234
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
- Create a `.env` file in your project with:
|
|
162
|
+
```dotenv
|
|
163
|
+
SHELLSMITH_BASYX_ENV_HOST=https://your-host:1234
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
- Use the `--host` option with any CLI command:
|
|
167
|
+
```bash
|
|
168
|
+
aas get shells --host https://your-host:1234
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- Pass the `host` parameter in any `shellsmith` Python function:
|
|
172
|
+
```python
|
|
173
|
+
shellsmith.get_shells(host="https://your-host:1234")
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
> 💡 The `--host` CLI flag and `host=` Python argument **take precedence** over environment variables and `.env`.
|
|
177
|
+
|
|
178
|
+
## 🤝 Contributing
|
|
179
|
+
|
|
180
|
+
We welcome contributions!
|
|
181
|
+
|
|
182
|
+
See the [Contributing Guide](https://shellsmith.pages.dev/contributing/) for setup, testing, and coding standards.
|
|
183
|
+
|
|
184
|
+
## Resources
|
|
185
|
+
|
|
186
|
+
- https://github.com/eclipse-basyx/basyx-java-server-sdk
|
|
187
|
+
- https://github.com/admin-shell-io/aas-specs-api
|
|
188
|
+
- https://app.swaggerhub.com/apis/Plattform_i40/Entire-API-Collection
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/SmartFactory-KL/shellsmith/main/docs/images/logo-purple-500.png" alt="shellsmith">
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
<a href="https://github.com/SmartFactory-KL/shellsmith/actions/workflows/test.yaml"><img src="https://github.com/SmartFactory-KL/shellsmith/actions/workflows/test.yaml/badge.svg" alt="Test"></a>
|
|
7
|
+
<a href="https://codecov.io/gh/SmartFactory-KL/shellsmith"><img src="https://codecov.io/gh/SmartFactory-KL/shellsmith/branch/main/graph/badge.svg" alt="codecov"></a>
|
|
8
|
+
<a href="https://pypi.org/project/shellsmith"><img src="https://img.shields.io/pypi/v/shellsmith?color=%2334D058" alt="PyPI - Version"></a>
|
|
9
|
+
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<b>Documentation</b>: <a href="https://shellsmith.pages.dev/" target="_blank">https://shellsmith.pages.dev</a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
**Shellsmith** is a Python SDK and CLI for managing [Asset Administration Shells (AAS)](https://industrialdigitaltwin.org/en/content-hub/aasspecifications), Submodels, and Submodel Elements via the [Eclipse BaSyx](https://www.eclipse.org/basyx/) REST API.
|
|
17
|
+
|
|
18
|
+
It provides full client-side access to AAS resources with a clean Python interface and a powerful `typer`-based CLI — ideal for scripting, automation, and digital twin integration workflows.
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- 🐍 **Python SDK** for full CRUD access to Shells, Submodels, and Submodel Elements
|
|
23
|
+
- ⚡ **CLI tool** powered by [Typer](https://typer.tiangolo.com/) for fast scripting and automation
|
|
24
|
+
- ⚙️ Simple `.env`-based configuration for flexible environment switching
|
|
25
|
+
- 🔁 Seamless integration with the [Eclipse BaSyx](https://www.eclipse.org/basyx/) Environment REST API
|
|
26
|
+
|
|
27
|
+
## 🚀 Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install shellsmith
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Requires**: Python 3.10+
|
|
34
|
+
|
|
35
|
+
## 🧠 CLI Usage
|
|
36
|
+
|
|
37
|
+
Shellsmith provides a powerful command-line interface:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
aas --help
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Command | Description |
|
|
44
|
+
|----------|----------------------------------------------------------|
|
|
45
|
+
| `info` | Display the current Shell tree and identify issues. |
|
|
46
|
+
| `upload` | Upload a single AAS file or all AAS files from a folder. |
|
|
47
|
+
| `nuke` | ☢️ Delete all Shells and Submodels (irrevocable). |
|
|
48
|
+
| `encode` | Encode a value (e.g. Shell ID) to Base64. |
|
|
49
|
+
| `decode` | Decode a Base64-encoded value. |
|
|
50
|
+
| `get` | Get Shells, Submodels, and Submodel Elements. |
|
|
51
|
+
| `delete` | Delete Shells, Submodels, or Submodel Elements. |
|
|
52
|
+
| `update` | Update Shells, Submodels, or Submodel Elements. |
|
|
53
|
+
| `create` | Create new Shells, Submodels, or Submodel Elements. |
|
|
54
|
+
|
|
55
|
+
> ℹ️ Run `aas <command> --help` to view subcommands and options.
|
|
56
|
+
|
|
57
|
+
➡️ Full CLI reference: [shellsmith.pages.dev/cli](https://shellsmith.pages.dev/cli)
|
|
58
|
+
|
|
59
|
+
## 🐍 Python API Usage
|
|
60
|
+
|
|
61
|
+
You can also use `shellsmith` as a Python client library to interact with the BaSyx Environment REST API.
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
import shellsmith
|
|
65
|
+
|
|
66
|
+
# Fetch all AAS Shells
|
|
67
|
+
shells = shellsmith.get_shells()
|
|
68
|
+
|
|
69
|
+
# Fetch a specific Submodel
|
|
70
|
+
submodel = shellsmith.get_submodel("https://example.com/submodels/my-submodel")
|
|
71
|
+
|
|
72
|
+
# Read and update a Submodel Element's value
|
|
73
|
+
value = shellsmith.get_submodel_element_value(submodel["id"], "temperature")
|
|
74
|
+
shellsmith.patch_submodel_element_value(submodel["id"], "temperature", "42.0")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
> ℹ️ `shell_id` and `submodel_id` are automatically base64-encoded unless you pass `encode=False`.
|
|
78
|
+
|
|
79
|
+
➡️ Full Python API reference: [shellsmith.pages.dev/api](https://shellsmith.pages.dev/api)
|
|
80
|
+
|
|
81
|
+
## 🔧 Configuration
|
|
82
|
+
|
|
83
|
+
The default AAS environment host is:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
http://localhost:8081
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
You can override it in several ways:
|
|
90
|
+
|
|
91
|
+
- Set the environment variable:
|
|
92
|
+
```bash
|
|
93
|
+
SHELLSMITH_BASYX_ENV_HOST=https://your-host:1234
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- Create a `.env` file in your project with:
|
|
97
|
+
```dotenv
|
|
98
|
+
SHELLSMITH_BASYX_ENV_HOST=https://your-host:1234
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
- Use the `--host` option with any CLI command:
|
|
102
|
+
```bash
|
|
103
|
+
aas get shells --host https://your-host:1234
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- Pass the `host` parameter in any `shellsmith` Python function:
|
|
107
|
+
```python
|
|
108
|
+
shellsmith.get_shells(host="https://your-host:1234")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
> 💡 The `--host` CLI flag and `host=` Python argument **take precedence** over environment variables and `.env`.
|
|
112
|
+
|
|
113
|
+
## 🤝 Contributing
|
|
114
|
+
|
|
115
|
+
We welcome contributions!
|
|
116
|
+
|
|
117
|
+
See the [Contributing Guide](https://shellsmith.pages.dev/contributing/) for setup, testing, and coding standards.
|
|
118
|
+
|
|
119
|
+
## Resources
|
|
120
|
+
|
|
121
|
+
- https://github.com/eclipse-basyx/basyx-java-server-sdk
|
|
122
|
+
- https://github.com/admin-shell-io/aas-specs-api
|
|
123
|
+
- https://app.swaggerhub.com/apis/Plattform_i40/Entire-API-Collection
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling >= 1.26", "hatch-vcs>=0.3"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "shellsmith"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
authors = [{ name = "Peter Stein", email = "peter.stein@dfki.de" }]
|
|
9
|
+
description = "A Python SDK and CLI for Eclipse BaSyx to manage Asset Administration Shells (AAS)"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
readme = { file = "README.md", content-type = "text/markdown" }
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Environment :: Console",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Software Development :: Libraries",
|
|
24
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
25
|
+
]
|
|
26
|
+
keywords = [
|
|
27
|
+
"aas",
|
|
28
|
+
"asset-administration-shell",
|
|
29
|
+
"basyx",
|
|
30
|
+
"eclipse-basyx",
|
|
31
|
+
"industry40",
|
|
32
|
+
"i40",
|
|
33
|
+
"digital-twin",
|
|
34
|
+
"cli",
|
|
35
|
+
"typer",
|
|
36
|
+
"rest-client",
|
|
37
|
+
"python",
|
|
38
|
+
]
|
|
39
|
+
dependencies = [
|
|
40
|
+
"httpx",
|
|
41
|
+
"pydantic-settings",
|
|
42
|
+
"fastmcp",
|
|
43
|
+
"pyyaml",
|
|
44
|
+
"typer",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[project.optional-dependencies]
|
|
48
|
+
test = [
|
|
49
|
+
"mypy",
|
|
50
|
+
"pytest",
|
|
51
|
+
"pytest-asyncio",
|
|
52
|
+
"pytest-cov",
|
|
53
|
+
"pytest-dotenv",
|
|
54
|
+
"ruff",
|
|
55
|
+
"types-pyyaml",
|
|
56
|
+
"types-requests"
|
|
57
|
+
]
|
|
58
|
+
docs = [
|
|
59
|
+
"mkdocs",
|
|
60
|
+
"mkdocs-material",
|
|
61
|
+
"termynal",
|
|
62
|
+
]
|
|
63
|
+
neo4j = [
|
|
64
|
+
"neo4j",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[project.scripts]
|
|
68
|
+
aas = "shellsmith.cli.app:main"
|
|
69
|
+
shellsmith-mcp = "shellsmith.mcp.server:cli_main"
|
|
70
|
+
|
|
71
|
+
[project.urls]
|
|
72
|
+
Homepage = "https://github.com/SmartFactory-KL/shellsmith"
|
|
73
|
+
Issues = "https://github.com/SmartFactory-KL/shellsmith/issues"
|
|
74
|
+
Documentation = "https://shellsmith.pages.dev"
|
|
75
|
+
|
|
76
|
+
[tool.hatch.version]
|
|
77
|
+
source = "vcs"
|
|
78
|
+
|
|
79
|
+
[tool.hatch.build.targets.sdist]
|
|
80
|
+
include = ["src", "README.md", "LICENSE"]
|
|
81
|
+
|
|
82
|
+
[tool.ruff]
|
|
83
|
+
target-version = "py310"
|
|
84
|
+
|
|
85
|
+
[tool.ruff.lint]
|
|
86
|
+
select = [
|
|
87
|
+
"ANN", # flake8-annotations
|
|
88
|
+
"B", # flake8-bugbear
|
|
89
|
+
"C4", # flake8-comprehensions
|
|
90
|
+
"D", # pydocstyle
|
|
91
|
+
"E", # pycodestyle errors
|
|
92
|
+
"F", # pyflakes
|
|
93
|
+
"I", # isort
|
|
94
|
+
"N", # pep8-naming
|
|
95
|
+
"PL", # pylint
|
|
96
|
+
"SIM", # flake8-simplify
|
|
97
|
+
"UP", # pyupgrade
|
|
98
|
+
"W", # pycodestyle warnings
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
ignore = [
|
|
102
|
+
"ANN401", # Allow Any types
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
[tool.ruff.lint.per-file-ignores]
|
|
106
|
+
"__init__.py" = ["D104", "F401"]
|
|
107
|
+
"tests/**/test_*.py" = ["ANN", "PL"]
|
|
108
|
+
"tests/**/*.py" = ["D"]
|
|
109
|
+
|
|
110
|
+
[tool.ruff.lint.pydocstyle]
|
|
111
|
+
convention = "google"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Module level imports."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import version
|
|
4
|
+
|
|
5
|
+
__version__ = version("shellsmith")
|
|
6
|
+
|
|
7
|
+
from .api import (
|
|
8
|
+
create_shell,
|
|
9
|
+
create_submodel,
|
|
10
|
+
create_submodel_element,
|
|
11
|
+
create_submodel_ref,
|
|
12
|
+
delete_shell,
|
|
13
|
+
delete_submodel,
|
|
14
|
+
delete_submodel_element,
|
|
15
|
+
delete_submodel_ref,
|
|
16
|
+
get_health_status,
|
|
17
|
+
get_shell,
|
|
18
|
+
get_shells,
|
|
19
|
+
get_submodel,
|
|
20
|
+
get_submodel_element,
|
|
21
|
+
get_submodel_element_value,
|
|
22
|
+
get_submodel_elements,
|
|
23
|
+
get_submodel_metadata,
|
|
24
|
+
get_submodel_refs,
|
|
25
|
+
get_submodel_value,
|
|
26
|
+
get_submodels,
|
|
27
|
+
is_healthy,
|
|
28
|
+
update_shell,
|
|
29
|
+
update_submodel,
|
|
30
|
+
update_submodel_element,
|
|
31
|
+
update_submodel_element_value,
|
|
32
|
+
update_submodel_value,
|
|
33
|
+
)
|
|
34
|
+
from .clients import AsyncClient, Client
|
|
35
|
+
from .upload import upload_aas, upload_aas_folder
|
|
36
|
+
|
|
37
|
+
# Aliases for backwards compatibility
|
|
38
|
+
post_shell = create_shell
|
|
39
|
+
put_shell = update_shell
|
|
40
|
+
|
|
41
|
+
post_submodel = create_submodel
|
|
42
|
+
put_submodel = update_submodel
|
|
43
|
+
post_submodel_ref = create_submodel_ref
|
|
44
|
+
patch_submodel_value = update_submodel_value
|
|
45
|
+
|
|
46
|
+
post_submodel_element = create_submodel_element
|
|
47
|
+
put_submodel_element = update_submodel_element
|
|
48
|
+
patch_submodel_element_value = update_submodel_element_value
|
|
49
|
+
|
|
50
|
+
health = get_health_status
|