Metadata-Version: 2.4
Name: constec
Version: 0.7.6
Summary: Base library for the Constec ecosystem - shared utilities, models, and namespace foundation
License: MIT
Project-URL: Homepage, https://github.com/TpmyCT/constec-python
Project-URL: Repository, https://github.com/TpmyCT/constec-python
Project-URL: Issues, https://github.com/TpmyCT/constec-python/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Classifier: Framework :: Django :: 4.2
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: db
Requires-Dist: Django>=4.2; extra == "db"
Provides-Extra: services
Requires-Dist: cryptography>=41.0; extra == "services"
Requires-Dist: bcrypt>=4.0; extra == "services"
Provides-Extra: utils
Requires-Dist: bcrypt>=4.0; extra == "utils"
Provides-Extra: all
Requires-Dist: constec[db,services,utils]; extra == "all"
Dynamic: license-file

# Constec

Base library for the Constec ecosystem - provides shared utilities for working with Constec services.

## Installation

```bash
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:

```python
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 errors
- `ConstecAPIError` - API request failures (includes status code and response data)
- `ConstecAuthenticationError` - Authentication failures
- `ConstecNotFoundError` - Resource not found (404)
- `ConstecConnectionError` - Connection failures
- `ConstecValidationError` - Data validation errors

## Requirements

- Python 3.9 or higher

## License

MIT
