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.4.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.4-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: frekil-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 ee690153526b4ef0467ba3051fbac23389bd3ceee6c182523d024f613efff3bb
MD5 6abe44445d305119bf28dfd70c58c170
BLAKE2b-256 b17318e5af2fddfa1a9c55c090c50a79671f018fa68b54635f6632147c208146

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frekil-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c98c5c96e5f3b14f3f44f46de1ba4aea5f1234b12e310a92a64729c3bfcd660d
MD5 bfe010f25d6e5372c6c8711516dec178
BLAKE2b-256 9b0a40eabb282fe567f96f0698154d97e93392830d2e41abd57734a0b7124d3c

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