Python SDK Reference

Python Integration

Enterprise-grade Python SDK for AI-powered talent matching

Installation

pip install Snapjobs
1

Quick Setup

from Snapjobs import MatchingEngine
import os

engine = MatchingEngine(
api_key=os.getenv('Snapjobs_API_KEY'),
environment='production'
)
1
2
3
4
5
6
7

Core Features

Matching Engine

from Snapjobs import Project

project = Project(
description="Need a React Native developer",
required_skills=["React Native", "TypeScript"],
budget_range=(1000, 5000)
)

matches = engine.get_top_matches(project)
1
2
3
4
5
6
7
8
9

Skills Analysis

from Snapjobs import SkillsExtractor

extractor = SkillsExtractor()

# Extract skills from text

skills = extractor.extract_skills(
"Looking for a full-stack developer with React and Node.js"
)

# Validate specific skills

validation = extractor.validate_skills(["react", "nodejs"])
1
2
3
4
5
6
7
8
9
10
11
12
13

AI Interviews

from Snapjobs import AIInterviewer

interviewer = AIInterviewer()

# Generate interview questions

interview = interviewer.generate_interview(
project_id="p123",
required_skills=["React Native", "TypeScript"],
experience_level="senior"
)

# Evaluate responses

evaluation = interviewer.evaluate_responses(
interview_id=interview.id,
responses=candidate_responses
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Async Support

from Snapjobs import AsyncMatchingEngine
import asyncio

async def match_candidates():
engine = AsyncMatchingEngine()

  async with engine.batch() as batch:
      tasks = [
          batch.add_project(project)
          for project in projects
      ]

  results = await asyncio.gather(*tasks)
  return results
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Error Handling

from Snapjobs.exceptions import (
  SnapjobsAPIError,
  RateLimitError,
  ValidationError
)

try:
matches = engine.get_top_matches(project)
except RateLimitError as e:
print(f"Rate limit exceeded. Retry after {e.retry_after} seconds")
except ValidationError as e:
print(f"Invalid input: {e.details}")
except SnapjobsAPIError as e:
print(f"API error: {e}")
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Examples

Complete Integration Example

Try a full integration with the Python SDK

Code Editor

from Snapjobs import MatchingEngine, Project, SkillsExtractor

# Initialize components

engine = MatchingEngine()
extractor = SkillsExtractor()

# Extract skills from description

description = "Need a React Native developer with TypeScript"
skills = extractor.extract_skills(description)

# Create project

project = Project(
id="p1",
description=description,
required_skills=skills,
budget_range=(1000, 5000),
complexity="medium",
timeline=30
)

# Get matches

matches = engine.get_top_matches(project, top_n=5)

# Process results

for match in matches:
print(f"Match score: {match.score:.2f}")
print(f"Freelancer: {match.freelancer.name}")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

Output