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

Uploaded CPython 3.9+Windows x86-64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

rom_runtime-0.0.5-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.5.tar.gz.

File metadata

  • Download URL: rom_runtime-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 6fa989fd5cfe476366a039f0d48b95bf4792d0e62f51e8ed83bb15c5c8b2b0c3
MD5 1fb507c269d1ab0f07e6bc305ea64478
BLAKE2b-256 ed129193bee25cf0f571e63cca8dc64b9dd85e3b5813626c3b7b9799fead51e1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rom_runtime-0.0.5-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.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 beb07ade8c96d0cc4970c05d67e13a23e747a6c81b9cf04724f190dba4d38e49
MD5 347be3d880fc5a22a1308c1def2e796b
BLAKE2b-256 7b3cf0d2db24945a0202c95eeb1191aed55ac4d1d3533cfd9449b08f58051608

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rom_runtime-0.0.5-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 af1b18deaafcc2a95a30e591948f0a80cbbb44a8b42feff50f9cc0ac47953173
MD5 a955be77036a2137c8d1638355bfb3b3
BLAKE2b-256 c3ae4cde91ff95e4e3dc213a3721706c5887ef3c330a9d7db72775015d28131f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rom_runtime-0.0.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 449b3edd1fb8543aeb826ce242bcee9ff3296db53f6e83de61dec6ed9b936833
MD5 0dedf241e2ddfd67de75695e12f55a0a
BLAKE2b-256 de76f1e20e6a03d83ecbdb1444961a723a0b3f2ca5a273198f8a2e5ac59d1878

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for rom_runtime-0.0.5-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 92924e031e2ef4defb73e3ba1b798057aabbc83db7096c1a4f5d0b468aa24e23
MD5 2802b3d80d5d8889c8dafb72bc15e3b9
BLAKE2b-256 18ed1e18e84fe0c0979bc4afbf4ece3eb7902fb05e78767c66cb60f310cdf7cf

See more details on using hashes here.

Provenance

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