Skip to main content

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 ./logs
  • ik 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 update requirements.txt or pyproject.toml automatically.
  • 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 with isort).

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 using python-dotenv and 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

python_infrakit_dev-0.1.2.tar.gz (121.1 kB view details)

Uploaded Source

Built Distribution

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

python_infrakit_dev-0.1.2-py3-none-any.whl (128.2 kB view details)

Uploaded Python 3

File details

Details for the file python_infrakit_dev-0.1.2.tar.gz.

File metadata

  • Download URL: python_infrakit_dev-0.1.2.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

Hashes for python_infrakit_dev-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e3c0c13e8c3b91ca92f569fa86648609767c218e30b9a5da4a2ab04f1d842433
MD5 c64606c3593c906045f83070225272a4
BLAKE2b-256 03602ffd9b0462be332721f96a43c290ff53f46d3c79bd789aee3b4c8a9908c1

See more details on using hashes here.

File details

Details for the file python_infrakit_dev-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: python_infrakit_dev-0.1.2-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

Hashes for python_infrakit_dev-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e31314a7c02561bd3c35f5949c70bfcf6227a786ff2fab17430fcfa4c437afc
MD5 ffa819eaff63436653ebdbf88683a2b0
BLAKE2b-256 2f4dfdf0ca72f36b09026699db72b5a4339cb2d9a776cc15059caddecd64b79b

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