Skip to main content

A lightweight code snippet management system with CLI, API, and web interface

Project description

Snipster

PyPI version Python Version License: MIT Downloads Downloads Code style: black

GitHub stars GitHub issues

Tests codecov

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

uv installation link

Don't have uv? Install it with: curl -LsSf https://astral.sh/uv/install.sh | sh
Learn more at https://github.com/astral-sh/uv

Installation

Using pip (recommended for most users)

pip install snipster-app

Using uv (faster alternative)

uv pip install snipster-app

From source

git clone https://github.com/sl2902/snipster.git
cd snipster
uv venv --python 3.13
uv pip install -e .

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

Run app locally

uv run snipster-web

Requirements

  • Python 3.13+
  • uv (Recommended) or pip package manager
  • 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: GitHub

License

MIT License

Author

Sun - GitHub

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

snipster_app-0.1.6.tar.gz (112.9 kB view details)

Uploaded Source

Built Distribution

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

snipster_app-0.1.6-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file snipster_app-0.1.6.tar.gz.

File metadata

  • Download URL: snipster_app-0.1.6.tar.gz
  • Upload date:
  • Size: 112.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.13

File hashes

Hashes for snipster_app-0.1.6.tar.gz
Algorithm Hash digest
SHA256 674b39beb4d8e68b77e71c1a0596135c6ac599d77fa5273f1b28e265e1f6bab9
MD5 4cf94e91b6585c530550c64ea35d6102
BLAKE2b-256 61af0ba933a22d7cf427a204d22d462e4b99fe015ca3a7dac21f37bf13eb0b19

See more details on using hashes here.

File details

Details for the file snipster_app-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for snipster_app-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 37f5760cf154fef1e9672d8e732aa2c8955d00fcb6bac28b3504865df01e0700
MD5 dc3a52e2b40ccaa4eebe33a740e8c9ea
BLAKE2b-256 6929afd8106f729c7488a4373dcf35c64125cd82e6444917cb693ce3272be917

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