Skip to main content

Sesame HR Python SDK

Official Python SDK for the Sesame HR API. Synchronous client built on httpx with pydantic models. Python port of @sesamehr/sdk.

Install

pip install sesamehr

Requires Python 3.10+.

Quickstart

Authenticate with a private token — no OAuth required:

from sesamehr import SesameSDK

sdk = SesameSDK(
    token="your-private-token",
    region="EU1",
    company_id="your-company-id",
    employee_id="your-employee-id",
)

for employee in sdk.employees.working():
    print(employee.name, employee.work_status)

Or login with email + password (same flow the SSO uses internally — no OAuth, no redirects):

sdk = SesameSDK.login("user@company.com", "****")
sdk.checks.clock_in()

The client holds an HTTP connection pool; use it as a context manager (or call sdk.close()) in long-running apps:

with SesameSDK.login("user@company.com", "****") as sdk:
    stats = sdk.work_stats.summary("2026-06-01", "2026-06-30")
    print(stats.seconds_worked, stats.balance)

Modules

Module Description
sdk.employees List/search employees, work status, counts, me() profile with roles & permissions
sdk.checks Clock in/out, breaks, check history, hours aggregation, check requests
sdk.vacations Calendars, balances, day-off history, requests
sdk.work_stats Hours worked vs expected, balance, averages
sdk.evaluations Performance evaluations and results
sdk.documents Browse directories, list/upload/download documents
sdk.expenses Personal and company expenses, categories
sdk.announcements Company announcements
sdk.job_charges Job positions and assigned employees
sdk.recruitment Vacancies, totals, candidates
sdk.team Team status, manage checks, approve/reject requests (admin)
sdk.reports Raw BI queries against any Sesame BI table
sdk.contracts Contracts, expirations, type/status breakdowns
sdk.notifications Push notifications to the mobile app
sdk.community Wall channels, posts and comments; publish posts

All methods return pydantic models with snake_case attributes (the camelCase API fields are mapped automatically; unknown fields are kept in model_extra).

Examples

# Check history for a date range (positional from/to)
entries = sdk.checks.history("2026-06-01", "2026-06-12", employee="ana")

# Vacation balance for the current year
balances = sdk.vacations.balance_by_employee()

# Raw BI query
from sesamehr import BI_TABLES, BI_TEMPORAL

rows = sdk.reports.query({
    "from": BI_TABLES["checks"],
    "select": [
        {"field": "core_context_employee.name", "alias": "name"},
        {"field": "schedule_context_check.seconds_worked", "aggregate": "SUM", "alias": "total"},
    ],
    "where": [{"field": "schedule_context_check.date", "operation": BI_TEMPORAL["this_month"]}],
    "group_by": ["core_context_employee.name"],
})

# Publish a post with an image to a community channel
with open("photo.png", "rb") as f:
    sdk.community.create_post(
        channel_id="...",
        content="Hello from Python!",
        file=f,
        file_name="photo.png",
    )

Error handling

from sesamehr import SesameApiError, SesameConnectionError

try:
    sdk.checks.clock_in()
except SesameApiError as e:
    print(e.status, e.message, e.errors)
except SesameConnectionError as e:
    print("network problem:", e)

Requests are retried automatically (2 retries, 500 ms delay) on connection errors and 5xx responses; 4xx responses and timeouts are not retried.

Differences vs the TypeScript SDK

  • Synchronous API (no await).
  • Methods and fields are snake_case: sdk.workStats.summary() → sdk.work_stats.summary(), employee.workStatus → employee.work_status.
  • timeout is in seconds (TS uses milliseconds). Default: 30.
  • Date-range methods take from/to as positional arguments (from is a reserved word in Python): sdk.checks.history("2026-06-01", "2026-06-12").
  • OAuth helpers (fromCredentials) are not included — authenticate with a private token, SesameSDK.login(), or SesameSDK.auto_login().

Development

python -m venv .venv && source .venv/bin/activate
pip install -e . pytest
pytest

License

MIT

Metadata

Release files for sesamehr 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sesamehr 0.1.1
File Size Uploaded Provenance Actions
sesamehr-0.1.1.tar.gz 38.8 kB With provenance Details for sesamehr-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sesamehr 0.1.1
File Interpreter ABI Platform Actions
sesamehr-0.1.1-py3-none-any.whl Python 3 none any Details for sesamehr-0.1.1-py3-none-any.whl

Total release size: 78.9 kB

Release files / sesamehr-0.1.1.tar.gz

Download URL sesamehr-0.1.1.tar.gz
Size 38.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8b38d3e6d3d055963ed82e7ca8c99556cf84c34b99e859d5a85bf96e5cd53680
BLAKE2b-256 checksum
How to use checksums
eaec6ac236aef22520c13f12319f449b39ad8c069aaa1555322ec8358c2d78f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / sesamehr-0.1.1-py3-none-any.whl

Download URL sesamehr-0.1.1-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46c06cb97157bb79ea293842063966a5a8b11721f6c50ba1d89191641800e613
BLAKE2b-256 checksum
How to use checksums
cf0586b0ae9977e40e1d3f18d0565468aa9f38954595e59388fb8d716c547310
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for sesamehr 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sesamehr-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page