Skip to main content

CLI for services template for Python (FastAPI, SQLAlchemy, Alembic)

Project description

Skeletone

A minimal, well-structured Python project skeleton and micro-framework for rapid backend development.
Built on top of FastAPI, SQLAlchemy, and Alembic with automated template versioning and logging.

Features

  • ๐Ÿš€ FastAPI foundation with modern Python async practices
  • ๐Ÿ—„๏ธ SQLAlchemy (async) ORM with Alembic migrations
  • ๐Ÿงฉ Minimal framework structure with clear folder layout
  • ๐Ÿ“ฆ Template management: init, upgrade, downgrade, version lock
  • ๐Ÿ“„ Patch-based updates between template versions
  • ๐Ÿ” Incremental version tracking via skeletone.lock
  • ๐Ÿ“Š Request logging: Incoming API requests are logged to a database
  • ๐Ÿงพ Custom logging module for easy integration and extension
  • โšก Quick setup - get started in seconds

Installation

pip install skeletone

Quick Start

1. Initialize a New Project

mkdir my-awesome-api && cd my-awesome-api
skeletone init

2. Check Available Versions

skeletone versions

3. Upgrade Your Project

skeletone upgrade

4. Rollback if Needed

# Interactive version selection
skeletone downgrade

# Or specify version directly
skeletone downgrade -v v1.2.0

CLI Commands

Command Description
skeletone init Initialize new project from latest template
skeletone upgrade Upgrade to latest template version
skeletone downgrade Downgrade to a previous template version
skeletone versions List all available template versions
skeletone help Show detailed help and usage examples

How It Works

Skeletone is built around a patch-based versioning system:

  • Init: Sets up a fresh project from the latest template
  • Upgrade: Applies sequential .patch diffs to upgrade your project
  • Downgrade: Applies reverse patches to safely revert
  • Track: Saves current version to skeletone.lock

Template Highlights

The generated project includes:

your-project/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ models/         # SQLAlchemy models (async)
โ”‚   โ”œโ”€โ”€ routes/         # FastAPI route handlers
โ”‚   โ”œโ”€โ”€ dependencies/   # DI system
โ”‚   โ””โ”€โ”€ logging/        # Logging logic
โ”œโ”€โ”€ alembic/            # Database migrations
โ”œโ”€โ”€ config.py           # App settings
โ”œโ”€โ”€ main.py             # FastAPI application entrypoint
โ”œโ”€โ”€ requirements.txt    # Dependencies
โ””โ”€โ”€ skeletone.lock      # Template version lock file

Logging System

Skeletone includes:

  • ๐Ÿ“ฅ Request logger: Automatically logs all incoming HTTP requests (path, method, status, timestamp)
  • ๐Ÿงพ Logging module: Easily extendable and stored logs in the database
  • ๐Ÿ” Useful for debugging, monitoring, and auditing

All logging is asynchronous, just like the rest of the application.

Example Workflow

# Create and initialize a new project
mkdir blog-api && cd blog-api
skeletone init

# Do your development work...

# Upgrade to latest version
skeletone upgrade

# Check available versions
skeletone versions

# Rollback if needed
skeletone downgrade -v v1.1.0

Version Table Example

Available Skeletone Versions
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Version โ”‚ Status      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ v1.3.0  โ”‚ โœ… Current   โ”‚
โ”‚ v1.2.0  โ”‚             โ”‚
โ”‚ v1.1.0  โ”‚             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Best Practices

  1. Always commit your code before upgrade/downgrade
  2. Review diffs and changes after updating
  3. Thoroughly test after version transitions
  4. Track your modifications to avoid patch conflicts

Template Repository

The base template for Skeletone lives here:
๐Ÿ‘‰ https://github.com/yoursteacup/skeletone

Contributing

Contributions are welcome! Please see the GitHub repo for guidelines and issue tracking.

Author

Developer: Zhaxybayev Daulet
GitHub: yoursteacup

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

skeletone-0.1.11.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

skeletone-0.1.11-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file skeletone-0.1.11.tar.gz.

File metadata

  • Download URL: skeletone-0.1.11.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for skeletone-0.1.11.tar.gz
Algorithm Hash digest
SHA256 383251db7f6ddfb366fc2e647583f4c9a42b4c7ffb67bbdb062ec4dbb9cec5e0
MD5 1afe4f9d4e6eca37c9cf780cefc5e426
BLAKE2b-256 652932310949e3e9634a2af7ecab4873a860d0e115429537e815733836573b1b

See more details on using hashes here.

File details

Details for the file skeletone-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: skeletone-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for skeletone-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 d5185859f022b1e66fc27cfb437f58a491d1f14c3265b966a24d3ee497e91f15
MD5 00e5d7c536ba6ed4099e49564e553d5e
BLAKE2b-256 4d783e1073227d381ba3ab0898d066b68c99c5e8b7682b0aee2628dae94cdf55

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