Skip to main content

intent-base Python SDK: launch isolated Profiles via the local Profile Service and drive them with Playwright over CDP.

Project description

intent-base-sdk

Python SDK for intent-base: launch an isolated Profile through the local Profile Service and drive it with Playwright over CDP. The SDK never launches Chromium itself — only the Profile Service does.

Install (PyPI)

Requires Profile Service running (default http://127.0.0.1:17390).

pip install intent-base-sdk==0.4.0
pip install "intent-base-sdk[playwright]==0.4.0"
playwright install chromium

The base package only needs httpx. Playwright is an optional extra.

Configuration

Option Default Environment variable
service_url http://127.0.0.1:17390 INTENT_BASE_SERVICE_URL
timeout_ms 30000 INTENT_BASE_TIMEOUT_MS

Sync usage

from intent_base import launch_profile

result = launch_profile("profile_123")
result.page.goto("https://example.com")
print(result.page.title())
result.close()

Pass auto_stop=True to also stop the Profile on close().

Async usage

import asyncio
from intent_base import launch_profile_async

async def main():
    result = await launch_profile_async("profile_123")
    await result.page.goto("https://example.com")
    print(await result.page.title())
    await result.aclose()

asyncio.run(main())

Errors

from intent_base import launch_profile, ProfileAlreadyRunningError, IntentBaseError

try:
    result = launch_profile("profile_123")
except ProfileAlreadyRunningError as err:
    print("already running:", err.code)
except IntentBaseError as err:
    print(err.code, err.message, err.status)

Monorepo development

pip install -e "sdks/python[dev,playwright]"
python -m pytest sdks/python/tests

See docs/PUBLISH.md for PyPI release steps.

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

intent_base_sdk-0.4.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

intent_base_sdk-0.4.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file intent_base_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: intent_base_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for intent_base_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 55b2a4e52be56abdba1ca29da2b28f66fce767d62fdc468c5a8c5857db221715
MD5 5fb9cfd3eb85178014dbb90608c2eb08
BLAKE2b-256 fc56c54a6ee0a4e71537f1d493cc3e5acfec1f4b53c8e3c90b058c3ea4355721

See more details on using hashes here.

File details

Details for the file intent_base_sdk-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for intent_base_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d253ec04579e30b6b50b7684c6dba4d0aed0f2fb868d8b44b6d1e695ff61813c
MD5 a7cad8d5d0e5e6377fd768df76cf730d
BLAKE2b-256 7edfb109c82edce89a229e8a6d4229b0672638f3f68eabc64f88cd2cad90364e

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