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.-
Build the wheel from the repository:
The
distprofile is the optimized build that CoreAV ships. Maturin writes the wheel tocrates/coreav-py/dist/. -
Install the wheel into your environment:
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
sourceis a path (stroros.PathLike), the file’s bytes (bytesorbytearray), 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=Truealso allows private addresses andhttp://, for a server on your own network. - A writing function with an
outputpath writes the file as the command does and returns the summary. Withoutput=Noneit returns(bytes, summary)instead.
Errors
Errors raise one of three exceptions, which match the command’s exit statuses. All three are subclasses ofcoreav.CoreavError.
kind is stable and meant for programs. The message is for people.