Skip to main content

Enterprise as a Service Library

Project description

szn-libeaas

Enterprise as a Service (EaaS) Python Client Library - Version 3.0.1

Overview

The szn-libeaas library provides a Python client for interacting with the Enterprise as a Service API. It offers a clean, intuitive interface for managing enterprise resources through a RESTful API.

Installation

You can install the package via pip:

pip install szn-libeaas

Quick Start

from szn_libeaas import Client

# Initialize the client
client = Client(api_key='your_api_key')

# Get a list of projects
projects = client.projects.list()

# Create a new user
new_user = client.users.create({
    'name': 'John Doe',
    'email': 'john.doe@example.com',
    'role': 'admin'
})

# Get analytics data
analytics = client.analytics.get_usage(
    start_date='2025-01-01',
    end_date='2025-03-31'
)

Features

  • Comprehensive API coverage for all EaaS endpoints
  • Automatic authentication and token management
  • Convenient resource managers for users, projects, tasks, and documents
  • Configurable retry handling and error management
  • Support for environment-based configuration
  • Detailed logging and debugging options

Documentation

For detailed documentation, please visit https://szn-libeaas.readthedocs.io

Authentication

The library supports authentication via API key:

from szn_libeaas import Client

# Authentication via API key
client = Client(api_key='your_api_key')

# Custom configuration
client = Client(
    api_key='your_api_key',
    base_url='https://api.custom-domain.com/v3',
    timeout=60,
    verify_ssl=True,
    debug=True
)

You can also configure the client using environment variables:

export SZN_LIBEAAS_API_KEY='your_api_key'
export SZN_LIBEAAS_BASE_URL='https://api.custom-domain.com/v3'

Resource Examples

Working with Users

# List users with pagination
users = client.users.list(page=2, per_page=50)

# Get a specific user
user = client.users.get('user-123')

# Create a new user
new_user = client.users.create({
    'name': 'Jane Smith',
    'email': 'jane.smith@example.com',
    'department': 'Engineering'
})

# Update a user
updated_user = client.users.update('user-123', {
    'role': 'administrator'
})

# Delete a user
client.users.delete('user-123')

Working with Projects

# List all projects
projects = client.projects.list()

# Get a specific project
project = client.projects.get('project-456')

# Create a new project
new_project = client.projects.create({
    'name': 'New Product Launch',
    'description': 'Planning for Q2 product launch',
    'status': 'active'
})

Analytics

# Get usage statistics
usage = client.analytics.get_usage(
    start_date='2025-01-01',
    end_date='2025-03-31'
)

# Get summary report
summary = client.analytics.get_summary(period='month')

Error Handling

from szn_libeaas import Client, APIError

client = Client(api_key='your_api_key')

try:
    result = client.users.get('nonexistent-user')
except APIError as e:
    print(f"API Error ({e.status_code}): {e.message}")
    print(f"Request ID: {e.request_id}")

Configuration Options

The client can be configured using various options:

client = Client(
    api_key='your_api_key',          # API key for authentication
    base_url='https://custom.api',   # Custom API base URL
    timeout=30,                      # Request timeout in seconds
    verify_ssl=True,                 # Verify SSL certificates
    debug=False,                     # Enable debug logging
    retries=3,                       # Number of retries for failed requests
    config_file='~/config.ini'       # Path to configuration file
)

License

This library is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

szn_libeaas-3.0.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

szn_libeaas-3.0.1-py2.py3-none-any.whl (15.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file szn_libeaas-3.0.1.tar.gz.

File metadata

  • Download URL: szn_libeaas-3.0.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for szn_libeaas-3.0.1.tar.gz
Algorithm Hash digest
SHA256 91d9f5c1aadbcefe544d5549163116aaca7766e6dd58477f886326e1cda47ec0
MD5 4ebe2f97b69cb999f2e34c05114f734f
BLAKE2b-256 6c063eee5324ec048f37049f0870c0b7b95c0c7b97ca1db73bad535721ca5883

See more details on using hashes here.

File details

Details for the file szn_libeaas-3.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: szn_libeaas-3.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for szn_libeaas-3.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bd5d4ff10998484f4dc185993aec4e55b735e9e655bc229038b65bac41a1d9b1
MD5 774a957c1954573b56000b449f5cae7e
BLAKE2b-256 557c4b6a1d262c939e46603242f1346584972002cff0f2436d6910b31493cf3e

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