Catalog PyPI
Back to packageRELEASE DETAILS

1.0.0

PyPI

aalign

# Aalign Fully name: **Adamlibrary.Align** It is an adamlibrary-based library where you can make real alignment calculations in Python. You cannot directly guarantee the real alignment value in Python, other than the value it produces at runtime, but aalign offers a sample aligment library abstraction using the adamlibrary memreplication_cutline modules that will guarantee this! This abstraction is an example of the use of adamlibrary. Anyone who wants to access raw pointer can develop methods to control memory interaction, real memreplication cutline, directly access raw pointer, list the memory string like aalign, there are no restrictions, all control and responsibility is on you. ## Usag

Published15 Jul 2026
Direct dependencies1
Transitive dependenciesNot calculated

README

Version 1.0.0 documentation

Aalign

Fully name: Adamlibrary.Align

It is an adamlibrary-based library where you can make real alignment calculations in Python. You cannot directly guarantee the real alignment value in Python, other than the value it produces at runtime, but aalign offers a sample aligment library abstraction using the adamlibrary memreplication_cutline modules that will guarantee this! This abstraction is an example of the use of adamlibrary. Anyone who wants to access raw pointer can develop methods to control memory interaction, real memreplication cutline, directly access raw pointer, list the memory string like aalign, there are no restrictions, all control and responsibility is on you.

Usage

Context manager

from aalign import AlignedBuffer

with AlignedBuffer(size=4096, alignment=64) as buf:
    print(buf.size, buf.alignment, buf.usable_size)
# with block output auto free()

Lifetime handling

from aalign import AlignedBuffer

buf = AlignedBuffer(size=256, alignment=32)
try:
    print(buf.usable_size)
finally:
    buf.free()  # idempotent, second double calling not is problem

posix_memalign controlling

buf = AlignedBuffer(size=128, alignment=16, strategy="posix_memalign")

Free late using (error is)

from aalign import AlignedBuffer, AlreadyFreedError

buf = AlignedBuffer(size=64, alignment=16)
buf.free()

try:
    buf.usable_size
except AlreadyFreedError as e:
    print(e)  # this AlignedBuffer has already been freed

Context proccesing - reset

from aalign import zero_buffer

data = bytearray(b"\xAA" * 32)
zero_buffer(data)
print(data.hex())  # full 00

Context processing - byte finder

from aalign import find_byte

data = bytearray(b"hello_world")
result = find_byte(data, ord("w"))
print(result)  # b'world'

CLI using

python3 -m aalign
python3 -m aalign --size 128 4096 --alignment 16 64

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
adamlibrary
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
adamlibraryruntime

Distribution files

1 collected
aalign-1.0.0-py3-none-any.whl

bdist_wheel · 17.74 KB · Python py3

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:57 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:f32ad720fc3e0467d1d4fbb46f045bd6dcbd8b293684767883555c12dba4b929

Other collected versions

View all collected versions →