Skip to main content

A deep infrastructure library for Python 3.14+ focused on extreme startup time optimization via lazy imports and speculative loading.

Project description

Zenith

Python Version License Status

Zero-latency boot infrastructure for Python applications.

Zenith is a deep infrastructure engine designed to eliminate startup latency in Python CLI tools, desktop applications, and serverless environments. By leveraging Python 3.14's free-threading capabilities and automated lazy loading, Zenith speculatively pre-loads your heavy dependencies in the background, resulting in near-instant application boot times.


How It Works

Zenith operates transparently beneath Python's import system using two key architectural components:

  1. MetaPathFinder Interceptor (ZenithLazyFinder): Implements a low-overhead import hook in sys.meta_path to intercept module import requests. Instead of performing slow, synchronous loading of heavy packages at boot time, it returns custom lazy modules (ZenithLazyModule).
  2. Speculative Pre-loading Engine (SpeculationEngine): Operates on an isolated background thread utilizing Free-Threading (PEP 703) available in Python 3.14+. It loads heavy modules concurrently without incurring the Global Interpreter Lock (GIL) overhead, resolving dependencies before your main thread even requests them.

Performance Benchmark

The following benchmark demonstrates boot time comparison when loading heavyweight libraries (such as multiprocessing, urllib, sqlite3, and parsed XML structures):

Environment Boot Time Speedup
Native Python ~0.15s Baseline
Zenith (Warm Cache) ~0.04s 70% faster

Installation

Please note that while the package is installed as alenia-zenith, the import statement in your Python code remains zenith.

pip install alenia-zenith

Quick Start

Initialize Zenith at the absolute top of your application's entrypoint before any other imports:

import zenith
zenith.ignite()

# Your heavy imports go here (will be processed lazily & speculatively)
import pandas
import numpy

Configuration

Zenith automatically generates a lightweight, persistent dependency graph file in the root of your project:

  • .zenith_cache.json: This file records actual module usage during execution. On subsequent boots, the SpeculationEngine reads this cache to proactively queue and pre-load modules on background threads, ensuring instant availability.

License

Distributed under the ALENIA STUDIOS TOOL LICENSE Version 1.0. See LICENSE for more information.

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

alenia_zenith-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

alenia_zenith-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file alenia_zenith-0.1.0.tar.gz.

File metadata

  • Download URL: alenia_zenith-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for alenia_zenith-0.1.0.tar.gz
Algorithm Hash digest
SHA256 271da278285aaca70acdcdecb06e5a05a5c559963dd6b0b16c1621cacf6a1196
MD5 7e9647ad4ed18828fccffeacb847ec61
BLAKE2b-256 339f05ece035d897a5320812f2e1b6b7e60ff663bef2b1211607243cde144f46

See more details on using hashes here.

File details

Details for the file alenia_zenith-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: alenia_zenith-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for alenia_zenith-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12eb4f960de53f2efdaebf35d628d9caad72d6903cf6ca2dc524d569780ad91d
MD5 0e18a6f2af7badb9f806c7759f3aca7d
BLAKE2b-256 662e588a0559bee0e455ef4cfaded97e35ca3f8ef77d7f4951c66bac4a823f10

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