A lightweight code snippet management system with CLI, API, and web interface
Project description
Snipster
A lightweight, developer-friendly code snippet management system
Snipster helps developers organize, search, and manage code snippets efficiently through both a CLI and API interface. Built with FastAPI, SQLModel, and Typer.
Features
✨ Multiple Interfaces
- 🖥️ Command-line interface (CLI) for quick snippet management
- 🌐 REST API for integration with other tools
- 📊 Streamlit web interface for visual browsing
🔍 Powerful Search
- Full-text search across titles, code, descriptions, and tags
- Filter by programming language
- Toggle favorites for quick access
📝 Rich Metadata
- Support for Python, JavaScript, and TypeScript
- Tagging system for organization
- Automatic timestamps for creation and updates
- Favorite snippets for quick retrieval
Installation
pip install snipster-app
Quick Start
CLI Usage
# Add a snippet
snipster add --title "Quick Sort" --code "def quicksort(arr): ..." --language Python --tags "algorithm,sorting"
# List all snippets
snipster list
# Search snippets
snipster search --term "sort" --language Python
# Get specific snippet
snipster get --snippet-id 1
# Toggle favorite
snipster favourite --snippet-id 1
# Delete snippet
snipster delete --snippet-id 1
Python API
from snipster import Language, Snippet
# Create a snippet
snippet = Snippet(
title="Hello World",
code="print('Hello, World!')",
language=Language.PYTHON,
tags="beginner,tutorial"
)
REST API
Start the API server:
# The API runs as a separate service
uvicorn snipster.api.main:app --reload
Endpoints available at http://localhost:8000/docs
Requirements
- Python 3.13+
- SQLite (included)
Use Cases
- 💼 Interview Prep - Store commonly used algorithms and patterns
- 🎓 Learning - Organize code examples from tutorials
- 🔧 Daily Development - Quick access to utility functions and snippets
- 📚 Team Knowledge Base - Share snippets via API
Documentation
Full documentation available at: [your-docs-url]
License
MIT License
Contributing
Contributions welcome! Visit [your-repo-url] for guidelines.
Author
Sun - [sl2902]
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 snipster_app-0.1.1.tar.gz.
File metadata
- Download URL: snipster_app-0.1.1.tar.gz
- Upload date:
- Size: 112.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
415b94d57ec6798986468da1bf05e4b451d789265330c9ac967a1ca8d54180e6
|
|
| MD5 |
ba2e422838a6ea75c8929ba48caa37a2
|
|
| BLAKE2b-256 |
dee5750354824393c4aaf5f0c49d3387cb098d3465ddfba6ef14303b3076f260
|
File details
Details for the file snipster_app-0.1.1-py3-none-any.whl.
File metadata
- Download URL: snipster_app-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6346693358b9fa58d01022f7ef4d245701ee88a6207c70bb542201fbd636fe1c
|
|
| MD5 |
d7e7a654fe90419fc7f5eb4e6db41019
|
|
| BLAKE2b-256 |
3380d60957d41aab7ae97acdba766c2903fb0566b16b5ef8e3fce48d8d3ac498
|