Skip to main content

Unofficial Python bindings for the ASAM OpenCRG C API

Project description

pycrg

Unofficial Python bindings for the ASAM OpenCRG C API.

Features

  • Full non-visual OpenCRG C API coverage in Python
  • High-level DataSet, ContactPoint, and RoadSurface APIs
  • Stable message callback support
  • Experimental allocator callback support behind PYCRG_ENABLE_UNSAFE_CALLBACKS=1
  • Demo scripts and smoke tests

Exposed functionality includes:

  • dataset lifecycle and consistency checks
  • dataset metadata printing and range/increment queries
  • dataset modifier set/get/remove/apply/default operations
  • contact point lifecycle and option set/get/remove/default/history operations
  • evaluation and transforms: (u, v) <-> (x, y), (u, v) -> z, (x, y) -> z, (u, v)/(x, y) -> (phi, curv)
  • global controls: OpenCRG release info, memory release, message level and limits

Public callback APIs:

  • Stable/public:
    • set_message_callback
    • clear_message_callback
  • Experimental/unsafe (pycrg.experimental):
    • set_calloc_callback
    • set_realloc_callback
    • set_free_callback
    • clear_unsafe_callbacks

Unsafe allocator callbacks are disabled by default and require PYCRG_ENABLE_UNSAFE_CALLBACKS=1.

Legal notice

pycrg is an unofficial community wrapper and is not affiliated with or endorsed by ASAM e.V.

ASAM OpenCRG® is a registered trademark of ASAM e.V.

This package redistributes parts of OpenCRG under Apache License 2.0 and includes required attribution files:

  • LICENSE
  • NOTICE
  • vendored source license files under src/pycrg/vendor/opencrg/

Installation

pip install pycrg

Development

0) Install development dependencies

pip install -r requirements-dev.txt

1) Refresh vendor snapshot (before building wheel/sdist)

python tools/vendor_snapshot.py --source ../OpenCRG

--source may point to any local clone of OpenCRG.

2) Build

python -m build

3) Install locally

pip install dist/*.whl

Changelog

Release notes are maintained in CHANGELOG.md.

Minimal usage

from pycrg import ContactPoint, DataSet, RoadSurface

dataset = DataSet.open("tests/data/sample.crg")
cp: ContactPoint = dataset.create_contact_point()

print(dataset.u_range())
print(cp.uv_to_z(0.0, 0.0))
cp.close()
dataset.close()

road = RoadSurface.open("tests/data/sample.crg")
print(road.u_range())
print(road.v_range())
print(road.uv_to_z(0.0, 0.0))
road.close()

Example scripts

Run from project root after install/build.

  • C demo ports (simple, eval_z, eval_xyuv, eval_options) are exception-safe: evaluation/conversion failures are handled as warnings and execution continues.
  • This behavior is implemented via non-throwing try_* API methods on ContactPoint / RoadSurface.
  • python examples/scripts/basic_roadsurface_demo.py
  • python examples/scripts/dataset_contactpoint_demo.py
  • python examples/scripts/message_callback_demo.py
  • python examples/scripts/simple_demo.py
  • python examples/scripts/reader_demo.py
  • python examples/scripts/eval_z_demo.py
  • python examples/scripts/eval_xyuv_demo.py
  • python examples/scripts/eval_options_demo.py
  • python examples/scripts/curvature_demo.py
  • PYCRG_ENABLE_UNSAFE_CALLBACKS=1 python examples/scripts/unsafe_allocator_callbacks_demo.py
  • PYCRG_ENABLE_UNSAFE_CALLBACKS=1 python examples/scripts/experimental_allocator_api_demo.py

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

pycrg-1.0.0.tar.gz (81.3 kB view details)

Uploaded Source

Built Distributions

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

pycrg-1.0.0-cp312-cp312-win_amd64.whl (141.5 kB view details)

Uploaded CPython 3.12Windows x86-64

pycrg-1.0.0-cp312-cp312-win32.whl (135.5 kB view details)

Uploaded CPython 3.12Windows x86

pycrg-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (243.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pycrg-1.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (231.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pycrg-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (135.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pycrg-1.0.0-cp311-cp311-win_amd64.whl (141.4 kB view details)

Uploaded CPython 3.11Windows x86-64

pycrg-1.0.0-cp311-cp311-win32.whl (135.4 kB view details)

Uploaded CPython 3.11Windows x86

pycrg-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (244.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pycrg-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (232.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pycrg-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (135.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pycrg-1.0.0-cp310-cp310-win_amd64.whl (141.4 kB view details)

Uploaded CPython 3.10Windows x86-64

pycrg-1.0.0-cp310-cp310-win32.whl (135.4 kB view details)

Uploaded CPython 3.10Windows x86

pycrg-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (244.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pycrg-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (232.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pycrg-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (135.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file pycrg-1.0.0.tar.gz.

File metadata

  • Download URL: pycrg-1.0.0.tar.gz
  • Upload date:
  • Size: 81.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9c4e11bf44527014f294aee539e45f547d09c0011e11b3b209706ee845fc6b53
MD5 bfaa7002084fa3521610afcb0fe48fdd
BLAKE2b-256 bae62a562234ce6f4a60a7d79d24c14b3bcdc43505748d4d37d246032e55c17c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0.tar.gz:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pycrg-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 141.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 445333b9e431a10f31226096e8bfec73d6b9f5ad823190eaf38b9ddeaaadb6f5
MD5 55cc8afd692ba2a462bc3f6f3222c46d
BLAKE2b-256 96b163e2012672af49f15b6bb4b71dcd135b88054248dac210066cc1345c0f8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: pycrg-1.0.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 135.5 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-1.0.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 e5d286838acc45e466eec608b7a5e2d8cdf8cda7360df05a138483531202e10c
MD5 476fe76c680ccc3547ce43740c37550e
BLAKE2b-256 4b80b6f27598a041a837d50aee895407f90cdcbd991571879effa52f5ad8e983

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp312-cp312-win32.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 095ab09acf682c71b6039bd0d7b46c8ea846a0ed4b36f44a331b5ed759fd5e5d
MD5 a9b5be522aff9c7302949a84a0dcf6bd
BLAKE2b-256 a6255ad3e9475190fcc4e19abb824f19ea9c5138591819b09f416dd14f36b61a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 05ad65044c841c1037552503a23b35b96f654810b5010e682226cfc130e10628
MD5 cb7417ab7fa1daba6674e3d4c9a3de61
BLAKE2b-256 427164531688f78a8c8ffdfd62d035e089feb11c6503ad60f812ba9cbebba3f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b09a9bf968732e3dac8b2d6699219a66e1338cbdfd192ba4d4a530183edff93a
MD5 34cafa5a3e0f3ff1dff4476243e9595e
BLAKE2b-256 3cd6ed875b272c6cdfc2b80f64d4e2c04f240f0d58e8637f80140f7765c11ed8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pycrg-1.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 141.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cec5953ee9fb7611789abebe985e9ed1e231f589697360264a4419facbcc7caa
MD5 a831bb82bfd476b2b09af4232a848a37
BLAKE2b-256 7e7c9ef97fc6f2f3f26c11d0ffffe1b203d123a6bf5230f5dcd6830d5e31708a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: pycrg-1.0.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 135.4 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-1.0.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 ce1e014b87a951d287b61d6fc195b4a6db87c751eb9b6425525aef139a561568
MD5 66a8aa087cf848abf3837f5dd288c8bb
BLAKE2b-256 9883dd738e3dd6ba803282212df29c3d14174da7882963f5c930cde8beabb44a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp311-cp311-win32.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0debd3442de0e2b078b46eec483cc507f6a71cbf51667feb22c9047afc63e0f4
MD5 707a13fd5a6c5d29930affbb49c626fc
BLAKE2b-256 fe7ce6d3913e8d07b345ce598f2b38ba97c63266df6f5ebe8931074c55eb82e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 24e3ce43e670a4ab3bbbd440dbeb74ac0a38797e5ae86e66168481e2770c19f3
MD5 98493c2e0b4903a02b4d4ae327b033dd
BLAKE2b-256 2b2cd26d715c25f7aada5738f389683001dc475c8bf5268fd2e0936ebe36e5e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42ad5d10ca3cf809426fab2c2ac7325f860ea3d628fce206d3f177f4fb05c88d
MD5 a7962787f4d6548b5717fa454cec39c6
BLAKE2b-256 06d254984972064610334780f3e6f761e7a5455585e671ced31e5d0864e6fdc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pycrg-1.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 141.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d0dc26d6322582e20efa0c0be4599c99e8756fcc6b40f63c737b12008227ed28
MD5 b464b0f4351caf669b499d6e1f4019c2
BLAKE2b-256 bd7188f5d4dfd0d117add08169a8d20fc12a993c65e9b004b7fd11ca81302f9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp310-cp310-win_amd64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: pycrg-1.0.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 135.4 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycrg-1.0.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 ef2df6a0882a5a365266d856ad7dcf3b8e00734701117c4d16617281b73b1fb3
MD5 54329a5f3e473f0bd3f53a4bc69a5748
BLAKE2b-256 db5d21a4533a11ceaa5a00c7a9131c2bbada564703372a59bd260384c4ef1063

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp310-cp310-win32.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7d65f1d459dbe750a626106b5428c401864f3eb933a95353a48c8d6539261086
MD5 2a7e42038b86acb19cc25e3be89bb635
BLAKE2b-256 4bf1cd1e4b00ee523ef830cc1562a3c7979c384f9f03f885d75b8187008fcdfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2356a0643eaef963de31efe8bb2c7096b43724fbb2cf0d88b49a9355087a82ac
MD5 36fd0dbf20eed7e9fc11902b33d9a197
BLAKE2b-256 3f0ebf8aadcba8ea5ab988ff0a02fd131567154746acb71d840986f34c875534

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on ExpectedArgument/pycrg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pycrg-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycrg-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 771023413d8b432c26782ea253aa5e0bdd9fa29a4b4b576c158b8f0c9f5c6966
MD5 3b9558430466c8478486b3aac59b33f1
BLAKE2b-256 eacc102b6d2420cb37d03816e7ad3caa747e9cbcac79e76aa03b4e024fbe3778

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycrg-1.0.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on ExpectedArgument/pycrg

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