Skip to main content

Python bindings for ANARI

Project description

pynari - Python Bindings for ANARI

This project provides a python interface for the Khronos ANARI rendering API. This implementation currently requires a CUDA capable GPU (support for other backends will be added at a later time).

Usage - Quickstart

Assuming you already know how the ANARI API works, and that you have pip-installed this package you can use ANARI in python as follows: First, import this package:

import pynari as anari

(for all the steps below we assume you imported pynari as anari; this is not required, but please take this in mind for the examples below).

Once the package has been imported you can then create a ANARI "device" using

device = anari.newDevice('default')

(the 'default' will later allow to select between different back-ends, but is currently ignored)

You can then create various ANARI objects through creator-methods on that device, such as, for example

world = device.newWorld()
mesh = device.newGeometry('triangle')
array = device.newArray(anari.FLOAT32_VEC3,vertex)

etc.

The ANARI API, and how it is exposed in pynari

For a full description of what ANARI Objects are, what kind of objects exist, and how they work, please refer to the ANARI API Spec at https://registry.khronos.org/ANARI/specs/1.0/ANARI-1.0.html .

Since the official ANARI API is a plain C API we could not implement this literally, but had to make certain changes to make ti more "pythonic". Basically, these rules were applied (we will assume that the pynari module was imported under the alias as anari):

  • If there is a C constant/enum of name ANARI_XYZ, it is exposed as anari.XYZ. Example: the C enum of ANARI_FLOAT32 is anari.FLOAT32 in pynari.

  • If there is a C API function of anariFunctionXyz(ANARIDevice device, ...) it will be exposed as device.functionXyz(...). Note that in order to remain as close to the C-style API as possible we use CAML-case for function names, not python-casing. I.e., pynari uses device.functionXyz(...), not device.function_xyz(...).

Examples

For a list of several samples, please visit the pynari github repo https://github.com/ingowald/pynari

For any issues, please use the github pynari issue tracker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pynari-1.0.23-cp313-cp313-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13Windows x86-64

pynari-1.0.23-cp313-cp313-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

pynari-1.0.23-cp312-cp312-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.12Windows x86-64

pynari-1.0.23-cp312-cp312-manylinux_2_34_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pynari-1.0.23-cp311-cp311-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pynari-1.0.23-cp310-cp310-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

pynari-1.0.23-cp39-cp39-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

pynari-1.0.23-cp38-cp38-manylinux_2_34_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

File details

Details for the file pynari-1.0.23-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pynari-1.0.23-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for pynari-1.0.23-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 40cfaf39accc8fd93a44330a33085e9efc71142060aa1cb29dcf97680a303ac3
MD5 f5af5f205a5919f96fd8a64f686f84e2
BLAKE2b-256 d6d265cc36c07aa3d93c4c9d9ba32af8fbbb9b7715e8dd4302ad2d1f5ca2e989

See more details on using hashes here.

File details

Details for the file pynari-1.0.23-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pynari-1.0.23-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7299261b2261e159196ff9aa0b158fc08edb413dc09397a648d2d66a8cdd4458
MD5 98c13e136d47bd4aeb8b2db6d62fc618
BLAKE2b-256 52170832fcf30fb4023b9c15544090b7830ac4b44a9499495d941b060ec9f297

See more details on using hashes here.

File details

Details for the file pynari-1.0.23-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pynari-1.0.23-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for pynari-1.0.23-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 049831cc04fa12f9f00e0ecd5311e2b23b5d2b37be067d97369a13a9dc1170a2
MD5 0558e9e5a8d9a350b247483cacaf17d6
BLAKE2b-256 cab7e2e13e669103e2f9a68e31aabe51c39ad828ee0c8635da57ea63ba2ba84a

See more details on using hashes here.

File details

Details for the file pynari-1.0.23-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pynari-1.0.23-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 af0dd76b2fef34aa53c322eed6a7c0e8f4c34630286f895adae144e4975feab6
MD5 ef9ab4e746e91f33da2227e28f155320
BLAKE2b-256 4736c800df30f938e53488db6795cf79cab5b1686c9db54f34eaf53c8dd0e39c

See more details on using hashes here.

File details

Details for the file pynari-1.0.23-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pynari-1.0.23-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c135c0b3c98b8739935053f93e3833489907a2d9bc8916bfc5a0da58928706e4
MD5 954a47b3ebb6b4effbc339b1d40cbcf2
BLAKE2b-256 00fc7f20ae48bd18a788a56c00bf81ca6e0ba72257b8ff46cb2ec68099cb48d5

See more details on using hashes here.

File details

Details for the file pynari-1.0.23-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pynari-1.0.23-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 32eba8936374ff1c593571d8e3de746da184cb83970dca708117d1764b9b8864
MD5 89b158beea65a0216e095571997635c6
BLAKE2b-256 38c188ebfbd568a2ff2c69a376e497c02839348c3674b55041728173703387e5

See more details on using hashes here.

File details

Details for the file pynari-1.0.23-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pynari-1.0.23-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f370cfbc652b0c9009260c88b9f9f6477843059f9d16026c1fbcc13ec9a53c1f
MD5 a2bcec80155a16d332004638d08a31ea
BLAKE2b-256 277c4b410fafcc833a90a4717047a0bc1782f8a3a8ad189285f429ae38c5090f

See more details on using hashes here.

File details

Details for the file pynari-1.0.23-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pynari-1.0.23-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6a96ffbdfe2ec6d742acea3267eb536d1cbcf66066cf0261236eef07a0fc9064
MD5 dadb04d4dbe3ed25a79d8b85bbec958c
BLAKE2b-256 4ab4368fcc5b8a1bb5d056d1fb46adbbb8b720f8fa2f39b9779f583082b98e28

See more details on using hashes here.

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