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

Uploaded CPython 3.9+Windows x86-64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

rom_runtime-0.0.3-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.3.tar.gz.

File metadata

  • Download URL: rom_runtime-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 962c1c973bcebdf5bd8d5709eea88ea2b45b053ae680d6eef8efa749463b05c2
MD5 b3483a93c02671585e85ddd0b584d6fa
BLAKE2b-256 4560557b2c0e7810c09e5e5d8bef39a83803a40c1ee65053c41f301235147761

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rom_runtime-0.0.3-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.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dccede9d905a846ecbb8c7d17f03f7fe81c54849913acca4660a737a382f62a0
MD5 29dfe553060a6fc48e4a1805b461e3af
BLAKE2b-256 402189970f1ef6fb01025d1e37b033705071141296d0fecb859dd02cddee9e9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rom_runtime-0.0.3-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 2b4d17309e55f94c5207257a70896dc5ece27d71f74f8cc57ee4bfd79cc252c1
MD5 91b09bc81d8dd09fb66733ebbd7fab06
BLAKE2b-256 c5f168666263e1885ce2e24c3482cff62e95b993ba9b79e19d130aebf7766220

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rom_runtime-0.0.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3ac4cc680812db1699bda70beb022f31039e1668102ec6750908c5cff912a8c
MD5 8da875a5959dcd5f61e4d9f928653cd1
BLAKE2b-256 4a4b3eec052b73b5d8931ed44fb54c44309539e9713f0a034d7dd95a66cdd10c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rom_runtime-0.0.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fda6b7f18fb273dbdf4c6f0a54a10fdfc668f308c318159820e5216a858e47e5
MD5 06341340ab93e1275c6784b65ac9b801
BLAKE2b-256 b01810c8d000976cec2d2cac24fb0ed654cff0600a6581b887fddd098126d4a9

See more details on using hashes here.

Provenance

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