Skip to main content

Official Python SDK for Frekil API

Project description

Frekil SDK

The official Python SDK for the Frekil API.

Installation

pip install frekil

Usage

Authentication

To use the SDK, you'll need an API key from your Frekil account:

from frekil import FrekilClient

# Initialize the client with your API key
client = FrekilClient(api_key="your-api-key")

Working with Projects

List Projects

# Get all projects the authenticated user has access to
projects = client.projects.list()
print(projects)

Get Project Membership

# Get membership details for a specific project
project_id = "project-uuid"
memberships = client.projects.get_membership(project_id)
print(memberships)

Bulk Allocate Images

# Allocate images to specific annotators and reviewers
project_id = "project-uuid"
allocations = [
    {
        "image_key": "image1.jpg",
        "annotators": ["annotator1@example.com", "annotator2@example.com"],
        "reviewers": ["reviewer1@example.com", "reviewer2@example.com"]
    },
    {
        "image_key": "image2.jpg",
        "annotators": ["annotator1@example.com"],
        "reviewers": ["reviewer1@example.com"]
    }
]

result = client.projects.bulk_allocate_images(
    project_id=project_id,
    allocations=allocations,
    override_existing_work=False  # Set to True to override existing work
)
print(result)

Error Handling

The SDK uses custom exception classes to handle API errors:

from frekil.exceptions import FrekilAPIError, FrekilClientError

try:
    projects = client.projects.list()
except FrekilClientError as e:
    # Handle client errors (e.g., authentication issues, invalid parameters)
    print(f"Client error: {e} (Status: {e.status_code})")
    print(f"Error details: {e.error_details}")
except FrekilAPIError as e:
    # Handle API errors (e.g., server issues)
    print(f"API error: {e} (Status: {e.status_code})")
    print(f"Error details: {e.error_details}")

Development

Setup

# Clone the repository
git clone https://github.com/notatehq/frekil-python-sdk.git
cd frekil-python-sdk

# Install dependencies
pip install -e ".[dev]"

Testing

pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

frekil-0.1.5.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

frekil-0.1.5-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file frekil-0.1.5.tar.gz.

File metadata

  • Download URL: frekil-0.1.5.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for frekil-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e67adbb454be9fbfafa360d52aea84a84a3387a0545645d42d9e15ab9296f095
MD5 db25ca6aeb0513a78a0e8ebf3b973335
BLAKE2b-256 d5dcbd9edea1670fd8972f0608b902c012b39ff623e9d2684dc5c8c58888ee01

See more details on using hashes here.

File details

Details for the file frekil-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: frekil-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for frekil-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 391a0a19f8e082d1154157127cb5e669d2ffab219e9c8768bc0d8e63aa9ca46d
MD5 e72e1c17e5b1058508d86c5bc12a74a3
BLAKE2b-256 e59e29aa1edc51bad7ee6f295374c3d7fa0c3804172bc478f577eedbc28edecd

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