Skip to main content

GM Scaffold

Project description

Latest Version Supported Python versions Downloads

gmscaffold

1. Preparing the Development Environment

1.1 Introduction

A scaffolding tool helps you quickly generate the basic structure of a project. With a simple command, it can automatically create project directories, configuration files, and initialization code, saving you the hassle of manual setup.

In this system, you can use the command-line tool gmcli to quickly create a standardized application project structure, enabling you to start development efficiently.


1.2 Environment Setup

Install Python Environment

  • Install Python 3.10 or later Visit the official Python website to download and install the appropriate version for your operating system.

    ⚠️ Currently, the scaffolding tool supports Python 3.10 and above only.

  • Install pip (Python package manager) Most systems come with pip pre-installed. If not, please refer to the official pip documentation for installation instructions.


1.3 Install the Scaffolding Tool

Install the CLI tool via pip:

pip3 install gmscaffold

Once installed, you can use the gmcli command to create your project.


2. Generate a Project with the Scaffold

2.1 Create a New Scaffolded Project

Run the following command to generate the project structure:

gmcli gm_app create_app

💡 Tip: The project will be created in the current working directory, so make sure you cd into the desired path first.


Example Output:

➜  ~ gmcli gm_app create_app

     _/_/_/  _/      _/    _/_/_/    _/_/_/  _/    _/
  _/        _/_/  _/_/  _/        _/        _/    _/
 _/  _/_/  _/  _/  _/    _/_/      _/_/    _/_/_/_/
_/    _/  _/      _/        _/        _/  _/    _/
 _/_/_/  _/      _/  _/_/_/    _/_/_/    _/    _/

Please enter the project name: example
Please enter the author name: xxx
Please enter contact email: xxx@163.com
Please enter the project version: 0.0.1
Please enter the project description: example
DEBUG:GmScaffold:[example] create_gm_app successfully

2.2 Command Parameters

Parameter Description
gm_app create_app Create a new scaffolded project

2.3 Project Structure

After execution, the following structure will be generated:

example/
├── app/
│   ├── consts/           # Constants (e.g., status codes, config keys)
│   ├── i18n/             # Internationalization (default: English & Chinese)
│   ├── middlewares/      # Middleware modules (e.g., auth, request handlers)
│   ├── schemas/          # Data validation schemas
│   ├── services/         # Business logic
│   ├── utils/            # Utility functions (e.g., logging, tools)
│   └── __init__.py
├── config.yaml           # Configuration file (logs, ports, etc.)
├── install.sh            # Optional install script (e.g., Redis, MySQL)
├── main.py               # Application entry point
├── makefile              # Build or packaging script
├── requirements.txt      # Python dependencies list
├── .gitignore            # Git ignore settings
├── ReadMe.md             # Project documentation

Key File Descriptions:

  • main.py: Entry point of the application
  • install.sh: Optional script to install external services (e.g., Redis, MySQL)
  • config.yaml: Centralized configuration management (port, logs, DB, etc.)
  • requirements.txt: Python dependencies list (can also use poetry)

2.4 Usage & Extension

The generated project serves as a general-purpose API service template and can be extended for various business scenarios:

  • ✅ Can be used with simplejrpc SDK to quickly build JSON-RPC services
  • ✅ Also supports standalone use with custom business logic and structure

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

gmscaffold-1.0.8.tar.gz (113.5 kB view details)

Uploaded Source

Built Distribution

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

gmscaffold-1.0.8-py3-none-any.whl (165.2 kB view details)

Uploaded Python 3

File details

Details for the file gmscaffold-1.0.8.tar.gz.

File metadata

  • Download URL: gmscaffold-1.0.8.tar.gz
  • Upload date:
  • Size: 113.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for gmscaffold-1.0.8.tar.gz
Algorithm Hash digest
SHA256 f2505dd93c0a9b880aa4bbfeee22129782d93928ff051708a0152cad808de7cf
MD5 f04d4eaf44587d7a28ea0f6ca21930eb
BLAKE2b-256 e14b8ae42c123ac4d77728045e267c002dcee5fa517141287ccca91029e45bc3

See more details on using hashes here.

File details

Details for the file gmscaffold-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: gmscaffold-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 165.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for gmscaffold-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 536131030b3384ecb3ba3e0b02a2eb3d33aeb38baaa1f5bdfda97aa479ee8b63
MD5 4f30ab9b5757965fc0d95e9666347e0c
BLAKE2b-256 bbe5657efa38d2fa90f1cc3e2e9ee7db4472595598f09c748e0856da9b2df463

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