Skip to main content

nyxa-speedups

Rust accelerators for the Nyxa framework — drop-in native versions of the hot paths (routing, headers, query/cookie parsing, multipart, cookie signing, URL building, form validation, pagination JSON). Bundled with nyxa by default; every helper has a pure-Python reference in nyxa._speedups with identical results.

Features

  • Matcher — route-tree matcher built by RouteTree: Matcher(), add_node() -> id, add_static(parent, segment, child), add_param(parent, name, pattern, child) (compiled regex or None), set_wildcard(parent, child), add_handler(node, methods, route), find(method, path) -> (route, params) | None.
  • HTTP parsing — parse_query(qs), parse_query_multi(qs), parse_cookies(header), scan_headers(...), encode_headers(...), parse_multipart(body, boundary, max_fields, max_files, max_part_size=None) (bounded).
  • HeaderIndex — header_index(raw) builds a byte-exact index over ASGI [(bytes, bytes)] pairs: idx.get(name), idx.items(); plus flatten_headers(headers) and normalize_headers(...).
  • Signed cookies — sign_cookie(value, key, timestamp=False), verify_cookie(value, key, max_age=None) — the same format the session middleware uses.
  • URLs — url_build(...) for fast path construction.
  • Validation — validate_plan(plan, data) evaluates compiled nyxa-forms rule plans natively; NATIVE_RULE_IDS maps rule names to the ids the native engine covers.
  • Pagination JSON — paginate_to_json(rows, meta) encodes {"data": rows, "meta": meta} when every cell is JSON-safe.
  • Graceful fallback — each helper returns None for inputs it doesn't cover (non-ASCII, quoted cookies, unusual items) and the framework transparently falls back to the Python reference — results are always identical.
  • Kill switch — NYXA_NO_SPEEDUPS=1 forces the Python implementations.

Install

pip install nyxa    # nyxa-speedups (maturin wheel) is bundled by default
# standalone: pip install nyxa-speedups

No configuration — the framework probes the module at import and uses it where available.

Public API

Module nyxa_speedups (native extension):

  • Matcher — the route-tree pyclass (see Features).
  • HeaderIndex — header-pair index: get(name) -> str | None, items() -> [(name, value)].
  • header_index(raw) — build a HeaderIndex or None.
  • parse_query(qs) — dict[str, str], last value wins.
  • parse_query_multi(qs) — repeated keys collapse to lists.
  • parse_cookies(header) — Cookie header → dict[str, str].
  • scan_headers(...) / encode_headers(...) — header scanning/serialization used by request/response paths.
  • parse_multipart(body, boundary, max_fields, max_files, max_part_size=None) — bounded multipart parse.
  • flatten_headers(headers) — str | list values → wire pairs.
  • normalize_headers(...) — header map normalization.
  • sign_cookie(value, key, timestamp=False) → signed string.
  • verify_cookie(value, key, max_age=None) → payload or None.
  • url_build(...) — fast URL construction.
  • validate_plan(plan, data) — native rule-plan evaluation or None to defer to Python.
  • paginate_to_json(rows, meta) — JSON bytes or None.
  • NATIVE_RULE_IDS — dict[str, int] of rules the native validator covers.

All functions return None on uncovered input — callers fall back to Python for full semantics.

Configuration

NYXA_NO_SPEEDUPS=1 disables all acceleration.

License

MIT

Metadata

Release files for nyxa-speedups 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nyxa-speedups 0.0.1
File Size Uploaded Provenance Actions
nyxa_speedups-0.0.1.tar.gz 38.2 kB Without provenance Details for nyxa_speedups-0.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for nyxa-speedups 0.0.1
File Actions
nyxa_speedups-0.0.1-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details for nyxa_speedups-0.0.1-cp313-abi3-win_amd64.whl
nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 abi3 Linux glibc 2.17+ x86-64 Details for nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.13 abi3 Linux glibc 2.17+ ARM64 Details for nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
nyxa_speedups-0.0.1-cp313-abi3-macosx_11_0_arm64.whl CPython 3.13 abi3 macOS 11.0+ ARM64 Details for nyxa_speedups-0.0.1-cp313-abi3-macosx_11_0_arm64.whl
nyxa_speedups-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl CPython 3.13 abi3 macOS 10.12+ x86-64 Details for nyxa_speedups-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl

Total release size: 2.5 MB

Release files / nyxa_speedups-0.0.1.tar.gz

Download URL nyxa_speedups-0.0.1.tar.gz
Size 38.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c15574d9fdcc59fcaf3f7ade162d70eda2e655a58c62b3ce102fa20a0ac0b624
BLAKE2b-256 checksum
How to use checksums
0d2b0c8fc30a05e11a786411fc3267f11e4b21c1c45bd6a0b04fa6add374aedd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_speedups-0.0.1-cp313-abi3-win_amd64.whl

Download URL nyxa_speedups-0.0.1-cp313-abi3-win_amd64.whl
Size 272.0 kB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
81865f1a31605f7dd1b4027982e77a4e04c05ee7f591c6d5461b15e0911530b6
BLAKE2b-256 checksum
How to use checksums
50cb70368f383601f48ada5535f80ac200d5b21b567096ca430630987c05dd2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 770.9 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a31b40b1b089259c92185b53a1c44223f203b96c4060e0221cf474d01071d5e3
BLAKE2b-256 checksum
How to use checksums
e667ecf6d4bd09c95a59342345774e01af461c7363f5271c3177dc223673279e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL nyxa_speedups-0.0.1-cp313-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 707.9 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7820a9e2efc8ef0101d476b10a29d911b8d51384b7b666d44edde4c5c8d1156b
BLAKE2b-256 checksum
How to use checksums
77dfd76a5dba8321a6704a1381e8c16aa31f0460472f59957e04daa6e0d744ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_speedups-0.0.1-cp313-abi3-macosx_11_0_arm64.whl

Download URL nyxa_speedups-0.0.1-cp313-abi3-macosx_11_0_arm64.whl
Size 357.9 kB
Tags CPython 3.13 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
51ca14d4bcfb88105bf99a019598f96da91fcaac214eb7e558402d35241a869b
BLAKE2b-256 checksum
How to use checksums
fc300dbed8b1bd847624c99ccd5c6e035a919dd0c5d53f8306fe3eb2127568f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nyxa_speedups-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl

Download URL nyxa_speedups-0.0.1-cp313-abi3-macosx_10_12_x86_64.whl
Size 383.6 kB
Tags CPython 3.13 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
258d0d3e044ed1604c28b65c4f0558cb34f0616f82605a92594dd66ab2d3c837
BLAKE2b-256 checksum
How to use checksums
9e86011bb861024028eff4e2addeb0497f39d85758779a791eb573f67b1ade27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for nyxa-speedups 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

6 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page