Skip to main content

lestash

PyPI version GitHub

Core CLI and plugin system for Le Stash - a personal knowledge base that aggregates content from multiple sources into a unified, searchable database.

Note: For project overview, features, and quick start guide, see the GitHub repository.

Installation

uv add lestash

Or install the full workspace from the repository root:

uv sync --all-packages

CLI Commands

Items

# List all items (with date/time and resolved author names)
lestash items list

# Filter by source
lestash items list --source linkedin

# Search items
lestash items search "query"

# Show item details (includes reaction/comment target URLs)
lestash items show <id>

# Export items to JSON
lestash items export --output backup.json

# Create a Micro.blog draft from an item
lestash items draft <id> --output ~/blog/content/drafts/

Profiles

Map person URNs (e.g., LinkedIn) to human-readable names and profile URLs:

# Add a profile mapping
lestash profiles add "urn:li:person:abc123" --name "John Doe" --url "https://linkedin.com/in/johndoe"

# List all profiles
lestash profiles list

# Show a specific profile
lestash profiles show "urn:li:person:abc123"

# Remove a profile
lestash profiles remove "urn:li:person:abc123"

When profiles are configured, items list and items search display names instead of URNs, and items show includes the profile URL.

Sources

# List configured sources
lestash sources list

# Sync all sources
lestash sources sync

# View sync history
lestash sources history

Configuration

# Show current config
lestash config show

# Initialize config file
lestash config init

# Set a config value
lestash config set logging.level DEBUG

Plugin Architecture

Le Stash uses entry points for plugin discovery. Plugins implement the SourcePlugin base class:

from lestash.plugins.base import SourcePlugin
from lestash.models.item import ItemCreate

class MySource(SourcePlugin):
    name = "my-source"
    description = "My custom data source"

    def get_commands(self) -> typer.Typer:
        """Return Typer app with source-specific commands."""
        app = typer.Typer()
        # Add commands...
        return app

    def sync(self, config: dict) -> Iterator[ItemCreate]:
        """Fetch items from the source."""
        yield ItemCreate(
            source_type="my-source",
            source_id="unique-id",
            content="Item content",
        )

Register the plugin in pyproject.toml:

[project.entry-points."lestash.sources"]
my-source = "my_package:MySource"

Data Model

Item

The core unit of content:

Field Type Description
id int Auto-generated primary key
source_type str Plugin identifier (e.g., "arxiv", "linkedin")
source_id str Unique ID within the source
url str Optional URL to original content
title str Optional title
content str Main text content
author str Optional author
created_at datetime When the content was created
is_own_content bool Whether user authored this
metadata dict Source-specific data (JSON)
parent_id int Optional FK to parent item (for grouping children)

Database

SQLite database with:

  • items - Main content table with unique constraint on (source_type, source_id) and optional parent_id for hierarchical grouping
  • items_fts - Full-text search virtual table (FTS5)
  • vec_items - Vector embeddings for semantic search (sqlite-vec)
  • item_history - Audit trail of content changes
  • person_profiles - URN to name/URL mapping for display
  • post_cache - Cached metadata for posts referenced by reactions/comments
  • tags / item_tags - Tagging system
  • collections / collection_items - Cross-source item grouping
  • sources - Plugin configuration storage
  • sync_log - Sync operation history

Configuration

Default location: ~/.config/lestash/config.toml

[general]
database_path = "~/.config/lestash/lestash.db"

[logging]
level = "INFO"
file_path = "~/.config/lestash/logs/lestash.log"

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lestash-1.64.4.tar.gz (86.3 kB view details)

Uploaded Source

Built Distribution

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

lestash-1.64.4-py3-none-any.whl (83.4 kB view details)

Uploaded Python 3

File details

Details for the file lestash-1.64.4.tar.gz.

File metadata

  • Download URL: lestash-1.64.4.tar.gz
  • Upload date:
  • Size: 86.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lestash-1.64.4.tar.gz
Algorithm Hash digest
SHA256 98102dc4391c0e719a1e88a2e358e9e97417c3b04b5fd95db2bc894f552644ef
MD5 13916e29e05edf13e7282c371f0da42e
BLAKE2b-256 ed4575b5c5c1827ccb006cbbb499bf8c2802724b62554df4716a8c9084e25195

See more details on using hashes here.

Provenance

The following attestation bundles were made for lestash-1.64.4.tar.gz:

Publisher: release.yml on thompsonson/lestash

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lestash-1.64.4-py3-none-any.whl.

File metadata

  • Download URL: lestash-1.64.4-py3-none-any.whl
  • Upload date:
  • Size: 83.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lestash-1.64.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f88d7d734280a556bdcdd15175711aea215f71cb98a0e613634ce202f361954f
MD5 0987dc4fa59ee1b29af86ab605fe8d9b
BLAKE2b-256 0106349da43ff2f31d183dcdd35007d3d0bd92427381a3772f72888103ac6b0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lestash-1.64.4-py3-none-any.whl:

Publisher: release.yml on thompsonson/lestash

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.64.4 This release

2 files

1.64.3

2 files

1.64.2

2 files

1.64.1

2 files

1.64.0

2 files

1.63.4

2 files

1.63.3

2 files

1.63.2

2 files

1.63.1

2 files

1.63.0

2 files

1.62.0

2 files

1.61.0

2 files

1.60.0

2 files

1.59.1

2 files

1.59.0

2 files

1.58.0

2 files

1.57.1

2 files

1.57.0

2 files

1.56.3

2 files

1.56.2

2 files

1.56.1

2 files

1.56.0

2 files

1.55.1

2 files

1.55.0

2 files

1.54.0

2 files

1.53.0

2 files

1.52.1

2 files

1.52.0

2 files

1.51.0

2 files

1.50.0

2 files

1.49.0

2 files

1.48.4

2 files

1.48.3

2 files

1.48.2

1 file

1.48.1

1 file

1.48.0

1 file

1.47.0

1 file

1.46.0

1 file

1.45.0

1 file

1.44.0

1 file

1.43.2

1 file

1.43.1

1 file

1.43.0

1 file

1.42.0

1 file

1.41.0

1 file

1.40.0

1 file

1.39.0

1 file

1.38.0

1 file

1.37.0

1 file

1.36.1

1 file

1.36.0

1 file

1.35.0

1 file

1.34.0

1 file

1.33.0

1 file

1.32.1

1 file

1.32.0

1 file

1.31.0

1 file

1.30.0

1 file

1.29.0

1 file

1.28.0

1 file

1.27.2

1 file

1.27.1

1 file

1.27.0

1 file

1.26.2

1 file

1.26.1

1 file

1.26.0

1 file

1.25.3

1 file

1.25.2

1 file

1.25.1

1 file

1.25.0

1 file

1.24.0

1 file

1.23.1

1 file

1.23.0

1 file

1.22.2

1 file

1.22.1

1 file

1.22.0

1 file

1.21.0

1 file

1.20.2

1 file

1.20.1

1 file

1.20.0

1 file

1.19.2

1 file

1.19.1

1 file

1.19.0

1 file

1.18.5

1 file

1.18.4

1 file

1.18.3

1 file

1.18.2

1 file

1.18.1

1 file

1.18.0

1 file

1.17.0

1 file

1.16.0

1 file

1.15.0

1 file

1.14.0

1 file

1.13.0

1 file

1.12.0

1 file

1.11.0

1 file

1.10.0

1 file

1.9.2

1 file

1.9.1

1 file

1.9.0

1 file

1.8.1

1 file

1.8.0

1 file

1.7.0

1 file

1.6.0

1 file

1.5.0

1 file

1.4.0

1 file

1.3.1

1 file

1.3.0

1 file

1.2.0

1 file

1.1.0

1 file

1.0.2

1 file

1.0.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page