Skip to main content
import coreav gives the commands of coreav as functions. Each function runs the same library code as the command and returns the same versioned JSON document as a dict.
The module is not on PyPI yet. Build it from source as below.

Build and install the module

You need Rust 1.89 or later, Python 3.9 or later, and maturin 1.x.
  1. Build the wheel from the repository:
    The dist profile is the optimized build that CoreAV ships. Maturin writes the wheel to crates/coreav-py/dist/.
  2. Install the wheel into your environment:
The wheel also installs the coreav command. It is the same command as the Rust binary, with the same options, output and exit codes.

Use it

Functions

Every function also takes private_network=False. The type stub, coreav.pyi, has the exact signatures.

Sources and outputs

  • A source is a path (str or os.PathLike), the file’s bytes (bytes or bytearray), or a URL such as "https://…", read by byte ranges.
  • A URL must be https:// and resolve to public addresses only, since a program’s URLs often come from its users. private_network=True also allows private addresses and http://, for a server on your own network.
  • A writing function with an output path writes the file as the command does and returns the summary. With output=None it returns (bytes, summary) instead.

Errors

Errors raise one of three exceptions, which match the command’s exit statuses. All three are subclasses of coreav.CoreavError.
kind is stable and meant for programs. The message is for people.

Platforms

CI builds abi3 wheels for Linux x86-64 and arm64 and for macOS arm64 (platforms).

More detail

The Python module’s design note covers the choices behind the module and its measured call overhead.