Skip to content

Commit 735894f

Browse files
committed
Initial commit
0 parents  commit 735894f

25 files changed

Lines changed: 2930 additions & 0 deletions

.github/workflows/lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Ruff and Mypy Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Triggers on all branches but not tag push
7+
pull_request: # Triggers on all PRs
8+
9+
jobs:
10+
lint:
11+
name: Run Ruff and Mypy
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.11'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install uv
27+
uv sync --group lint
28+
29+
- name: Run Ruff
30+
run: |
31+
uv run --frozen python -m ruff check
32+
33+
- name: Run Mypy
34+
run: |
35+
uv run --frozen python -m mypy
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.11'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build twine
24+
25+
- name: Build package
26+
run: python -m build
27+
28+
- name: Publish to PyPI
29+
env:
30+
TWINE_USERNAME: __token__
31+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32+
run: |
33+
twine check dist/*
34+
twine upload dist/*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
venv/
3+
/dist/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 eXXcellent solutions
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README-pypi.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
![easyssp-logo-light](https://raw.githubusercontent.com/exxcellent/easyssp-auth-client-python/refs/heads/master/images/logo-light.png#gh-light-mode-only)
2+
3+
# 🔧 easySSP Utils
4+
5+
This module provides shared utilities for the easySSP Python clients. It contains essential functionality such as HTTP
6+
request handling, custom exceptions, logging support, and reusable helpers that streamline the integration with the
7+
easySSP APIs.
8+
9+
## ✨ Features
10+
11+
- 📦 Shared core functions for easySSP Python clients
12+
- ✅ Centralized request handling with retry and error management
13+
- 🧰 Utilities for common API-related tasks (e.g., headers, parsing)
14+
- 🚨Exception classes for consistent and transparent error reporting
15+
16+
## 📦 Installation
17+
18+
```bash
19+
pip install easyssp-utils
20+
```
21+
22+
Or clone and install from source:
23+
24+
```bash
25+
git clone https://github.com/exxcellent/easyssp-python-clients-util.git
26+
cd easyssp-python-clients-util
27+
pip install -e .
28+
```
29+
30+
## 📁 Project Structure
31+
32+
```bash
33+
easyssp_utils/
34+
├── __init__.py
35+
├── client/
36+
│ ├── __init__.py
37+
│ ├── api_client.py # Generic API client for OpenAPI client library builds
38+
│ ├── api_response.py # API response object
39+
│ ├── configuration.py # Settings of the API client
40+
│ ├── exceptions.py # Exceptions for the API client
41+
│ └── rest.py # Performing the HTTP requests
42+
43+
├── models/
44+
│ ├── __init__.py
45+
│ ├── client_localized_message.py
46+
│ ├── error_message.py
47+
│ ├── localized_error_message.py
48+
│ └── localized_message_key.py
49+
```
50+
51+
## 🛠️ Requirements
52+
53+
- Python 3.11+
54+
55+
Install dependencies using uv:
56+
57+
```bash
58+
pip install uv
59+
uv sync
60+
```
61+
62+
## 🤝 Contributing
63+
64+
This module is maintained as part of the easySSP ecosystem. If you find issues or want to suggest improvements, please
65+
open an issue or submit a pull request.
66+
67+
## 📄 License
68+
69+
This project is licensed under the MIT License.

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
![easyssp-logo-light](https://raw.githubusercontent.com/exxcellent/easyssp-auth-client-python/refs/heads/master/images/logo-light.png#gh-light-mode-only)
2+
![easyssp-logo-dark](https://raw.githubusercontent.com/exxcellent/easyssp-auth-client-python/refs/heads/master/images/logo-dark.png#gh-dark-mode-only)
3+
4+
# 🔧 easySSP Utils
5+
6+
This module provides shared utilities for the easySSP Python clients. It contains essential functionality such as HTTP
7+
request handling, custom exceptions, logging support, and reusable helpers that streamline the integration with the
8+
easySSP APIs.
9+
10+
## ✨ Features
11+
12+
- 📦 Shared core functions for easySSP Python clients
13+
- ✅ Centralized request handling with retry and error management
14+
- 🧰 Utilities for common API-related tasks (e.g., headers, parsing)
15+
- 🚨Exception classes for consistent and transparent error reporting
16+
17+
## 📦 Installation
18+
19+
```bash
20+
pip install easyssp-utils
21+
```
22+
23+
Or clone and install from source:
24+
25+
```bash
26+
git clone https://github.com/exxcellent/easyssp-python-clients-util.git
27+
cd easyssp-python-clients-util
28+
pip install -e .
29+
```
30+
31+
## 📁 Project Structure
32+
33+
```bash
34+
easyssp_utils/
35+
├── __init__.py
36+
├── client/
37+
│ ├── __init__.py
38+
│ ├── api_client.py # Generic API client for OpenAPI client library builds
39+
│ ├── api_response.py # API response object
40+
│ ├── configuration.py # Settings of the API client
41+
│ ├── exceptions.py # Exceptions for the API client
42+
│ └── rest.py # Performing the HTTP requests
43+
44+
├── models/
45+
│ ├── __init__.py
46+
│ ├── client_localized_message.py
47+
│ ├── error_message.py
48+
│ ├── localized_error_message.py
49+
│ └── localized_message_key.py
50+
```
51+
52+
## 📚 Documentation
53+
54+
Each utility module is documented inline with docstrings. For detailed usage and integration patterns, refer to the
55+
respective client documentation.
56+
57+
### Documentation for models
58+
59+
- [ClientLocalizedMessage](/docs/ClientLocalizedMessage.md)
60+
- [ErrorMessage](/docs/ErrorMessage.md)
61+
- [LocalizedErrorMessage](/docs/LocalizedErrorMessage.md)
62+
- [LocalizedMessageKey](/docs/LocalizedMessageKey.md)
63+
64+
## 🛠️ Requirements
65+
66+
- Python 3.11+
67+
68+
Install dependencies using uv:
69+
70+
```bash
71+
pip install uv
72+
uv sync
73+
```
74+
75+
## 🤝 Contributing
76+
77+
This module is maintained as part of the easySSP ecosystem. If you find issues or want to suggest improvements, please
78+
open an issue or submit a pull request.
79+
80+
## 📄 License
81+
82+
This project is licensed under the MIT License.

docs/ClientLocalizedMessage.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ClientLocalizedMessage
2+
3+
4+
## Properties
5+
6+
| Name | Type | Description | Notes |
7+
|------------|---------------------------------------------------|-------------|------------|
8+
| **key** | [**LocalizedMessageKey**](LocalizedMessageKey.md) | | [optional] |
9+
| **values** | **List[object]** | | [optional] |
10+
11+
## Example
12+
13+
```python
14+
from easyssp_utils.models.client_localized_message import ClientLocalizedMessage, LocalizedMessageKey
15+
16+
localized_message_key = LocalizedMessageKey(defaultMessage='Model not found.')
17+
client_localized_message = ClientLocalizedMessage(key=localized_message_key,
18+
values=['da0e6281-27a8-4708-8679-1abed8df20f4'])
19+
print(client_localized_message)
20+
21+
# convert the object into a dict
22+
client_localized_message_dict = client_localized_message.to_dict()
23+
# create an instance of ClientLocalizedMessage from a dict
24+
client_localized_message_from_dict = ClientLocalizedMessage.from_dict(client_localized_message_dict)
25+
```
26+
[[Back to README]](../README.md)
27+
28+

docs/ErrorMessage.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ErrorMessage
2+
3+
4+
## Properties
5+
6+
| Name | Type | Description | Notes |
7+
|-------------|---------|-------------|------------|
8+
| **code** | **int** | | [optional] |
9+
| **message** | **str** | | [optional] |
10+
| **details** | **str** | | [optional] |
11+
12+
## Example
13+
14+
```python
15+
from easyssp_utils.models import ErrorMessage
16+
17+
error_message = ErrorMessage(code=404, message='Model not found',
18+
details='Model with id da0e6281-27a8-4708-8679-1abed8df20f4 not found.')
19+
print(error_message)
20+
21+
# convert the object into a dict
22+
error_message_dict = error_message.to_dict()
23+
# create an instance of ErrorMessage from a dict
24+
error_message_from_dict = ErrorMessage.from_dict(error_message_dict)
25+
```
26+
[[Back to README]](../README.md)
27+
28+

docs/LocalizedErrorMessage.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# LocalizedErrorMessage
2+
3+
4+
## Properties
5+
6+
| Name | Type | Description | Notes |
7+
|-----------------------|---------------------------------------------------------|-------------|------------|
8+
| **code** | **int** | | [optional] |
9+
| **message** | **str** | | [optional] |
10+
| **details** | **str** | | [optional] |
11+
| **localized_message** | [**ClientLocalizedMessage**](ClientLocalizedMessage.md) | | [optional] |
12+
13+
## Example
14+
15+
```python
16+
from easyssp_utils.models.localized_error_message import LocalizedErrorMessage
17+
from easyssp_utils.models import LocalizedMessageKey
18+
from easyssp_utils.models.client_localized_message import ClientLocalizedMessage
19+
20+
localized_message_key = LocalizedMessageKey(defaultMessage='Model not found.')
21+
client_localized_message = ClientLocalizedMessage(key=localized_message_key,
22+
values=['da0e6281-27a8-4708-8679-1abed8df20f4'])
23+
localized_error_message = LocalizedErrorMessage(code=404, message='Model not found',
24+
details='Model with id da0e6281-27a8-4708-8679-1abed8df20f4 not found.',
25+
localizedMessage=client_localized_message)
26+
print(localized_error_message)
27+
28+
# convert the object into a dict
29+
localized_error_message_dict = localized_error_message.to_dict()
30+
# create an instance of LocalizedErrorMessage from a dict
31+
localized_error_message_from_dict = LocalizedErrorMessage.from_dict(localized_error_message_dict)
32+
```
33+
[[Back to README]](../README.md)
34+
35+

docs/LocalizedMessageKey.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# LocalizedMessageKey
2+
3+
4+
## Properties
5+
6+
| Name | Type | Description | Notes |
7+
|---------------------|---------|-------------|------------|
8+
| **default_message** | **str** | | [optional] |
9+
10+
## Example
11+
12+
```python
13+
from easyssp_utils.models import LocalizedMessageKey
14+
15+
localized_message_key = LocalizedMessageKey(defaultMessage='Model not found.')
16+
print(localized_message_key)
17+
18+
# convert the object into a dict
19+
localized_message_key_dict = localized_message_key.to_dict()
20+
# create an instance of LocalizedMessageKey from a dict
21+
localized_message_key_from_dict = LocalizedMessageKey.from_dict(localized_message_key_dict)
22+
```
23+
[[Back to README]](../README.md)
24+
25+

0 commit comments

Comments
 (0)