CLI to scaffold a default Python service structure
Project description
๐ PyServInit - Project Bootstrapper
pyservinit is a Python-based utility script for initializing a backend project with a standardized structure. It creates directories, touches empty boilerplate files, and copies template files into a new project folder.
๐ฆ Features
- Creates a structured directory tree for a new project.
- Populates essential files (
Dockerfile,docker-compose.yaml,main.py, etc.). - Loads content from
.templatefiles bundled inpyservinit.templates. - Automatically sets executable permissions for shell scripts.
- Easy to use via command line.
๐ Project Structure Created
<project-name>/
โโโ docker-compose.yaml
โโโ Dockerfile
โโโ requirements.txt
โโโ push.sh
โโโ data/
โ โโโ request_data/
โ โโโ sample_data/
โโโ src/
โ โโโ api/
โ โ โโโ __init__.py
โ โ โโโ api.py
โ โโโ config/
โ โ โโโ __init__.py
โ โ โโโ constants.py
โ โโโ core/
โ โ โโโ __init__.py
โ โโโ main.py
โ โโโ mapper_classes/
โ โ โโโ __init__.py
โ โ โโโ input_classes.py
โ โ โโโ output_classes.py
โ โโโ misc/
โ โโโ tests/
โ โ โโโ __init__.py
โ โโโ utils/
โ โโโ __init__.py
โ โโโ utils.py
๐ Usage
python path/to/pyservinit.py <project-name>
Example:
python pyservinit.py my-backend-service
If my-backend-service already exists, the script will abort to prevent overwriting.
๐ Templates
The script relies on templates stored in pyservinit.templates (an importable Python package resource).
Files like these are included:
Dockerfile.templatemain.py.templatepush.sh.template- etc.
You can add more .template files to the pyservinit/templates/ directory and either:
- Map them explicitly in
DESTINATION_MAP - Or have them default to
src/misc/<template-name>after removing.template
๐งฉ Dependencies
Ensure pyservinit.templates is installed or accessible as a Python package.
๐ Notes
- It is suitable for backend services in microservice-style architectures or for setting up ML inference services.
- Shell script files (e.g.,
push.sh) are made executable automatically by the script.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyservinit-0.1.3.tar.gz.
File metadata
- Download URL: pyservinit-0.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
392cc2eaef17e240cbc61f6afbad8c68ea6aea0de51b9a0eaa14abc31a9a4ad4
|
|
| MD5 |
28ef8c8dff4a611563116c231389b8e5
|
|
| BLAKE2b-256 |
206dc0ac0e3fb85f0c91938f1d11e7d54340f07eabd2f5bdf49b392bc06c3bc5
|
File details
Details for the file pyservinit-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pyservinit-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19f87d707ef9d319470ffb6e006ba495ce2e2ecb7d71c5dfdc9eabe5ccfd7e47
|
|
| MD5 |
2066dd759725028578d33dc1544f58fc
|
|
| BLAKE2b-256 |
4ce231d5ced68fcbf20476574d84038480c53b05def3b08ed4561b109ae847e2
|