Skip to main content

Python wrapper for the ROM browser-like runtime

Project description

rom-runtime

Python bindings for the ROM browser-like runtime.

This package exposes a thin Python API on top of ROM:

  • eval()
  • eval_async()
  • eval_json()
  • surface_snapshot()
  • fingerprint_probe()
  • run_fingerprintjs_harness()
  • fingerprintjs_version()

It prefers a native PyO3 extension when available and falls back to the ROM CLI bridge otherwise.

Install

pip install rom-runtime

Usage

from rom import RomRuntime, has_native_binding

runtime = RomRuntime(
    {
        "href": "https://example.test/",
        "cors_enabled": False,
        "proxy_url": None,
    }
)
href = runtime.eval_async("(async () => location.href)()")
snapshot = runtime.surface_snapshot()

print("native:", has_native_binding())
print(href)
print(snapshot["fetch"])

Config keys use the Rust runtime field names, so use snake_case such as cors_enabled and proxy_url. cors_enabled is False by default.

Optional native build from source

python -m pip install maturin
python -m maturin build --manifest-path bindings/gom-python/Cargo.toml --release

Tagged GitHub releases build and publish wheels for Linux, Windows, and macOS, plus an sdist for source installs.

Common methods

  • eval()
  • eval_async()
  • eval_json()
  • surface_snapshot()
  • fingerprint_probe()
  • run_fingerprintjs_harness()
  • fingerprintjs_version()

Environment

  • ROM_FORCE_CLI_BRIDGE=1: disable the native path and force CLI fallback
  • ROM_BRIDGE_BIN: explicit path to the rom_bridge executable
  • ROM_BRIDGE_CWD: working directory used by the CLI fallback

More docs

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

rom_runtime-0.0.2.tar.gz (130.0 kB view details)

Uploaded Source

Built Distributions

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

rom_runtime-0.0.2-cp39-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

rom_runtime-0.0.2-cp39-abi3-manylinux_2_38_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.38+ x86-64

rom_runtime-0.0.2-cp39-abi3-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rom_runtime-0.0.2-cp39-abi3-macosx_10_12_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file rom_runtime-0.0.2.tar.gz.

File metadata

  • Download URL: rom_runtime-0.0.2.tar.gz
  • Upload date:
  • Size: 130.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rom_runtime-0.0.2.tar.gz
Algorithm Hash digest
SHA256 aa598c429b0edacb36686e89c1741b261015d16a9f8931516aa30622af8d6037
MD5 788cbd8ef7887b5de02b30060c4e4588
BLAKE2b-256 499ce854c698f0950f0c9c5b96f49bf91d12133dc86e2512546bc50d0ab71063

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.2.tar.gz:

Publisher: release-bindings.yml on Rxflex/rom

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

File details

Details for the file rom_runtime-0.0.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rom_runtime-0.0.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rom_runtime-0.0.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 57c06fab629e5cd2ec70bc329cafb1527fa1b8c6539487524ce4a0c6c9259fe1
MD5 7b4f407ac264cda8bb6b48bbdb0af82d
BLAKE2b-256 e6996e934eb5ac05754d4ca603ac301f5eaa9aeea8ee2e797ee8b94a0577f2b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.2-cp39-abi3-win_amd64.whl:

Publisher: release-bindings.yml on Rxflex/rom

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

File details

Details for the file rom_runtime-0.0.2-cp39-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for rom_runtime-0.0.2-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 4b5023a4bc7e2b29b0beb7c928b2accea2687c2159d1ae30fa32a32d0b503bc8
MD5 27ee8104fb5d80c80e4f614efc12ed13
BLAKE2b-256 b6bb2802a68fb029001c1b45be64f010a5163c59c03bb710fedf7fe42f3f1abf

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.2-cp39-abi3-manylinux_2_38_x86_64.whl:

Publisher: release-bindings.yml on Rxflex/rom

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

File details

Details for the file rom_runtime-0.0.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rom_runtime-0.0.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ef29bea5bdd878ed3f8615d58f9d672259a2c7c4586f97c089b4b830c8f9fa5f
MD5 c3922d2223caa7ee05b96caed46433dd
BLAKE2b-256 ec7a94b115bd94569ab95acfa4c8afc223d8ba71d94d997b6d2c353f1765e344

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.2-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release-bindings.yml on Rxflex/rom

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

File details

Details for the file rom_runtime-0.0.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rom_runtime-0.0.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a7516a8a5b2172849bf3d725a00c3ad14c2a952024faa77511a0666736e7a63f
MD5 0e7a77f85e6052640d743bab61f1ee14
BLAKE2b-256 350a91db6f5d0ef20702783076da6287048208501fabbd638359f78f83b96cc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.2-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release-bindings.yml on Rxflex/rom

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

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