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.1.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.

semantik_sdk-0.1.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: semantik_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 8.6 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.1.tar.gz
Algorithm Hash digest
SHA256 e1c4bf1e2f66d73169525945405983c26703ccaf79b0e3d26a36ab5ca010d45e
MD5 0d84735f7e28123f7b0cb6fef971dc56
BLAKE2b-256 d822f37a34b16634f955501a5adf48964f2ae96a5ea7adecaf49bf21402a0eff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: semantik_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e2ba1c70ce2ae9dd28791aabc4dfee28959338857c953fb19c1835d1043b6a6
MD5 81e86ed33dc600055edbe8edbf6da5fb
BLAKE2b-256 a5d1829c97a5056dcf5eae0c03961ecd93ab6a3ef8b3bbbafebd333f9b7c5467

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