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.10.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.10-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skeletone-0.1.10.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.10.tar.gz
Algorithm Hash digest
SHA256 81b3c7a5b07a01d9593798138321e22ee0847d53301e64a0352a1ffc6ab32b1d
MD5 5fd533815195ee7958d14cbcc6c59975
BLAKE2b-256 25276e700ac4c6d42a09986e102a514e49ef200ed6d9d053d439757e113362db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skeletone-0.1.10-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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 75f10c2583dfe4333bf75163d6f68b4bf6ad03fd4e0de905624664c106e1ba77
MD5 29034813fcb3c87748b86109e5210b19
BLAKE2b-256 cd3f5e95b742298abf069d2027633b1e9ae12d468a62b82db47148e2979c210a

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