Skip to main content

Standalone ax_utils package with C/C++ extensions for high-performance utilities

Project description

ax_utils - High-Performance Python Utilities

Tests Python versions PyPI version License Code style: Ruff

A standalone Python package providing high-performance utilities with C/C++ extensions, converted from the original ax.utils namespace package.

Author: Stephan Bentheimer

Features

  • AXQueue: High-performance thread-safe queue implementation with C++ backend
  • AXTree: Fast tree data structure with C extensions for efficient nested data manipulation
  • Simple Deepcopy: Optimized deep copy implementation
  • Props to Tree: Convert flat property notation to nested tree structures
  • Unicode Utils: Fast Unicode processing utilities
  • Gevent Integration: Seamless integration with gevent for async applications

Installation

pip install axiros-utils

The package includes C/C++ extensions that will be compiled during installation, providing significant performance improvements over pure Python implementations.

Troubleshoot Installation

Problem: Compile fail on darwin.

[stderr]
      ax_utils/ax_queue/_ax_queue.cpp:4:10: fatal error: 'exception' file
      not found
          4 | #include <exception>
            |          ^~~
      1 error generated.
      error: command '/usr/bin/clang++' failed with exit code 1

With Python 3.11.13 (main, Jun 3 2025, 18:38:25) [Clang 17.0.0 (clang-1700.0.13.3)] on darwin

Solution: Refresh your compiler tools. E.g. xcode-select --install.

The tests contain a few tests on osx.

Quick Start

from ax_utils.ax_queue import AXQueue
from ax_utils.ax_tree import AXTree
from ax_utils.simple_deepcopy import deepcopy
from ax_utils.props_to_tree import props_to_tree

# High-performance queue
queue = AXQueue()
queue.put("hello")
print(queue.get())  # "hello"

# Tree data structure with dot notation
tree = AXTree()
tree['user.profile.name'] = 'John'
print(tree['user']['profile']['name'])  # 'John'

# Fast deep copy
data = {'complex': [1, 2, {'nested': 'value'}]}
copied = deepcopy(data)

# Convert flat properties to tree
props = {'app.database.host': 'localhost', 'app.database.port': 5432}
tree_data = props_to_tree(props)

Performance

All core operations are implemented in C/C++ for maximum performance:

  • AXQueue: C++ implementation with std::mutex for thread safety
  • AXTree: C implementation for fast tree operations
  • Unicode processing: C implementations for encoding/decoding operations
  • Deep copy: Optimized C implementation

Compatibility

  • Python 3.9+
  • Linux and macOS
  • Automatic compilation during pip install

Migration from ax.utils

If you're migrating from the original ax.utils namespace package:

# Old imports
from ax.utils.ax_queue import AXQueue
from ax.utils.ax_tree import AXTree

# New imports
from ax_utils.ax_queue import AXQueue
from ax_utils.ax_tree import AXTree

Development

The package uses modern Python packaging with pyproject.toml and supports development installation:

# Clone and install in development mode
git clone <repository>
cd ax_utils
pip install -e .

License

BSD-3-Clause license (incl. Axiros attribution obligation).

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

axiros_utils-3.1.0.tar.gz (34.3 kB view details)

Uploaded Source

Built Distributions

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

axiros_utils-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

axiros_utils-3.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (197.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

axiros_utils-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (191.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

axiros_utils-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (194.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

File details

Details for the file axiros_utils-3.1.0.tar.gz.

File metadata

  • Download URL: axiros_utils-3.1.0.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for axiros_utils-3.1.0.tar.gz
Algorithm Hash digest
SHA256 4f6fa11251d55ef614fe508fdede0a0480606a1fb63b2664470865185d0c56fa
MD5 1ee2b84700a1b8d6a4794b0e8268f975
BLAKE2b-256 db001c45393534264659a7e8f9a82f360fd4e68ae9d5ea871b30a5c222cbbe4b

See more details on using hashes here.

File details

Details for the file axiros_utils-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for axiros_utils-3.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff191e0dd17faa3adcce7988337d47f009d5593ae00e1d74a99f6539212608ae
MD5 e2c21a63c928b6a452c651d8251d9139
BLAKE2b-256 c1989d2d23b64549829cc8ad5641a84b7e40f065066b7616e59d53792da88d35

See more details on using hashes here.

File details

Details for the file axiros_utils-3.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for axiros_utils-3.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7c3da24113ba681a2919df9904085d49c0c9fb8d047076097b2cce73475029c5
MD5 73fcd7bdd1c1e518d632c7cc4655e053
BLAKE2b-256 23ec039a7adea062f64745d2a5aec03c00db82ae7cd910dd620f42ab331c4b1a

See more details on using hashes here.

File details

Details for the file axiros_utils-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for axiros_utils-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74903e1886e0bd16bad942dcb2946d71d97fa6edfc079dee3cc9c5c099a9a2c1
MD5 735df6f6b95f9c4724fde82a50074e43
BLAKE2b-256 048ee5ccaa63f4a6232f69b0da5153a7df420da0ab1294b07830832f28987340

See more details on using hashes here.

File details

Details for the file axiros_utils-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for axiros_utils-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d483c757e44fd779a6e844f8a716ebd9c5e737230512a4e2870751a0ad651a32
MD5 ce5c1ad16f175b3d6926d4ecba6ba1fd
BLAKE2b-256 0d4003246a60dafb8d0183ae442d3342320d9e4d0cf410e7c4e668ba63d6956b

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