Skip to main content

Official Python client for the Mímir Knowledge Graph API

Project description

mimir-client

Official Python client for the Mímir Knowledge Graph API.

Installation

pip install mimir-client

Quick Start

import asyncio
from mimir_client import MimirClient

async def main():
    async with MimirClient(base_url="http://localhost:38000", tenant_id=1) as client:
        # Check API health
        health = await client.health()
        print(health["version"])

        # Create an artifact
        artifact = await client.create_artifact(
            artifact_type="document",
            title="Meeting Notes",
            content="Discussion about Q1 goals...",
        )
        print(artifact["id"])

        # Search
        results = await client.search(query="Q1 goals")
        for r in results["results"]:
            print(r["title"], r["score"])

asyncio.run(main())

Configuration

From environment variables

client = MimirClient.from_env()
Variable Description Default
MIMIR_API_URL Base URL for Mímir API http://localhost:38000
MIMIR_TENANT_ID Default tenant ID (none)
MIMIR_TIMEOUT Request timeout in seconds 30.0

Explicit

client = MimirClient(
    base_url="https://mimir.example.com",
    tenant_id=42,
    timeout=60.0,
)

Error Handling

from mimir_client.exceptions import MimirNotFoundError, MimirValidationError

try:
    artifact = await client.get_artifact("nonexistent-id")
except MimirNotFoundError:
    print("Artifact not found")
except MimirValidationError as e:
    print(f"Validation errors: {e.errors}")

API Coverage

All Mímir API endpoints have corresponding client methods. See docs/design.md for the full coverage matrix.

Development

cd clients/python
uv venv .venv
source .venv/bin/activate
uv pip install -e ".[dev]"
pytest -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mimir_client-5.0.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mimir_client-5.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file mimir_client-5.0.0.tar.gz.

File metadata

  • Download URL: mimir_client-5.0.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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

Hashes for mimir_client-5.0.0.tar.gz
Algorithm Hash digest
SHA256 63a4c72437e94c580cfaf33b9504931a8eac75955be1dda43aba53726a335aba
MD5 1330141ddfe7b1ad112cf69a298bb15e
BLAKE2b-256 390dbdbe8c01ff4485b0db5bae904f235b795dc8fdb59b17480d0032cab6cb79

See more details on using hashes here.

File details

Details for the file mimir_client-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: mimir_client-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","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

Hashes for mimir_client-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3711a5edde2ad7550123f5630f8f1e89d1a07188268cfc1c8d5123eb5088908f
MD5 58858151f4287d6229cbdb0ad5723e8f
BLAKE2b-256 c01dcc785370d74fbd581bb31619d5630a9645d6ffedf1e8709487906ca8444e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page