Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ labels: bug

- OS:
- Python version (`python --version`):
- snack-stash version (`pip show snack-stash | grep Version`):
- python-snacks version (`pip show python-snacks | grep Version`):
- Install method: <!-- pipx / pip / editable -->
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # required for OIDC trusted publishing

steps:
- name: Download build artifacts
Expand All @@ -62,7 +64,6 @@ jobs:
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
verbose: true

# ── 4. Create GitHub Release and attach artifacts ───────────────────────────
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Snack Stash
# python-snacks

A personal CLI tool for managing a local stash of reusable Python code snippets. Browse, copy, and curate snippets across projects with a single command.

```bash
pipx install snack-stash
pipx install python-snacks
snack stash create default ~/snack-stash
snack unpack auth/google_oauth.py
```
Expand All @@ -14,16 +14,22 @@ snack unpack auth/google_oauth.py

**Recommended (pipx):**
```bash
pipx install snack-stash
pipx install python-snacks
```

**Alternative (pip):**
```bash
pip install snack-stash
pip install python-snacks
```

Requires Python 3.10+.

**Updating:**
```bash
pipx upgrade python-snacks # if installed with pipx
pip install --upgrade python-snacks # if installed with pip
```

---

## Configuration
Expand Down
7 changes: 4 additions & 3 deletions snacks/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def _version_callback(value: bool) -> None:
if value:
version = importlib.metadata.version("python-snacks")
typer.echo(f"snack-stash v{version}")
typer.echo(f"python-snacks v{version}")
raise typer.Exit()


Expand Down Expand Up @@ -68,7 +68,7 @@ def list_snacks(
snippets = sorted(
p.relative_to(stash).as_posix()
for p in stash.rglob("*.py")
if not p.name.startswith("_")
if not any(part.startswith(("_", ".")) for part in p.relative_to(stash).parts)
)
if category:
snippets = [s for s in snippets if s.startswith(f"{category}/")]
Expand All @@ -84,7 +84,8 @@ def search(
matches = sorted(
p.relative_to(stash).as_posix()
for p in stash.rglob("*.py")
if keyword.lower() in p.name.lower() and not p.name.startswith("_")
if keyword.lower() in p.name.lower()
and not any(part.startswith(("_", ".")) for part in p.relative_to(stash).parts)
)
typer.echo("\n".join(matches) if matches else f"No snippets matching '{keyword}'.")

Expand Down
6 changes: 3 additions & 3 deletions wiki/Home.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Snack Stash
# python-snacks

A personal CLI tool for managing a local stash of reusable Python code snippets. Copy snippets in and out of projects with a single command, and manage multiple named stashes.

## Quick Start

```bash
# Install
pipx install snack-stash
pipx install python-snacks

# Create your first stash
snack stash create default ~/snack-stash
Expand Down Expand Up @@ -35,5 +35,5 @@ snack pack auth/google_oauth.py

## Links

- [PyPI — snack-stash](https://pypi.org/project/snack-stash/)
- [PyPI — python-snacks](https://pypi.org/project/python-snacks/)
- [GitHub Repository](https://github.com/kickash/python-snacks)
10 changes: 5 additions & 5 deletions wiki/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
[pipx](https://pipx.pypa.io) installs CLI tools in isolated environments so they don't conflict with your project dependencies.

```bash
pipx install snack-stash
pipx install python-snacks
```

## Alternative: pip

```bash
pip install snack-stash
pip install python-snacks
```

If you want it available globally, use `pip install --user snack-stash` or install inside a virtual environment you always activate.
If you want it available globally, use `pip install --user python-snacks` or install inside a virtual environment you always activate.

## Verify

Expand All @@ -44,9 +44,9 @@ Commands:
## Upgrading

```bash
pipx upgrade snack-stash
pipx upgrade python-snacks
# or
pip install --upgrade snack-stash
pip install --upgrade python-snacks
```

New versions are published to PyPI automatically when a `v*` tag is pushed to the repository.
Expand Down
Loading