Skip to main content

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 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

constec-0.7.9.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

constec-0.7.9-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

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

Hashes for constec-0.7.9.tar.gz
Algorithm Hash digest
SHA256 e351b371cba8e9e5fa6ffd3f5a5aa1f0e33d7d09773c60bf632527422df28d52
MD5 13f66e69328a091b3cb5a04c598b0d96
BLAKE2b-256 198b9ee806750849a38288c118c9ab2c8268571938038eb943a5768f720008a4

See more details on using hashes here.

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

Hashes for constec-0.7.9-py3-none-any.whl
Algorithm Hash digest
SHA256 3195cf3654208336885991cf7f11332fb4e94a8b4d1e9819ae07ae062928dbaf
MD5 6e05175e7326446e530eec8942733931
BLAKE2b-256 765c3974849dc4079fc7931eb8566f83cc4330f8d77676df0f8a5aff9036eaef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page