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.3.tar.gz (8.2 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.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: frekil-0.1.3.tar.gz
  • Upload date:
  • Size: 8.2 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.3.tar.gz
Algorithm Hash digest
SHA256 ecfcdd2a64afe88727190f7479ff26c57fe48d195b5e8d3701fcce7f849cdfb8
MD5 fc0602b33a4091d48723e962e646320b
BLAKE2b-256 d0664a2fcd632a8b17220d5d678a4be880224373bb6d88364144e0c07cdd9467

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frekil-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0dbb802b384e15ed32e559104613d8b4018b85add162eb740ffc63d7fd627ddc
MD5 1553a2ee082e70448e7de6c54e8cff68
BLAKE2b-256 e677255e1124bc049a9c32e8410f0f4d05a5a954591998ad7e8ca8dbe5912496

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