Skip to main content

Rust-accelerated utility functions for the ormar ORM

Project description

ormar-utils

Rust-accelerated utility functions for the ormar async ORM.

This package provides optional Rust implementations of performance-critical operations used internally by ormar. When installed, ormar automatically uses these faster implementations.

Installation

pip install ormar-utils

Or install ormar with the rust extra:

pip install ormar[rust]

Requirements

  • Python >= 3.10
  • A Rust toolchain (for building from source)

Wheels are built against the CPython stable ABI (abi3, Python 3.10+), so a single wheel per platform works on current and future Python releases without a per-version rebuild.

API Reference

All functions are exposed from the ormar_rust_utils module:

Parsers

  • encode_bytes(value, represent_as_string=False) - Encode bytes to string (UTF-8 or base64)
  • decode_bytes(value, represent_as_string=False) - Decode string to bytes (UTF-8 or base64)
  • encode_json(value) - Encode a value to JSON string

Hashing

  • hash_item(item) - Convert a dict/list into a hashable tuple for use as dict key

List/Dict Utilities

  • translate_list_to_dict(list_to_trans, default=None) - Split __-separated strings into nested dict
  • group_related_list(list_) - Group related strings into nested dictionary

Collections

  • UniqueList(initial=None) - A list that prevents duplicates using hash-based O(1) lookups

Alias Utilities

  • build_reverse_alias_map(field_alias_map) - Build a cached alias -> field_name lookup (with identity entries) from a field_name -> alias mapping

Merge Infrastructure

  • group_by_pk(pks) - Group items by PK hash, preserving insertion order
  • plan_merge_items_lists(current_pks, other_pks) - Create a merge plan for two lists by PK

License

MIT

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

ormar_utils-0.2.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distributions

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

ormar_utils-0.2.0-cp310-abi3-win_amd64.whl (243.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (390.8 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (379.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

ormar_utils-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (344.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ormar_utils-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl (355.6 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ormar_utils-0.2.0.tar.gz.

File metadata

  • Download URL: ormar_utils-0.2.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ormar_utils-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e2bf1ff71fbb820cac192b33583d58fac29e838a79804995336ef2bee02cc9ae
MD5 c380f8591ae473eafc42fdbf3faf31c6
BLAKE2b-256 d7056740934d404ae97a1f7f71cef0c9087d05ff5d7eecd96abf72ac4c06aad5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ormar_utils-0.2.0.tar.gz:

Publisher: ci.yml on ormar-orm/ormar-utils

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

File details

Details for the file ormar_utils-0.2.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ormar_utils-0.2.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 243.9 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ormar_utils-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 122c7dd9f2eb52342be4862beda0737f98e7813c01751793f0fa53715f5b3959
MD5 243d6b0d8431f70f92c2cbfd3ab0bdae
BLAKE2b-256 98d442117e9b363bc37587da3ec9719d98892c4491e5ffe39aeee752a4b2b699

See more details on using hashes here.

Provenance

The following attestation bundles were made for ormar_utils-0.2.0-cp310-abi3-win_amd64.whl:

Publisher: ci.yml on ormar-orm/ormar-utils

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

File details

Details for the file ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 55c7ec5e002b0cc5394830c2b8c109a5b492d518fc95367dcf6b1da57c8510e4
MD5 5b09549ca3a1620e423522b16c471482
BLAKE2b-256 b7b0808ca044841247e84812c00e527549165843b83cd1a333ddf123ec281436

See more details on using hashes here.

Provenance

The following attestation bundles were made for ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci.yml on ormar-orm/ormar-utils

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

File details

Details for the file ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f93299eda3e3a72fdbf5ff4ce8c82ff801247bba616debc52dbb48915480d3ce
MD5 5be7362b6d840993ae628a68fce9fcfa
BLAKE2b-256 4fac1883199df7be823572d3ac27e55208a721df1b123e1b94b558028d44c2ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for ormar_utils-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: ci.yml on ormar-orm/ormar-utils

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

File details

Details for the file ormar_utils-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ormar_utils-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 40f3d45737017309cea3c62569394cc56e4c1558f9926f1dded580eeb6f730bb
MD5 c1c763be719c4bd1cd6b9270578151ef
BLAKE2b-256 5951bf0573addc403aeb971623594dedb2826b5fa7e83b3b32fb2682500afebc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ormar_utils-0.2.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: ci.yml on ormar-orm/ormar-utils

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

File details

Details for the file ormar_utils-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ormar_utils-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e164f5d3636a660cec8df91cc1a0e2159bbb429f55d990272c096b1eef9d6c59
MD5 50230f680f0467143d9275bc04de218e
BLAKE2b-256 fd751b060d1e78a20ebb86a9de5b584e9c7fd19ab59c2bd4108f4c89b8947466

See more details on using hashes here.

Provenance

The following attestation bundles were made for ormar_utils-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: ci.yml on ormar-orm/ormar-utils

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