Skip to main content

Service Template Project

A Python-based service template designed to streamline the creation of scalable, well-structured microservices. This project provides a robust starting point for building RESTful APIs, complete with best practices for code organization, logging, dependency management, and more.

Features

  • 📂 Clean Architecture: Predefined folder structure for easy scalability and maintainability.
  • ⚙️ Customizable CLI: Includes a CLI for generating services with click and rich formatting.
  • 🔧 Built-in Tools:
    • FastAPI for API development.
    • SQLModel for database interactions.
    • Uvicorn for fast and efficient server hosting.
  • 📜 Logging: Centralized and configurable logging system.
  • 🧪 Pre-configured Testing: Pytest setup with sample tests.
  • 🐳 Dockerized: Ready-to-use Dockerfile for containerized deployments.
  • 🛠️ CI/CD Ready: Includes a Makefile and GitHub pre-commit hooks for formatting and linting (isort, black, mypy, flake8).
  • 📖 Configuration: Environment management via .env files.

Getting Started

Prerequisites

  1. Python 3.10+ installed.

Installation

  1. Install the package:

    python -m pip install service-template
    

Running the template

  1. Create and enter your project directory:

    mkdir new-project
    cd new-project
    
  2. Create your project directory:

    service-template init
    

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/your-feature.
  3. Commit your changes: git commit -m "Add your feature".
  4. Push to the branch: git push origin feature/your-feature.
  5. Open a pull request.

Release files for service-template 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for service-template 0.2.0
File Size Uploaded
service_template-0.2.0.tar.gz 66.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for service-template 0.2.0
File Interpreter ABI Platform
service_template-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 69.9 kB

Release files / service_template-0.2.0.tar.gz

Download URL service_template-0.2.0.tar.gz
Size 66.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ab9e26d944b4161cbac6969cbb4821a7a98ec95a9f9ccf7ea06242a6bf3775f9
BLAKE2b-256 checksum
How to use checksums
90670419440ce43bc373ca4a9bc1a43224a7ecb29636a071a5a6f2ab920325b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / service_template-0.2.0-py3-none-any.whl

Download URL service_template-0.2.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9adc449ef6a71d566627cc1fc22af1583ddda43ad6107815d27fb2d7c6b6819b
BLAKE2b-256 checksum
How to use checksums
00db1408e8d786dc494d16d5bce8ec67b51540222fb40372b91c7585f7a7649e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page