Skip to main content

A production-quality Python CLI for code templates

Project description

PySnips

Python Version License: MIT Code Style: Black

PySnips is a high-performance, production-quality CLI tool designed to accelerate Python development. It provides a library of 50+ expertly crafted code templates spanning from core language syntax to advanced Machine Learning and AI Full-Stack architectures.


Key Features

  • 50+ Specialized Templates: Instantly generate boilerplate for Basic Python, ML, Deep Learning, and FastAPI.
  • Dynamic Injection: Fully customizable snippets using CLI flags (e.g., --name MyModel --lr 0.01).
  • Zero Dependencies: Built entirely on the Python Standard Library for maximum compatibility and minimal footprint.
  • Clean Architecture: Engineered with a modular registry system, making it easy to extend and maintain.
  • Developer First: Outputs clean, PEP-8 compliant code directly to your terminal or into a file.

Installation

Install the package directly from the source for development:

git clone https://github.com/yourusername/pysnips.git
cd py-pkg
pip install -e .

Quick Start

1. Explore Available Snippets

List all 50+ available commands categorized by domain:

pysnips list

2. Generate a Python Function

pysnips func --name calculate_metrics --args "data, threshold"

3. Scaffold a FastAPI Application

Generate a complete API boilerplate and save it directly to a file:

pysnips fastapi-app --title "Predictive Analytics API" > main.py

4. Build a Machine Learning Pipeline

pysnips random-forest --n_estimators 200 > train.py

Category Overview

Category Description Examples
BASIC Core Python syntax & control flow for, tryfull, listcomp
MACHINE LEARNING Scikit-learn model boilerplates svm, random-forest, pca
DEEP LEARNING Keras/TensorFlow architectures cnn-image, lstm, nn-train
ML PIPELINE Data engineering & preprocessing scaler, train-test, pipeline
AI FULL-STACK FastAPI, DB connections & Logging fastapi-app, db-connect, ml-api

Project Architecture

PySnips is built with scalability in mind:

  • pysnips/cli.py: Advanced argument parsing and UI handling.
  • pysnips/registry.py: Centralized template management system.
  • pysnips/generator.py: Regex-powered dynamic template engine.
  • pysnips/utils/: Enhanced console formatting and color support.

Deployment

To package and distribute PySnips:

  1. Build Distribution:
    python -m build
    
  2. Upload to PyPI:
    python -m twine upload dist/*
    

License

Distributed under the MIT License. See LICENSE for more information.


Built for the Python Community

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

pysnips-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

pysnips-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file pysnips-0.1.0.tar.gz.

File metadata

  • Download URL: pysnips-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for pysnips-0.1.0.tar.gz
Algorithm Hash digest
SHA256 609db8d470a366aa22ef446a6b9d5075253ee8ba61ef19f6777fa29ee7b8ef6d
MD5 3770de52b5379eb1b7d5ad8e5ed86592
BLAKE2b-256 c48515a9269581d149a63c2207f480201c8a6a1d604122b4a429f21cca536ff9

See more details on using hashes here.

File details

Details for the file pysnips-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysnips-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for pysnips-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d520f9898ca28d496cfc6c21677c4fea663604130a621ad72d8fce1f7fb5f0d
MD5 4a5ebbbdb57010d47de7f3162bbc191a
BLAKE2b-256 193d1dc03c1e6b27945421197978be03aa7634f3b8dac3b93ebc52431c262d7f

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