An unofficial Python SDK for the HiBob HR API
Project description
🐍 PyBob SDK
📦 Installation
# Using uv
uv add pybob-sdk
# Using pip
pip install pybob-sdk
🚀 Quick Start
1. Set up credentials
export BOB_SERVICE_ACCOUNT_ID="your_service_account_id"
export BOB_SERVICE_ACCOUNT_TOKEN="your_service_account_token"
Or create a .env file:
BOB_SERVICE_ACCOUNT_ID=your_id
BOB_SERVICE_ACCOUNT_TOKEN=your_token
2. Use the SDK
import asyncio
from pybob_sdk import Bob
async def main():
async with Bob() as bob:
# Search for employees
results = await bob.people.search(
fields=["root.id", "root.fullName", "root.email"],
filters=[{
"fieldPath": "root.email",
"operator": "equals",
"values": ["anakin.skywalker@company.com"]
}]
)
for employee in results.employees:
print(f"{employee.full_name} - {employee.email}")
asyncio.run(main())
🔐 Authentication
The SDK supports multiple authentication methods:
Credentials are automatically loaded from environment variables or .env files:
from pybob_sdk import Bob
async with Bob() as bob:
...
Alternatively explicit credentials:
bob = Bob(
service_account_id="YOUR_ID",
service_account_token="YOUR_TOKEN",
)
📚 API Reference
👥 People API
# Search employees
results = await bob.people.search(
fields=["root.id", "root.fullName", "root.email"],
filters=[{
"fieldPath": "root.department",
"operator": "equals",
"values": ["Engineering"]
}]
)
# Get public profiles
profiles = await bob.people.get_public_profiles()
# Get employee by ID
employee = await bob.people.get("123456789")
📊 Employee Tables API
# Get employment history
history = await bob.employee_tables.get_employment_history("123456789")
for entry in history:
if entry.working_pattern and entry.working_pattern.days:
days = entry.working_pattern.days
print(f"Monday: {days.monday} hours")
# Get work history
work_history = await bob.employee_tables.get_work_history("123456789")
🏖️ Time Off API
# Get who's out today
out_today = await bob.time_off.get_whos_out_today()
for person in out_today:
print(f"{person.name} - {person.policy_type}")
# Get policy types
policy_types = await bob.time_off.get_policy_types()
✅ Tasks API
# Get all open tasks
tasks = await bob.tasks.get_open_tasks()
# Get employee tasks
employee_tasks = await bob.tasks.get_employee_tasks("123456789")
# Complete a task
await bob.tasks.complete_task("task_123")
📈 Reports API
# Get all reports
reports = await bob.reports.get_reports()
# Download a report
data = await bob.reports.download_report_by_id("report_123")
🎯 Onboarding API
# Get onboarding wizards
wizards = await bob.onboarding.get_wizards()
for wizard in wizards:
print(f"{wizard.name} (ID: {wizard.id})")
📋 Metadata API
# Get employee fields
fields = await bob.metadata.get_fields()
# Get company lists
lists = await bob.metadata.get_lists()
# Get specific list
departments = await bob.metadata.get_list("department")
💼 Job Catalog API
# Get job roles
roles = await bob.job_catalog.get_roles()
# Get job families
families = await bob.job_catalog.get_families()
# Search job profiles
profiles = await bob.job_catalog.search_profiles()
🛠️ Development
Setup
git clone https://github.com/kurtismassey/pybob.git
cd pybob
uv sync --all-extras
Code Quality
# Linting
ruff check .
# Formatting
ruff format .
# Type checking
mypy pybob_sdk
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pybob_sdk-1.0.0.tar.gz
(49.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pybob_sdk-1.0.0-py3-none-any.whl
(43.1 kB
view details)
File details
Details for the file pybob_sdk-1.0.0.tar.gz.
File metadata
- Download URL: pybob_sdk-1.0.0.tar.gz
- Upload date:
- Size: 49.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f313f4be9f3f461983634dd69ed6921908cc092cf056f47350c429ad5198d84f
|
|
| MD5 |
33897c071180e0c9eb54beb1990915a6
|
|
| BLAKE2b-256 |
0ae28e0283660583b7d5b0c84762531258538e675c8ccf1de28b158e4dd343f1
|
File details
Details for the file pybob_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pybob_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 43.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad0e37ae7dd1b3f2b849ff78bf31ae45d9eb8f7e5c227286caa4ed119de3d68f
|
|
| MD5 |
cd71bb65ba10d260fb4d345258f841c0
|
|
| BLAKE2b-256 |
6cb6af6b02c409a5973d017107eb684f8ca0c79b5bd4a11da93cee907c9f3d97
|