Base library for the Constec ecosystem - shared utilities, models, and namespace foundation
Project description
Constec
Base library for the Constec ecosystem - provides shared utilities for working with Constec services.
Installation
pip install constec
What is this?
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:
- constec-erp - Client for the Constec ERP API
If you're looking to interact with Constec services, install the specific client library you need instead of this base package.
Usage
This library provides exception classes for error handling when working with Constec APIs:
from constec.shared import (
ConstecError,
ConstecAPIError,
ConstecConnectionError,
ConstecValidationError,
ConstecAuthenticationError,
ConstecNotFoundError,
)
# Handle errors from Constec services
try:
# Your Constec API calls here
pass
except ConstecAuthenticationError:
print("Authentication failed - check your credentials")
except ConstecNotFoundError:
print("Resource not found")
except ConstecAPIError as e:
print(f"API error: {e.message}")
if e.status_code:
print(f"Status code: {e.status_code}")
Available Exceptions
ConstecError- Base exception for all Constec errorsConstecAPIError- API request failures (includes status code and response data)ConstecAuthenticationError- Authentication failuresConstecNotFoundError- Resource not found (404)ConstecConnectionError- Connection failuresConstecValidationError- Data validation errors
Requirements
- Python 3.9 or higher
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file constec-0.7.9.tar.gz.
File metadata
- Download URL: constec-0.7.9.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e351b371cba8e9e5fa6ffd3f5a5aa1f0e33d7d09773c60bf632527422df28d52
|
|
| MD5 |
13f66e69328a091b3cb5a04c598b0d96
|
|
| BLAKE2b-256 |
198b9ee806750849a38288c118c9ab2c8268571938038eb943a5768f720008a4
|
File details
Details for the file constec-0.7.9-py3-none-any.whl.
File metadata
- Download URL: constec-0.7.9-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3195cf3654208336885991cf7f11332fb4e94a8b4d1e9819ae07ae062928dbaf
|
|
| MD5 |
6e05175e7326446e530eec8942733931
|
|
| BLAKE2b-256 |
765c3974849dc4079fc7931eb8566f83cc4330f8d77676df0f8a5aff9036eaef
|