Skip to main content

Python SDK for the Semantik Client API

Project description

Semantik Python SDK

Python SDK for the Semantik Client API. Designed for Python 3.8+ applications.

Installation

pip install semantik-sdk
# or with uv:
uv pip install semantik-sdk

Quick Start

from semantik import Semantik
import base64

# Automatically reads from SEMANTIK_API_KEY environment variable (recommended)
# Set SEMANTIK_API_KEY in your .env file or environment
client = Semantik()

# Or override with explicit API key
client = Semantik(api_key="sk_your_api_key_here")

# List programs
programs_response = client.programs.list()
print(f"Found {len(programs_response['programs'])} programs")

# Get a specific program
program = client.programs.get(programs_response['programs'][0]['id'])

# Submit a candidate application
with open('resume.pdf', 'rb') as f:
    cv_content = base64.b64encode(f.read()).decode('utf-8')

result = client.candidates.submit_application(
    candidate={
        "firstName": "John",
        "lastName": "Doe",
        "email": "john.doe@example.com"
    },
    program_id=program['id'],
    step_id=program['steps'][0]['id'],
    documents=[
        {
            "fieldName": "CV",
            "content": cv_content,
            "fileName": "john-doe-cv.pdf",
            "mimeType": "application/pdf",
            "encoding": "base64"
        }
    ]
)

print(f"Application submitted: {result['applicationId']}")
print(f"Candidate ID: {result['candidateId']}")

# Get candidate status
status = client.candidates.get_status(result['candidateId'], include="applications,scores")
print(f"Candidate: {status['candidate']['firstName']} {status['candidate']['lastName']}")

# Move candidate to next step
move_result = client.programs.move_candidate(
    program_id=program['id'],
    candidate_id=result['candidateId'],
    direction="next"
)
print(f"Moved from {move_result['movement']['from']['name']} to {move_result['movement']['to']['name']}")

Configuration

API Key

Set your API key as an environment variable (recommended):

export SEMANTIK_API_KEY=sk_your_api_key_here

Or pass it directly to the client:

client = Semantik(api_key="sk_your_api_key_here")

Base URL

The SDK defaults to production (https://gateway.semantikmatch.com). For local development:

client = Semantik(
    api_key="sk_...",
    base_url="http://localhost:9000"
)

Or set SEMANTIK_BASE_URL environment variable.

API Reference

Programs

  • client.programs.list() - List all programs
  • client.programs.get(program_id) - Get a specific program
  • client.programs.list_candidates(program_id, step_id=None, status=None, search=None, include=None, limit=None, cursor=None) - List candidates in a program
  • client.programs.move_candidate(program_id, candidate_id, direction="next"|"previous", from_step_id=None, to_step_id=None) - Move a candidate between steps

Candidates

  • client.candidates.submit_application(candidate, program_id, step_id, client_data=None, documents=None) - Submit a new application
  • client.candidates.get_status(candidate_id, include=None) - Get candidate status across all programs
  • client.candidates.get_applications(candidate_id, include=None) - Get all applications for a candidate
  • client.candidates.get_scores(candidate_id, include=None) - Get candidate scores
  • client.candidates.enroll(candidate_id, program_id, step_id=None, send_email=None, email_template=None) - Enroll candidate in a program

Error Handling

from semantik import Semantik, ApiError

try:
    program = client.programs.get(999)
except ApiError as e:
    print(f"API Error {e.status}: {e}")
    print(f"Path: {e.path}")
    print(f"Response: {e.response}")
except Exception as e:
    print(f"Unexpected error: {e}")

Type Hints

The SDK includes full type hints for better IDE support and type checking.

Support

For issues or questions, please contact support or visit the documentation.

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

semantik_sdk-0.1.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

semantik_sdk-0.1.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file semantik_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: semantik_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for semantik_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 35e74f1e9db92e264f126c1771bd0980f22de3c8f10f6232e79f201a8eb68926
MD5 f274900263d7e64cf87ffbf35015e30f
BLAKE2b-256 6f4b97a5398d8ea07915188e2ce6db5406476812dacb151d4600b6e1d48ebe6d

See more details on using hashes here.

File details

Details for the file semantik_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: semantik_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for semantik_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d9c83654a2e772c4de1b18b1da38901d45fb93b19d691682553ab3bd5e58979
MD5 fbb6e67c4857b96545023a3c1871fee7
BLAKE2b-256 61aa657e724b14e1a90dbebd0d81316d4e8e564d96f4b3cff66b25e7db7d4566

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