# Python SDK

> The archee modules available inside execute, with their main functions.

Source: https://docs.archee.studio/mcp/sdk

Inside `execute`, `import archee` gives the modules below. This page lists the main functions; `search` returns the full signature, units and docstring of each one, and is always current.

## calc

Cited engineering calculations. Each result carries its values, checks and the textbook sources behind them.

| Function | Does |
| --- | --- |
| `calc.list()` | Every calculation available |
| `calc.describe(name)` | Inputs, units and outputs of one calculation |
| `calc.run(name, **inputs)` | Run a calculation by name, for example `"vbelt"` |
| `calc.run_bearing_rolling(...)`, `calc.run_belt_life(...)`, … | Typed shortcuts for individual calculations |

## standards

Catalogue lookups.

| Function | Does |
| --- | --- |
| `standards.lookup_bearing(d, kind, series)` | A rolling bearing for a bore |
| `standards.list_bearings(d, kind)` | Every bearing that fits a bore |
| `standards.lookup_key(shaft_d)` | The parallel key for a shaft diameter |
| `standards.lookup_fastener(nominal_d)` | Bolt and nut dimensions, for example `"M12"` |
| `standards.housing_proportions(a_w)` | Gearbox housing proportions from the centre distance |

## draft

DXF and DWG drawings.

| Function | Does |
| --- | --- |
| `draft.inspect(drawing, …)` | Entities, layers and blocks, paged |
| `draft.render(drawing, output, …)` | A PNG of the drawing or a region of it |
| `draft.check(drawing, design, kind)` | Drawing findings against the design record |
| `draft.convert(to, input, output)` | DXF ↔ DWG |
| `draft.detail(design, out_dir, part_type)` | A shaft or gear detail drawing from the design |
| `draft.build(...)`, `draft.edit(...)` | Build or change drawings with a builder script |

## kb

The Knowledge Base of engineering textbooks and standards.

| Function | Does |
| --- | --- |
| `kb.search(query, limit)` | Passages with their source, printed page and score |
| `kb.page(source, page)` | One page of a source |

## verify and deliver

| Function | Does |
| --- | --- |
| `verify.check(path, standard="TCVN")` | TCVN findings for a drawing |
| `deliver.package(kind)` | A submit-ready `a0_assembly`, `a3_detail` or `report` package |

## files and project

| Function | Does |
| --- | --- |
| `files.upload(name, data)` | Store bytes or text in the project |
| `files.list(prefix)` | Files with size and SHA-256 |
| `files.link(path)` | A signed download link that expires |
| `project.info()` | The current project |
| `project.design(path)` | The design record, or one value in it |
| `project.design_set(path, value, expected_revision)` | Change one design value safely |

## agent and runs

| Function | Does |
| --- | --- |
| `agent.run(prompt)` | Hand long work to Archee's agent; returns a run id |
| `runs.get(run_id)` | The state and output of a run |

## errors

Every SDK error derives from `archee.errors.ArcheeError`:

| Error | When |
| --- | --- |
| `BudgetExceeded` | The program spent its credit allowance |
| `ScopeDenied` | The connection lacks a scope the call needs |
| `PlanDenied` | Your plan does not include the feature |
| `NotFound`, `Invalid` | A missing file or a bad argument |
| `Unavailable`, `BridgeTimeout` | A service was busy or slow; retry |
| `Internal` | Something failed on Archee's side; quote the `call_id` |
