### Install Rossum API Package Source: https://github.com/rossumai/rossum-sdk/blob/main/README.md Installs the rossum-api package from a Git repository using pip. This is the recommended way to get started with the library. ```bash pip install git+https://github.com/rossumai/rossum-sdk#egg=rossum-api ``` -------------------------------- ### Development Environment Setup Source: https://github.com/rossumai/rossum-sdk/blob/main/README.md Commands to set up a development environment for the Rossum SDK using a Makefile. Includes creating a virtual environment and installing project dependencies. ```bash make .venv # Creates virtualenv in .venv folder make install # Installs all project dependencies including test ones ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/rossumai/rossum-sdk/blob/main/CONTRIBUTING.md These commands install the pre-commit framework and its hooks. Pre-commit helps maintain code style and quality before committing. ```bash pre-commit install pre-commit install-hooks ``` -------------------------------- ### Run Specific Tests with Pytest Source: https://github.com/rossumai/rossum-sdk/blob/main/CONTRIBUTING.md This demonstrates how to manually set up the environment and run specific tests using Pytest. It includes creating a virtual environment, activating it, installing the SDK and test dependencies, and then running Pytest. ```bash cd rossum-sdk # create virtual environment python -m venv .env # activate virtual environment source .env/bin/activate # install sentry-python pip install -e . # install requirements pip install -e ."[tests]" # run tests pytest tests/ ``` -------------------------------- ### Install Rossum SDK in Editable Mode Source: https://github.com/rossumai/rossum-sdk/blob/main/CONTRIBUTING.md This command installs the 'rossum-sdk' package in editable mode, allowing changes in the source code to be reflected immediately without reinstallation. ```bash pip install -e . ``` -------------------------------- ### Clone the Rossum SDK Repository Source: https://github.com/rossumai/rossum-sdk/blob/main/CONTRIBUTING.md This command clones the Rossum SDK repository from GitHub. Ensure you have Git installed and configured. ```bash git clone git@github.com:rossumai/rossum-sdk.git ``` -------------------------------- ### Sync Rossum API Client Usage Source: https://github.com/rossumai/rossum-sdk/blob/main/README.md Demonstrates how to use the synchronous client to interact with the Rossum API. It covers creating, retrieving, listing, and deleting workspaces. Requires environment variables ELIS_USERNAME and ELIS_PASSWORD for authentication. ```python import os from rossum_api import SyncRossumAPIClient from rossum_api.dtos import UserCredentials WORKSPACE = { "name": "Rossum Client NG Test", "organization": "https://elis.rossum.ai/api/v1/organizations/116390", } def main_with_sync_client(): client = SyncRossumAPIClient( base_url="https://elis.rossum.ai/api/v1", credentials=UserCredentials(os.environ["ELIS_USERNAME"], os.environ["ELIS_PASSWORD"]), ) ws = client.create_new_workspace(data=WORKSPACE) workspace_id = ws.id ws = client.retrieve_workspace(workspace_id) print("GET result:", ws) print("LIST results:") for w in client.list_workspaces(ordering=["-id"], name=WORKSPACE["name"]): print(w) client.delete_workspace(workspace_id) print(f"Workspace {workspace_id} deleted.") main_with_sync_client() ``` -------------------------------- ### Async Rossum API Client Usage Source: https://github.com/rossumai/rossum-sdk/blob/main/README.md Demonstrates how to use the asynchronous client to interact with the Rossum API. It covers creating, retrieving, listing, and deleting workspaces. Requires environment variables ELIS_USERNAME and ELIS_PASSWORD for authentication. ```python import os import asyncio from rossum_api import AsyncRossumAPIClient from rossum_api.dtos import UserCredentials WORKSPACE = { "name": "Rossum Client NG Test", "organization": "https://elis.rossum.ai/api/v1/organizations/116390", } async def main_with_async_client(): client = AsyncRossumAPIClient( base_url="https://elis.rossum.ai/api/v1", credentials=UserCredentials(os.environ["ELIS_USERNAME"], os.environ["ELIS_PASSWORD"]), ) ws = await client.create_new_workspace(data=WORKSPACE) workspace_id = ws.id ws = await client.retrieve_workspace(workspace_id) print("GET result:", ws) print("LIST results:") async for w in client.list_workspaces(ordering=["-id"], name=WORKSPACE["name"]): print(w) await client.delete_workspace(workspace_id) print(f"Workspace {workspace_id} deleted.") asyncio.run(main_with_async_client()) ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/rossumai/rossum-sdk/blob/main/CONTRIBUTING.md These commands create a Python virtual environment named '.env' and activate it. This isolates project dependencies. ```bash cd rossum-sdk python -m venv .env source .env/bin/activate ``` -------------------------------- ### Run Tests with Make Source: https://github.com/rossumai/rossum-sdk/blob/main/CONTRIBUTING.md This command uses the Makefile to run the entire test suite using Tox, which executes tests across multiple Python 3 versions. ```bash cd rossum-sdk make test ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.