Skip to main content

BCIC Client API

Python client SDK for the BCIC API.

Overview

bcic-client-api provides a typed Python interface for interacting with BCIC through:

  • session authentication
  • API key authentication
  • record operations
  • user, role, and permission queries
  • binary and lower-level REST method access

The public entry point is bcic.Client.

Requirements

  • Python 3.12+
  • A reachable BCIC tenant base URL

Installation

pip install bcic-client-api

Quick Start

Session authentication

from bcic import Client

client = Client(
    base_url="https://your-bcic-tenant.example.com",
    username="your-username",
    password="your-password",
)

client.authenticate()
try:
    records = client.records.list_all("YourViewId")
    print(records)
finally:
    client.logout()
    client.close()

API key authentication

from bcic import Client

client = Client(
    base_url="https://your-bcic-tenant.example.com",
    auth_mode="api_key",
    api_key="your-api-key",
)

result = client.methods.execute("getRoles")
print(result)
client.close()

Context manager

from bcic import Client

with Client(
    base_url="https://your-bcic-tenant.example.com",
    username="your-username",
    password="your-password",
) as client:
    client.authenticate()
    user_roles = client.users.list_roles()
    print(user_roles)

Environment Variables

Client.from_env() can build a configured client from environment values.

Supported variables:

  • BCIC_BASE_URL
  • BCIC_USERNAME
  • BCIC_PASSWORD
  • BCIC_AUTH_MODE
  • BCIC_API_KEY
  • BCIC_API_KEY_HEADER
  • BCIC_TIMEOUT
  • BCIC_MAX_RETRIES
  • BCIC_RETRY_WAIT_SECONDS
  • BCIC_OUTPUT_FORMAT

Example:

from bcic import Client

client = Client.from_env()

Public API

Client

The client exposes these domain endpoints:

  • client.records
  • client.users
  • client.binary
  • client.methods

Common lifecycle methods:

  • client.authenticate()
  • client.logout()
  • client.close()

Records

record = client.records.get("ObjectName", "RecordId")
page = client.records.get_page("ViewId", page_size=100)
items = client.records.list_all("ViewId")
created = client.records.create("ObjectName", {"Field1": "value"})
updated = client.records.update("ObjectName", "RecordId", {"Field1": "new value"})
deleted = client.records.delete("ObjectName", "RecordId")

Users

roles = client.users.list_roles()
role = client.users.get_role("RoleId")
permissions = client.users.get_permissions_by_role("RoleId", "object")
user_permissions = client.users.get_permissions_by_user("UserId", "menu", application_id="AppId")

Methods

Use client.methods.execute() for controlled lower-level REST method access when a domain-specific helper is not available.

payload = client.methods.execute("getRoles")

Configuration

The client validates configuration at construction time and raises ConfigurationError for invalid settings.

Supported authentication modes:

  • session
  • api_key

Default values:

  • auth_mode="session"
  • api_key_header="Api-Key"
  • timeout=30.0
  • max_retries=3
  • retry_wait_seconds=0.5
  • output_format="json"

Exceptions

The SDK raises a shared base exception type, bcic.exceptions.BCICError, with more specific subclasses such as:

  • ConfigurationError
  • AuthenticationError
  • AuthorizationError
  • ValidationError
  • APIError
  • RateLimitError
  • NotFoundError
  • ServerError
  • NetworkError

Development

poetry install
poetry run pytest
poetry run ruff check .
poetry run mypy bcic

Packaging

Build artifacts:

poetry build

Validate the distribution before publishing:

twine check dist/*

Publishing

Recommended release flow:

  1. Bump the version in pyproject.toml.
  2. Run the test suite.
  3. Build the package.
  4. Upload to TestPyPI first.
  5. Verify installation from TestPyPI.
  6. Upload to PyPI.

License

MIT

Release files for bcic-client-api 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bcic-client-api 0.1.0
File Size Uploaded
bcic_client_api-0.1.0.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bcic-client-api 0.1.0
File Interpreter ABI Platform
bcic_client_api-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.9 kB

Release files / bcic_client_api-0.1.0.tar.gz

Download URL bcic_client_api-0.1.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
647c01fdc4ebe571ad3b35f2a995fa5c2db157b28f5292f24c537b6bec4c86c9
BLAKE2b-256 checksum
How to use checksums
97e8e94d2067d543fb941ef94d701f909dc7fca7dec8eb7640b23d03ecd2685f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / bcic_client_api-0.1.0-py3-none-any.whl

Download URL bcic_client_api-0.1.0-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63e73038ceb70b941106a606e5ff488ffb7c8d481e22e1efb13a3af0a545d9ba
BLAKE2b-256 checksum
How to use checksums
0f5a36290539426b9ec08689463b2b89b40e0d91df8710c9c28e832063f4bb03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page