constec 0.1.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.
- constec-0.1.0/LICENSE +21 -0
- constec-0.1.0/PKG-INFO +84 -0
- constec-0.1.0/README.md +62 -0
- constec-0.1.0/constec/shared/__init__.py +20 -0
- constec-0.1.0/constec/shared/exceptions.py +48 -0
- constec-0.1.0/constec.egg-info/PKG-INFO +84 -0
- constec-0.1.0/constec.egg-info/SOURCES.txt +9 -0
- constec-0.1.0/constec.egg-info/dependency_links.txt +1 -0
- constec-0.1.0/constec.egg-info/top_level.txt +1 -0
- constec-0.1.0/pyproject.toml +34 -0
- constec-0.1.0/setup.cfg +4 -0
constec-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Constec
|
|
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.
|
constec-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: constec
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Base library for the Constec ecosystem - shared utilities and namespace foundation
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/TpmyCT/constec-python
|
|
7
|
+
Project-URL: Repository, https://github.com/TpmyCT/constec-python
|
|
8
|
+
Project-URL: Issues, https://github.com/TpmyCT/constec-python/issues
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# Constec
|
|
24
|
+
|
|
25
|
+
Base library for the Constec ecosystem - provides shared utilities for working with Constec services.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install constec
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What is this?
|
|
34
|
+
|
|
35
|
+
This is a foundational library that provides common utilities used across Constec client libraries. Most users will install this automatically as a dependency when installing specific Constec client packages like:
|
|
36
|
+
|
|
37
|
+
- **constec-erp** - Client for the Constec ERP API
|
|
38
|
+
|
|
39
|
+
If you're looking to interact with Constec services, install the specific client library you need instead of this base package.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
This library provides exception classes for error handling when working with Constec APIs:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from constec.shared import (
|
|
47
|
+
ConstecError,
|
|
48
|
+
ConstecAPIError,
|
|
49
|
+
ConstecConnectionError,
|
|
50
|
+
ConstecValidationError,
|
|
51
|
+
ConstecAuthenticationError,
|
|
52
|
+
ConstecNotFoundError,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Handle errors from Constec services
|
|
56
|
+
try:
|
|
57
|
+
# Your Constec API calls here
|
|
58
|
+
pass
|
|
59
|
+
except ConstecAuthenticationError:
|
|
60
|
+
print("Authentication failed - check your credentials")
|
|
61
|
+
except ConstecNotFoundError:
|
|
62
|
+
print("Resource not found")
|
|
63
|
+
except ConstecAPIError as e:
|
|
64
|
+
print(f"API error: {e.message}")
|
|
65
|
+
if e.status_code:
|
|
66
|
+
print(f"Status code: {e.status_code}")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Available Exceptions
|
|
70
|
+
|
|
71
|
+
- `ConstecError` - Base exception for all Constec errors
|
|
72
|
+
- `ConstecAPIError` - API request failures (includes status code and response data)
|
|
73
|
+
- `ConstecAuthenticationError` - Authentication failures
|
|
74
|
+
- `ConstecNotFoundError` - Resource not found (404)
|
|
75
|
+
- `ConstecConnectionError` - Connection failures
|
|
76
|
+
- `ConstecValidationError` - Data validation errors
|
|
77
|
+
|
|
78
|
+
## Requirements
|
|
79
|
+
|
|
80
|
+
- Python 3.9 or higher
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
constec-0.1.0/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Constec
|
|
2
|
+
|
|
3
|
+
Base library for the Constec ecosystem - provides shared utilities for working with Constec services.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install constec
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What is this?
|
|
12
|
+
|
|
13
|
+
This is a foundational library that provides common utilities used across Constec client libraries. Most users will install this automatically as a dependency when installing specific Constec client packages like:
|
|
14
|
+
|
|
15
|
+
- **constec-erp** - Client for the Constec ERP API
|
|
16
|
+
|
|
17
|
+
If you're looking to interact with Constec services, install the specific client library you need instead of this base package.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
This library provides exception classes for error handling when working with Constec APIs:
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from constec.shared import (
|
|
25
|
+
ConstecError,
|
|
26
|
+
ConstecAPIError,
|
|
27
|
+
ConstecConnectionError,
|
|
28
|
+
ConstecValidationError,
|
|
29
|
+
ConstecAuthenticationError,
|
|
30
|
+
ConstecNotFoundError,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Handle errors from Constec services
|
|
34
|
+
try:
|
|
35
|
+
# Your Constec API calls here
|
|
36
|
+
pass
|
|
37
|
+
except ConstecAuthenticationError:
|
|
38
|
+
print("Authentication failed - check your credentials")
|
|
39
|
+
except ConstecNotFoundError:
|
|
40
|
+
print("Resource not found")
|
|
41
|
+
except ConstecAPIError as e:
|
|
42
|
+
print(f"API error: {e.message}")
|
|
43
|
+
if e.status_code:
|
|
44
|
+
print(f"Status code: {e.status_code}")
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Available Exceptions
|
|
48
|
+
|
|
49
|
+
- `ConstecError` - Base exception for all Constec errors
|
|
50
|
+
- `ConstecAPIError` - API request failures (includes status code and response data)
|
|
51
|
+
- `ConstecAuthenticationError` - Authentication failures
|
|
52
|
+
- `ConstecNotFoundError` - Resource not found (404)
|
|
53
|
+
- `ConstecConnectionError` - Connection failures
|
|
54
|
+
- `ConstecValidationError` - Data validation errors
|
|
55
|
+
|
|
56
|
+
## Requirements
|
|
57
|
+
|
|
58
|
+
- Python 3.9 or higher
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared utilities for the Constec library ecosystem.
|
|
3
|
+
"""
|
|
4
|
+
from constec.shared.exceptions import (
|
|
5
|
+
ConstecError,
|
|
6
|
+
ConstecAPIError,
|
|
7
|
+
ConstecConnectionError,
|
|
8
|
+
ConstecValidationError,
|
|
9
|
+
ConstecAuthenticationError,
|
|
10
|
+
ConstecNotFoundError,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"ConstecError",
|
|
15
|
+
"ConstecAPIError",
|
|
16
|
+
"ConstecConnectionError",
|
|
17
|
+
"ConstecValidationError",
|
|
18
|
+
"ConstecAuthenticationError",
|
|
19
|
+
"ConstecNotFoundError",
|
|
20
|
+
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared exception classes for the Constec library ecosystem.
|
|
3
|
+
"""
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ConstecError(Exception):
|
|
8
|
+
"""Base exception for all Constec-related errors."""
|
|
9
|
+
|
|
10
|
+
def __init__(self, message: str, details: Optional[dict] = None):
|
|
11
|
+
self.message = message
|
|
12
|
+
self.details = details or {}
|
|
13
|
+
super().__init__(message)
|
|
14
|
+
|
|
15
|
+
def __str__(self):
|
|
16
|
+
if self.details:
|
|
17
|
+
return f"{self.message} (Details: {self.details})"
|
|
18
|
+
return self.message
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ConstecAPIError(ConstecError):
|
|
22
|
+
"""Raised when API requests fail."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, message: str, status_code: Optional[int] = None, response_data: Optional[dict] = None):
|
|
25
|
+
self.status_code = status_code
|
|
26
|
+
self.response_data = response_data or {}
|
|
27
|
+
details = {"status_code": status_code, "response": response_data}
|
|
28
|
+
super().__init__(message, details)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ConstecConnectionError(ConstecError):
|
|
32
|
+
"""Raised when connection to a service fails."""
|
|
33
|
+
pass
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ConstecValidationError(ConstecError):
|
|
37
|
+
"""Raised when data validation fails."""
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class ConstecAuthenticationError(ConstecAPIError):
|
|
42
|
+
"""Raised when authentication fails."""
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class ConstecNotFoundError(ConstecAPIError):
|
|
47
|
+
"""Raised when a requested resource is not found."""
|
|
48
|
+
pass
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: constec
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Base library for the Constec ecosystem - shared utilities and namespace foundation
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/TpmyCT/constec-python
|
|
7
|
+
Project-URL: Repository, https://github.com/TpmyCT/constec-python
|
|
8
|
+
Project-URL: Issues, https://github.com/TpmyCT/constec-python/issues
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# Constec
|
|
24
|
+
|
|
25
|
+
Base library for the Constec ecosystem - provides shared utilities for working with Constec services.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install constec
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What is this?
|
|
34
|
+
|
|
35
|
+
This is a foundational library that provides common utilities used across Constec client libraries. Most users will install this automatically as a dependency when installing specific Constec client packages like:
|
|
36
|
+
|
|
37
|
+
- **constec-erp** - Client for the Constec ERP API
|
|
38
|
+
|
|
39
|
+
If you're looking to interact with Constec services, install the specific client library you need instead of this base package.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
This library provides exception classes for error handling when working with Constec APIs:
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from constec.shared import (
|
|
47
|
+
ConstecError,
|
|
48
|
+
ConstecAPIError,
|
|
49
|
+
ConstecConnectionError,
|
|
50
|
+
ConstecValidationError,
|
|
51
|
+
ConstecAuthenticationError,
|
|
52
|
+
ConstecNotFoundError,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Handle errors from Constec services
|
|
56
|
+
try:
|
|
57
|
+
# Your Constec API calls here
|
|
58
|
+
pass
|
|
59
|
+
except ConstecAuthenticationError:
|
|
60
|
+
print("Authentication failed - check your credentials")
|
|
61
|
+
except ConstecNotFoundError:
|
|
62
|
+
print("Resource not found")
|
|
63
|
+
except ConstecAPIError as e:
|
|
64
|
+
print(f"API error: {e.message}")
|
|
65
|
+
if e.status_code:
|
|
66
|
+
print(f"Status code: {e.status_code}")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Available Exceptions
|
|
70
|
+
|
|
71
|
+
- `ConstecError` - Base exception for all Constec errors
|
|
72
|
+
- `ConstecAPIError` - API request failures (includes status code and response data)
|
|
73
|
+
- `ConstecAuthenticationError` - Authentication failures
|
|
74
|
+
- `ConstecNotFoundError` - Resource not found (404)
|
|
75
|
+
- `ConstecConnectionError` - Connection failures
|
|
76
|
+
- `ConstecValidationError` - Data validation errors
|
|
77
|
+
|
|
78
|
+
## Requirements
|
|
79
|
+
|
|
80
|
+
- Python 3.9 or higher
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
constec
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "constec"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Base library for the Constec ecosystem - shared utilities and namespace foundation"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 3 - Alpha",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.9",
|
|
18
|
+
"Programming Language :: Python :: 3.10",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Typing :: Typed",
|
|
22
|
+
]
|
|
23
|
+
dependencies = []
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/TpmyCT/constec-python"
|
|
27
|
+
Repository = "https://github.com/TpmyCT/constec-python"
|
|
28
|
+
Issues = "https://github.com/TpmyCT/constec-python/issues"
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.packages.find]
|
|
31
|
+
include = ["constec*"]
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.package-data]
|
|
34
|
+
constec = ["py.typed"]
|
constec-0.1.0/setup.cfg
ADDED