Skip to main content

Obscura Python SDK

Documentação completa: English · Português do Brasil

Playwright-like Python entry points for the Rust Obscura browser fork. The SDK uses Playwright's own Python objects and CDP client; it does not download Chromium.

Complete documentation: English · Português do Brasil

Install from this directory with pip install -e .. On first use, the SDK downloads the matching release from h4ckf0r0day/obscura into its own obscura-python data directory. Set OBSCURA_REPOSITORY to use another repository, such as your own fork, when it has compatible release assets. Set OBSCURA_PYTHON_HOME to choose the local root. OBSCURA_EXECUTABLE, executable_path, or a binary on PATH can override that download.

The package also installs the obscura-python command, which forwards CLI arguments to the Rust executable:

pip install obscura-python
obscura-python fetch https://example.com --dump text

With uv, install it as a tool:

uv tool install obscura-python
obscura-python --version

Releases are published by GitHub Actions. Create a tag such as v0.1.0 after configuring the repository as a Trusted Publisher for the obscura-python project on PyPI; the workflow builds and uploads the wheel and source archive without storing a PyPI token in GitHub.

For a local checkout use uv tool install ./python, or add it to a project with uv add ./python. The first execution may require internet access to download the Rust browser binary; set OBSCURA_EXECUTABLE for offline use.

from obscura.async_api import async_playwright

async with async_playwright() as p:
    browser = await p.chromium.launch(proxy={"server": "http://127.0.0.1:8080"})
    page = await browser.new_page()
    await page.goto("https://example.com")
    print(await page.title())
    await browser.close()

Janela de visualização (headless)

O engine continua sem janela e recebe comandos por CDP, mas o SDK pode mostrar os frames recebidos em uma janela Tkinter. Isso é útil para depurar um fluxo de RPA sem trocar a API Playwright:

from obscura.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(show_window=True, window_title="Meu robô", frame_rate=30)
    page = browser.contexts[0].pages[0]
    page.goto("https://example.com")
    input("Pressione Enter para fechar... ")
    browser.close()

show_window=True apenas exibe o screencast Page.startScreencast; não torna o processo do navegador headed e não altera a automação. O recurso depende de Tkinter estar disponível na instalação do Python.

Each launch chooses a free loopback port and starts an independent process. connect_over_cdp() connects to an external process and never terminates it. Obscura is headless only; unsupported launch options produce explicit errors.

Download files

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

Source Distribution

obscura_python-0.1.10.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

obscura_python-0.1.10-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file obscura_python-0.1.10.tar.gz.

File metadata

  • Download URL: obscura_python-0.1.10.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for obscura_python-0.1.10.tar.gz
Algorithm Hash digest
SHA256 fa687819fd5169317edd0593f6c12a3dc3f16bbf10aaa3aed1856999223d97f5
MD5 2e273363f66f79db7a3ae084a8e39aac
BLAKE2b-256 974fd57426690ced37d721fccfd111e8d71f7f20c38f6166c60691502abc5593

See more details on using hashes here.

Provenance

The following attestation bundles were made for obscura_python-0.1.10.tar.gz:

Publisher: publish.yml on Willianjesusdasilva/obscura-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obscura_python-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: obscura_python-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for obscura_python-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 66a76a3697b9964228f785f5846c94ee25e8fc94e1a43a490263794bb4cabd0c
MD5 dee278db3f2d8e1f5263167126692740
BLAKE2b-256 c0d392e0c3452be8404ca86e5b5445cf05e00ca9c22f811582d51c8c6986a12f

See more details on using hashes here.

Provenance

The following attestation bundles were made for obscura_python-0.1.10-py3-none-any.whl:

Publisher: publish.yml on Willianjesusdasilva/obscura-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.12

2 files

0.1.11

2 files

This release

0.1.10 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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