Skip to main content

Python service scaffolding with zero learning curve

Project description

kraft

Python service scaffolding with zero learning curve.

Installation

Using uvx (recommended - no installation needed)

uvx kraft

Using uv tool (persistent installation)

uv tool install kraft-cli
kraft create my-api

Using pipx (if you have it)

pipx install kraft-cli
kraft create my-api

Using pip (traditional installation)

If you get "externally managed environment" error, try:

# Option 1: Install to user directory
pip3 install --user kraft-cli
kraft create my-api

# Option 2: Use pipx (install it first if needed)
pip3 install --user pipx
pipx install kraft-cli
kraft create my-api

# Option 3: Use a virtual environment
python3 -m venv ~/kraft-env
source ~/kraft-env/bin/activate
pip3 install kraft-cli
kraft create my-api

Note: If you get "externally managed environment" error with pip, use uvx or uv tool install instead.

Usage

Create a REST service

# Using uvx (no install needed)
uvx kraft-cli create my-api

# Or if you installed with uv tool/pipx
kraft create my-api

Then run it:

cd my-api
docker-compose up --build

Your API is now running at http://localhost:8000/books

Add PostgreSQL database

kraft add postgres
# or: uvx kraft-cli add postgres

Create with add-ons in one command

kraft create my-api --with postgres

List available templates and add-ons

kraft list      # Show templates
kraft addons    # Show add-ons

Shell Completion (Optional)

kraft --install-completion zsh

Restart your shell to enable Tab completion for commands and options.

Development

Setup

Using uv (recommended):

uv sync --extra dev

Using pip:

pip install -e ".[dev]"

Running Tests

# With uv
uv run pytest

# With pip (after activating venv)
pytest

Linting

# With uv
uv run ruff check src/

# With pip (after activating venv)
ruff check src/

Type Checking

# With uv
uv run mypy src/

# With pip (after activating venv)
mypy src/

License

MIT

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

kraft_cli-0.2.1.tar.gz (67.4 kB view details)

Uploaded Source

Built Distribution

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

kraft_cli-0.2.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file kraft_cli-0.2.1.tar.gz.

File metadata

  • Download URL: kraft_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 67.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.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}

File hashes

Hashes for kraft_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a20533ef09c20fc5fc3bc7d994524f1648a2dede368d1bd8fc1473a6900b1a61
MD5 2ec2d6375b72a9ac7b21259180332ebe
BLAKE2b-256 1170a48b00fe345b097cd619f591c4459c6d7881a5712e5be76aa7ff1b12970a

See more details on using hashes here.

File details

Details for the file kraft_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: kraft_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.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}

File hashes

Hashes for kraft_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23715908dd6ddadc59876ed63f2275e378f0f52be34ae01ba16380916db5ac05
MD5 a4dba78b298477afba95e262af990d2b
BLAKE2b-256 a889cfa0857771f717073db1e0021dd17de33e81954e8f5cb6a3565c19c4d8ff

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