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.4.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.4-cp39-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

rom_runtime-0.0.4-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.4-cp39-abi3-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rom_runtime-0.0.4-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.4.tar.gz.

File metadata

  • Download URL: rom_runtime-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 407ec1f6fa0de2749278ca9a796809a41d34dd1799545f9bc6600a98d94699cf
MD5 b256a0b3db6eb83a1b38ec5ac883b1be
BLAKE2b-256 984cf138a5c52b3f50d88f25886afedcc9c7e4f4973df4028e284008992585a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.4.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.4-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rom_runtime-0.0.4-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.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 05fce12136f92d44710d02e64f800fbd4f8ff47eee36f7aee610651f6209d809
MD5 b2b5b057957dfbf01714d39c6edad994
BLAKE2b-256 45ca86ef3bec21b7783abe57fd1daae2e918cfdefe654dcb397e9fc11eb2f25c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.4-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.4-cp39-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for rom_runtime-0.0.4-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 1671d715180f78b3c7a1917e1e7ded9e38e2a9af60c6f0b329850f71b50c9806
MD5 0e88ba5132a90d5e56f29e0fe451213b
BLAKE2b-256 308bab1c1fef232eb7edaf82644e56f49ee4972caebffb004b0959e265d6e4fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.4-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.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rom_runtime-0.0.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5711bad32ea50b2487f69f0ae14ab2a32cb86d734f819bf8c3565fb73653e03a
MD5 32d6005a26891f3874a2e52f748744f2
BLAKE2b-256 12a70791a0cd91d8e7e542cbe776e773045912aaa7999c98b5a6f2c15dd17297

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.4-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.4-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rom_runtime-0.0.4-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ddea7ef3841053bc1afc72a21bff49f75fc14d024e5d82aeb3194bb6e9e19045
MD5 862ec78383bcf8ff2ccd9ec430493e05
BLAKE2b-256 b94fc519e1763d8b3487e45f7efb3c099efa4ebfe712bcb86eb724265e9272e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rom_runtime-0.0.4-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