A production-quality Python CLI for code templates
Project description
PySnips
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.
Project Information
- Author: DevTools Engineer
- GitHub: anusha-b2803/pysnips
- PyPI: pypi.org/project/pysnips
- Bug Tracker: GitHub Issues
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). - IDE Integration: Install snippets natively into VS Code for "type and enter" expansion.
- Jupyter Magic: Type keywords in notebooks and expand them instantly with
%load_ext pysnips. - Zero Dependencies: Core CLI is built entirely on the Python Standard Library.
- Clean Architecture: Engineered with a modular registry system, making it easy to extend and maintain.
Installation
The easiest way to install PySnips is via pip:
pip install pysnips
To enable Jupyter Notebook support:
pip install "pysnips[notebook]"
🚀 Usage & Integration
1. VS Code Integration (Native Snippets)
Install all templates into VS Code to enable "type and enter" expansion:
pysnips install --vscode
Example: In any .py file, type linear-reg and press Enter to expand the full template.
2. Jupyter & Notebook Magic
Enable auto-expansion in your Jupyter cells:
%load_ext pysnips
# Type the keyword and run the cell to expand!
linear-reg
3. CLI Command Line
Explore and generate snippets directly:
pysnips list
pysnips for --item i --iterable "range(10)"
4. Python Library API
Use pysnips in your own scripts:
import pysnips
snippet = pysnips.get("for", item="idx")
snippet.show() # Renders beautifully in Notebooks
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 |
Click to see all 50+ templates
BASIC
for,while,if,ifelse,elif,try,tryfull,func,rfunc,listcomp,dictcomp,setcomp,lambda,maincheck,printfmt
MACHINE LEARNING
linear-reg,logistic-reg,knn,svm,decision-tree,random-forest,naive-bayes,kmeans,pca,model-eval
DEEP LEARNING
nn-basic,nn-compile,nn-train,cnn-basic,cnn-image,rnn-basic,lstm,dropout,predict,save-load-dl
ML PIPELINE
data-load,data-clean,train-test,scaler,pipeline
AI FULL-STACK
fastapi-app,route-get,route-post,ml-api,file-upload,json-response,async-api,db-connect,save-predict,logger
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
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 pysnips-0.1.4.tar.gz.
File metadata
- Download URL: pysnips-0.1.4.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eafa40d88d6b17ed27b371a3c9322c152e0093cb1b183eb212f84d72457e8d6b
|
|
| MD5 |
8a97b563267a3036ece694d55a635651
|
|
| BLAKE2b-256 |
0313efa31492d24445baef32e25ac3d943c2fe8cf6669e3b9a0f7aa25aa8003e
|
File details
Details for the file pysnips-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pysnips-0.1.4-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e69258b32fdcf66b63dd6b69273e01f2e5b6663e8b3cb1564af6b51144ad05a
|
|
| MD5 |
e37c9e1736a6e438de527a0d1975ecd2
|
|
| BLAKE2b-256 |
83f0da62584ead58ddf6b4d83735e4a034e1754c49e87358952af1e2c40d3b1e
|