Skip to main content
 _             _                
| |   __ _ _ _| |_ ___ _ _ _ _  
| |__/ _` | ' \  _/ -_) '_| ' \ 
|____\__,_|_||_\__\___|_| |_||_|

A peer-to-peer file sharing system with a beautiful terminal UI (TUI) dashboard.

Python Version License

Features

  • P2P File Sharing - Share files directly between computers on the same network
  • Auto Discovery - Automatically discovers peers on the LAN via UDP broadcast
  • Beautiful TUI - Modern terminal interface built with Textual
  • Dual Mode - Both CLI and TUI modes available
  • Light/Dark Themes - Toggle between color schemes
  • Progress Bars - Visual feedback for large file transfers
  • Notifications - Toast notifications for operation completion
  • Path Safety - Built-in protection against path traversal attacks

Installation

From PyPI

pip install lantern-p2p

From Source

git clone https://github.com/shx-dow/lantern.git
cd lantern
pip install -e .

Usage

TUI Mode (Default)

Launch the terminal dashboard (beautiful visual interface):

lantern

CLI Mode

Use command-line interface (text-based commands):

lantern --cli

Available CLI commands:

  • peers - Show discovered peers
  • list <host[:port]> - List files on remote peer
  • download <host[:port]> <file> - Download a file
  • upload <host[:port]> <path> - Upload a file
  • myfiles - List your shared files
  • help - Show help
  • quit - Exit

Custom Port

lantern --port 6000

Key Bindings (TUI Mode)

Key Action
F1 Show help
F5 Refresh files
t Toggle theme
u Upload file
d Download file
Tab Cycle focus
q Quit

Configuration

Shared files are stored in ~/Downloads/Lantern/ by default. This directory is created automatically on first run and persists across restarts.

Security Notice

Lantern is designed for trusted local area networks only (e.g. your home network). It has no encryption and no peer authentication.

  • Do not run Lantern on public or untrusted networks (coffee shops, offices, university Wi-Fi, etc.). Anyone on the same network can see your shared files and upload arbitrary content to your machine.
  • The shared directory is world-readable by any Lantern peer on the LAN — only share files you are comfortable with all LAN participants seeing.

Requirements

  • Python 3.10 or higher
  • textual >= 0.50.0
  • psutil >= 5.9.0

Architecture

lantern/
├── config.py      # Configuration constants
├── protocol.py    # Message framing & file transfer protocol
├── discovery.py   # UDP peer discovery
├── server.py      # TCP file server
├── client.py      # TCP client operations
├── peer.py        # CLI entry point
├── tui.py         # Textual TUI dashboard
├── main.py        # Package entry point
└── styles/        # CSS stylesheets
    └── lantern.css

Development

Install with dev dependencies:

pip install -e ".[dev]"

Run linting:

black lantern/
ruff check lantern/

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please open an issue or pull request.

Acknowledgments

Built with Textual for the TUI.

Metadata

Release files for lantern-p2p 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lantern-p2p 1.1.2
File Size Uploaded
lantern_p2p-1.1.2.tar.gz 27.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lantern-p2p 1.1.2
File Interpreter ABI Platform
lantern_p2p-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 54.8 kB

Release files / lantern_p2p-1.1.2.tar.gz

Download URL lantern_p2p-1.1.2.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5f2997c671a8a9c0699dcce04aee72a285dee49a3781feaa521225a36b79f1d8
BLAKE2b-256 checksum
How to use checksums
f70e993d8cf435bf719bb6611b8936c16432ad7c4681c7b45bac30d3e72b7813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / lantern_p2p-1.1.2-py3-none-any.whl

Download URL lantern_p2p-1.1.2-py3-none-any.whl
Size 27.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e3108ce4b2cbcaefb0da27c809b02a7ef752879ce57d7f5d15c05dff4cb6697
BLAKE2b-256 checksum
How to use checksums
60386550bf36437935d91fd750851a7f055bee9b7305cef2f380dc69843b2777
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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