Lantern - A P2P file sharing system with TUI dashboard
Project description
_ _
| | __ _ _ _| |_ ___ _ _ _ _
| |__/ _` | ' \ _/ -_) '_| ' \
|____\__,_|_||_\__\___|_| |_||_|
A peer-to-peer file sharing system with a beautiful terminal UI (TUI) dashboard.
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 peerslist <host[:port]>- List files on remote peerdownload <host[:port]> <file>- Download a fileupload <host[:port]> <path>- Upload a filemyfiles- List your shared fileshelp- Show helpquit- 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.
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 lantern_p2p-1.1.2.tar.gz.
File metadata
- Download URL: lantern_p2p-1.1.2.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f2997c671a8a9c0699dcce04aee72a285dee49a3781feaa521225a36b79f1d8
|
|
| MD5 |
586cc747eee8c2be74503c9e4f8b3d49
|
|
| BLAKE2b-256 |
f70e993d8cf435bf719bb6611b8936c16432ad7c4681c7b45bac30d3e72b7813
|
File details
Details for the file lantern_p2p-1.1.2-py3-none-any.whl.
File metadata
- Download URL: lantern_p2p-1.1.2-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e3108ce4b2cbcaefb0da27c809b02a7ef752879ce57d7f5d15c05dff4cb6697
|
|
| MD5 |
ce380822aabd442a0d417a0d56c9c947
|
|
| BLAKE2b-256 |
60386550bf36437935d91fd750851a7f055bee9b7305cef2f380dc69843b2777
|