Skip to main content

heyarchie

Python SDK and CLI for the Archie Connect API. The package gives you import heyarchie (the SDK) and the archie command (the CLI).

Install

As a library (import heyarchie) — in your project's virtualenv:

pip install heyarchie

As a CLI (the archie command) — installed isolated, on your PATH:

pipx install heyarchie     # brew install pipx first, if needed
# or, with uv:
uv tool install heyarchie

On macOS a bare pip install may hit externally-managed-environment (PEP 668), because Homebrew guards the system Python. pipx and uv manage a virtualenv for you and sidestep it.

Pre-release (built from staging, aimed at the staging API):

pip install --pre heyarchie

--pre is required and is not a formality — the pre-release channel is published as PEP 440 pre-release versions precisely so that a plain pip install heyarchie can never pick one up by accident. Pin it if you want a specific build: pip install heyarchie==2.1.0.

Which host am I talking to?

There is no default. Archie is one hostname per region and per tier, so the SDK and the CLI resolve a host and refuse if nobody named one — a baked-in default is a wrong answer that nobody is asked to confirm, and your credential goes with it.

Name it by URL, or by environment. The table has the four regions (uk, us, au, ca, each https://<name>.heyarchie.com) and staging:

archie auth login --api-url https://<your-archie-host>
archie auth login --environment uk          # -> https://uk.heyarchie.com
archie auth login --environment staging     # -> https://gcp.staging.heyarchie.com

export ARCHIE_API_URL=https://<your-archie-host>
export ARCHIE_ENVIRONMENT=uk

archie auth login saves the resolved URL to ~/.archie/credentials.toml, and every later command reuses it. Order, highest first: --api-url → --environment → ARCHIE_API_URL → ARCHIE_ENVIRONMENT → the saved profile. Every one of those is something you typed; there is no step after them.

From Python:

import heyarchie
from heyarchie.environments import api_url

archie = heyarchie.Archie(api_key="sk_...", base_url=api_url("uk"))

Names that we cannot currently stand behind are refused rather than dialled: a name that is not in the table, or one marked anything but live, raises and tells you what was measured and when. The table is heyarchie/environments.json.

Quick start

Archie serves one hostname per region, so the SDK has no default host — you name the region you belong to, either as base_url or via the ARCHIE_API_URL environment variable (the same one the archie CLI reads). If neither is set, the client raises ArchieConfigError rather than guessing.

import heyarchie

archie = heyarchie.Archie(
    api_key="sk_...",
    base_url="https://uk.heyarchie.com",   # or export ARCHIE_API_URL
    workspace_id="ws_...",                 # or export ARCHIE_WORKSPACE_ID
)
message = archie.messages.create(
    "Summarise the BAS for Q1 2026",
    client_id="client_test_growthwise",
)
print(message.content)
if message.citations:
    print(message.citations[0].standard)

A key that reaches several workspaces must name one, with workspace_id or ARCHIE_WORKSPACE_ID.

Async

import asyncio
import heyarchie

async def main():
    async with heyarchie.AsyncArchie(
        api_key="sk_...",
        base_url="https://uk.heyarchie.com",
    ) as archie:
        message = await archie.messages.create("Summarise BAS Q1 2026")
        print(message.content)

asyncio.run(main())

Documents, journal entries and reports

Each of these is a skill, so you call it as archie.skills.<name>(...). The call returns the server's reply as a dict, with the skill's result under output.

To analyse a file, upload it first and pass the returned id (a str is a path; bytes take filename= so Archie can tell the type):

up = archie.files.upload("contract.pdf")
analysis = archie.skills.analyse_document(file_id=up.file_id, analysis_type="summarize")
pack = archie.skills.prepare_cfo_pack(client_id="<client id>", period="2026-06", output_format="pdf")
entry = archie.skills.record_journal_entry(
    client_id="<client id>",
    entries=[
        {"account_code": "1000", "debit": "100.00", "credit": "0"},
        {"account_code": "4000", "debit": "0", "credit": "100.00"},
    ],
    entry_date="2026-06-30",
)
print(analysis["output"], pack["output"], entry["output"])

With AsyncArchie, await the same methods, for example up = await archie.files.upload("contract.pdf") then await archie.skills.analyse_document(file_id=up.file_id).

Search, standards and drafts

These are skills too. Each call returns the skill's reply as a dict.

found = archie.skills.search_knowledge(query="ASC 606 lease", sources=["standards"], jurisdiction="US")
research = archie.skills.research_standards(
    topic="revenue recognition",
    standard_references=["ASC 606"],
    jurisdiction="US",
    mode="research",
)
draft = archie.skills.prepare_communication(
    type="email",
    recipients=["alex@example.com"],
    subject="Q1 BAS",
    context="Remind about the BAS",
    tone="professional",
)

Configuring the endpoint

Resolution order, highest first:

  1. the base_url= argument
  2. the ARCHIE_API_URL environment variable
  3. nothing — ArchieConfigError is raised
export ARCHIE_API_URL=https://uk.heyarchie.com
archie = heyarchie.Archie(api_key="sk_...")   # host comes from the env

Calls wait up to 920 seconds by default. Pass timeout= (seconds) to Archie or AsyncArchie to change it, and catch ArchieTimeoutError.

There is deliberately no default host. A default would mean that a customer who upgrades the SDK without changing their code keeps talking to whichever region the default names — a data-residency problem that surfaces no error. Failing at construction makes that impossible.

Workspace

The server refuses a signed-in request that does not name a workspace, so every call carries X-Workspace-ID:

Archie(api_key=..., base_url=..., workspace_id="ws-1")   # or export ARCHIE_WORKSPACE_ID

With neither, the client lists your workspaces once and uses the only one. With several it raises ArchieConfigError naming them; it never guesses. The CLI does the same: archie login --workspace ws-1 saves it with the sign-in (and a single workspace is saved for you), and ARCHIE_WORKSPACE_ID outranks the saved value.

Agent-framework tools, and no streaming

skills.as_langgraph_tools(), as_openai_tools() (and heyarchie.adapters.as_langchain_tools) build tools that call /api/v1/skills with your key, name the workspace (workspace_id= or ARCHIE_WORKSPACE_ID, else your only one) and raise the typed ArchieError subclasses. Archie answers a skill or a message with one complete reply, so there is no streaming call: skills.invoke_stream is gone and messages.create(..., stream=True) raises ValueError. Workstream cycle events still stream through workstreams.stream_cycle_events.

There is no sandbox

sandbox=True raises ArchieConfigError. The sandbox playground was removed from the platform on 2026-05-06 and the concept dropped on 2026-06-03, but this SDK went on advertising it — including a docstring saying a test key meant sandbox and a live key meant live.

None of that was ever enforced. The API reads X-Archie-Env in exactly one place, where it becomes a telemetry label, and reads the key prefix nowhere at all; GET /api/v1/topics returns a byte-identical body with and without the header. So sandbox=True wrote to live data. Failing at construction is the only honest thing left to do with it.

Isolation in Archie is per workspace. Create a throwaway workspace, issue a key scoped to it, and point the SDK at that key.

Metadata

Release files for heyarchie 2.1.0

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

Source distribution (sdist)

Source distribution for heyarchie 2.1.0
File Size Uploaded Provenance Actions
heyarchie-2.1.0.tar.gz 380.7 kB With provenance Details for heyarchie-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 537.5 kB

Release files / heyarchie-2.1.0.tar.gz

Download URL heyarchie-2.1.0.tar.gz
Size 380.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d0123fd56f9a763e6b97f6c6003e0d17576effae66ad56b527fa1fe435cfe4b7
BLAKE2b-256 checksum
How to use checksums
48e0822879142733d5ddccb1073fb9afe0ff1aaf557f6fc653ab6b237eb32ace
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 Oct 22, 2026.

Transparency log

Release files / heyarchie-2.1.0-py3-none-any.whl

Download URL heyarchie-2.1.0-py3-none-any.whl
Size 156.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e7ba936149a7619520bc229cf6345e573f8b61ef8312921c801c979f10ec9c1
BLAKE2b-256 checksum
How to use checksums
30c805b6a2846a96b1a86c15668bb2b6d52249ebd694a8061a1f5d4f962f5ec5
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 Oct 22, 2026.

Transparency log

Security for heyarchie 2.1.0

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 heyarchie-2.1.0.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 Oct 22, 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

2.1.0 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