A comprehensive Python developer infrastructure toolkit
Project description
Infrakit
Infrakit is a comprehensive, modular developer infrastructure toolkit for Python projects. It provides CLI utilities, rich project scaffolding, a robust multi-provider LLM client, dependency management, profiling, and core utilities for logging and configuration.
Installation
Install via pip:
pip install infrakit
# or if using uv
uv pip install infrakit
The CLI is exposed as infrakit and conveniently aliased as ik.
Key Features
1. Project Scaffolding (ik init)
Quickly bootstrap new Python projects with standardized layouts, ready-to-use boilerplate, and optional LLM integration. Existing files are safely skipped if you re-run over a directory.
ik init my-project -t basic
ik init my-fastapi-app -t backend -v 0.1.0
ik init my-ai-tool -t ai --include-llm
Available Templates:
basic: Minimal template (src, utils, tests).backend: FastAPI service (app, routes, middleware, Dockerfile, docker-compose).cli_tool: Distributable CLI application using Typer.pipeline: Data pipeline / ETL template (extract, transform, load, enrich).ai: AI/ML project optimized for notebooks and pipelines.
2. Multi-provider LLM Client (infrakit.llm)
A unified LLM client interface supporting OpenAI and Gemini. Built natively for robust production use cases, particularly when navigating free-tier API quotas.
Features:
- Seamless key rotation and persistent storage tracking.
- Local rate limiting (RPM/TPM gates).
- Async and multi-threaded batch generation.
- Structured output parsing and schema validation using
pydantic.BaseModel.
Quick Start:
from infrakit.llm import LLMClient, Prompt
client = LLMClient(keys={"openai_keys": ["sk-..."], "gemini_keys": ["AIza..."]}, storage_dir="./logs")
response = client.generate(Prompt(user="What is the capital of France?"), provider="openai")
print(response.content)
LLM CLI tools: Monitor and control limits right from the CLI.
ik llm status --storage-dir ./logsik llm quota set --provider openai --key sk-abc --rpm 60 --storage-dir ./logs
3. Dependency Management (infrakit.deps)
In-depth Python dependency tools available under ik deps (or programmatically via infrakit.deps) to clean, health-check, scan, and optimize dependencies.
Features:
scan(root): Scan your project for actual Python dependencies used in code.export(): Export used dependencies to updaterequirements.txtorpyproject.tomlautomatically.check(packages): Run health, security, and outdated checks on packages.clean(): Find and remove unused packages from the virtual environment.optimise(): Optimize and format imports across the project (integrates withisort).
4. Code Profiling (infrakit.time)
Lightweight timing and execution profiling for your Python projects.
CLI Usage: Profile any script instantly to detect performance bottlenecks.
ik time run script.py --max-functions 30 --min-time 1.0
Decorator Usage: Track specific pipeline steps inside your code:
from infrakit.time import pipeline_profiler, track
@pipeline_profiler("Data Processing Pipeline")
def main():
load_data()
transform_data()
@track(name="Load Step")
def load_data(): pass
5. Core Utilities (infrakit.core)
Convenient implementations for common application needs.
- Config Loader (
infrakit.core.config.loader): Multi-format configuration loader supporting JSON, YAML, INI, and.env. Automatically resolves variables usingpython-dotenvand converts types properly natively. - Logger (
infrakit.core.logger): Unified logging setups for consistent output across applications.
from infrakit.core.logger import setup, get_logger
setup(level="INFO", strategy="date_level", stream="stdout")
log = get_logger(__name__)
log.info("Ready")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_infrakit_dev-0.1.1.tar.gz.
File metadata
- Download URL: python_infrakit_dev-0.1.1.tar.gz
- Upload date:
- Size: 121.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5e39dc477b83608859677627bcf01bdd743d475cba6c799021221cb7ad9d9bf
|
|
| MD5 |
02816078a6a5bc56b83ab6e42da19b72
|
|
| BLAKE2b-256 |
29bbb756d8131992c051d9e368983344cae1a666d82761ec384ef35102d052d2
|
File details
Details for the file python_infrakit_dev-0.1.1-py3-none-any.whl.
File metadata
- Download URL: python_infrakit_dev-0.1.1-py3-none-any.whl
- Upload date:
- Size: 128.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b798cd6657338d9cad1cc4f8d5af5f59bbeb4a7a2c3017b8cf460ae75f56a9c
|
|
| MD5 |
3aa94c3d8eab969dc15a49f72229983b
|
|
| BLAKE2b-256 |
82e872a465109da1131b3087f183b46e4b73bd078f5b775427e0f0a93a4d91ba
|