Metadata-Version: 2.5
Name: worklittle
Version: 1.3.0
Summary: Official Worklittle Python SDK and CLI for job search on api.worklittle.com
Project-URL: Homepage, https://docs.worklittle.com/libraries/sdk#python
Project-URL: Documentation, https://docs.worklittle.com/libraries/overview
Author: Worklittle
License-Expression: MIT
Keywords: api,ats,cli,job search,jobs,sdk,worklittle
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# worklittle

Python SDK and CLI for [api.worklittle.com](https://api.worklittle.com).
Worklittle is the job search and hiring API for jobs, applications, and organizations.

Get started at [docs.worklittle.com](https://docs.worklittle.com/libraries/sdk#python)!

[Create a key on Business](https://worklittle.com/business/api-keys).

## Install

```bash
pip install worklittle
```

```python
from worklittle import Worklittle

wl = Worklittle()
jobs = wl.jobs.search(q="software engineer", limit=5)
filtered = wl.jobs.search(
    title="software engineer, -senior",
    company="-lucid-motors,-tesla",
    limit=5,
)
```

## CLI

```bash
export WORKLITTLE_API_KEY=sk-wl-api01-...
worklittle jobs search --q="software engineer" --limit 1 --pretty
worklittle jobs search --title="software engineer, -senior" --company="-lucid-motors,-tesla" --limit 5 --pretty
```

`--company` accepts bare slugs (include) or leading-dash slugs (exclude). Title negatives use `--title` / `--q`. Add `--remote` for remote-only jobs. Other `GET /jobs` flags pass through the same way (`--workplace_type=…`, `--posted_within_days=…`). API search only returns jobs you can apply to.

[Create a key on Business](https://worklittle.com/business/api-keys). Prefer `WORKLITTLE_API_KEY` over `--api-key`. Without either, the CLI uses the active login saved by the Homebrew/npm CLI's `worklittle login` (`--account <email|org>` picks another).

CLI output is JSON on stdout by default.

Editable install from this repo:

```bash
cd packages/sdk-python
pip install -e .
```

## Apply

Start with a free practice run (no real submission, no charge), then apply for real:

```python
# 1. Practice run
test = wl.apply.apply_with_ai(test=True)
print(wl.apply.wait_for_application(test["session_id"]))

# 2. Find a job (API search only returns jobs you can apply to)
jobs = wl.jobs.search(q="nurse", remote=True, limit=5)

# 3. Apply as you (uses your Worklittle profile + resume)
started = wl.apply.apply_with_ai(job_id=jobs["data"][0]["id"])

# 4. Wait until completed, failed, stopped, cancelled, awaiting_input, or awaiting_submit
done = wl.apply.wait_for_application(started["session_id"], interval=10)
```

If a session stops at `awaiting_input`, answer `session.stuck_questions` with
`wl.apply.continue_session(id, {key: "answer"})`.

Optional extras:

- **Apply for someone else**: `use_profile=False` with `applicant={"name": …, "email": …}` and a resume (`resume_file=resume_file_from_path("./resume.pdf")`). Reuse them later with `applicant_id`; manage with `wl.applicants.list/get/update/replace_resume/delete`.
- **Batch**: `wl.apply.batch(["…", "…"])` (max 10) returns `results`, `started`, `already_applied`, `failed`.
- **Review before submit**: `auto_submit=False`, then `wl.apply.approve_submit(id)`. Also `steer`, `stop`, `active`.
- **Retries**: `wl.apply.apply_with_ai(job_id=…, idempotency_key="…")`.
- **Settings**: `wl.apply_settings.get()` / `update(auto_apply=…, auto_submit=…, tailor_resume=…)` (402 `AUTO_APPLY_REQUIRES_PLAN` when auto-apply needs a plan).
- **Profile and resumes**: `wl.profile.get/update`, `wl.resumes.list/add/add_from_path/download/delete`.
- **Applications**: `wl.applications.list(status="pending")`; items include `outcome` (`interview` | `offer` | `rejected` | `None`) and `cost_usd`.
- **Webhooks**: pass `webhook_url`. Events are `apply.session.<status>` and `apply.outcome.<interview|offer|rejected>`. Get the secret from `wl.apply.webhook_secret()` and check the `Worklittle-Webhook-Signature` (`v1=<hex>` HMAC-SHA256 of `<timestamp>.<raw body>`) and `Worklittle-Webhook-Timestamp` headers with `verify_webhook_signature`.

```bash
worklittle apply test
worklittle apply start --job JOB_ID --wait
worklittle apply start --jobs ID1,ID2 --applicant-name "Ana Diaz" --applicant-email ana@example.com --resume ./ana.pdf
worklittle apply start --job JOB_ID --review   # then: worklittle apply approve SESSION_ID
worklittle apply status SESSION_ID --wait
worklittle applications --status pending
worklittle applicants list
worklittle settings set --auto-submit off --tailor-resume on
worklittle resumes add ./resume.pdf
worklittle profile set city=Austin needs_sponsorship=false
```

## Capabilities

- `wl.jobs` — job search, detail, map, and salary averages
- `wl.companies` / `wl.stats` — company search and market stats
- `wl.apply` / `wl.applied_jobs` — apply, Apply with AI, and applied-job tracking
- `wl.applications` / `wl.applicants` / `wl.apply_settings` / `wl.profile` — Apply with AI history, people you apply for, settings, and your profile
- `wl.resumes` / `wl.cover_letters` — generate resumes and cover letters
- `wl.boards` — public job boards and board apply
- `wl.job_listings` / `wl.employer_jobs` — post and manage employer jobs
- `wl.candidates` / `wl.employees` / `wl.organization` — hiring and org
- `wl.webhooks` / `wl.documents` / `wl.attendance` / `wl.surveys` — Business ops
- `wl.usage` / `wl.billing` / `wl.limits` — usage, billing, and rate limits
- `worklittle` CLI — the same API from the terminal

## Docs

- [SDK](https://docs.worklittle.com/libraries/sdk#python)
- [CLI](https://docs.worklittle.com/libraries/cli)
- [OpenAPI](https://docs.worklittle.com/openapi/openapi.yaml)
- [Worklittle](https://worklittle.com)
