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_URLBCIC_USERNAMEBCIC_PASSWORDBCIC_AUTH_MODEBCIC_API_KEYBCIC_API_KEY_HEADERBCIC_TIMEOUTBCIC_MAX_RETRIESBCIC_RETRY_WAIT_SECONDSBCIC_OUTPUT_FORMAT
Example:
from bcic import Client
client = Client.from_env()
Public API
Client
The client exposes these domain endpoints:
client.recordsclient.usersclient.binaryclient.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:
sessionapi_key
Default values:
auth_mode="session"api_key_header="Api-Key"timeout=30.0max_retries=3retry_wait_seconds=0.5output_format="json"
Exceptions
The SDK raises a shared base exception type, bcic.exceptions.BCICError, with more specific subclasses such as:
ConfigurationErrorAuthenticationErrorAuthorizationErrorValidationErrorAPIErrorRateLimitErrorNotFoundErrorServerErrorNetworkError
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:
- Bump the version in
pyproject.toml. - Run the test suite.
- Build the package.
- Upload to TestPyPI first.
- Verify installation from TestPyPI.
- 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)
| File | Size | Uploaded | |
|---|---|---|---|
| bcic_client_api-0.1.0.tar.gz | 21.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|