_ _
| | __ _ _ _| |_ ___ _ _ _ _
| |__/ _` | ' \ _/ -_) '_| ' \
|____\__,_|_||_\__\___|_| |_||_|
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.
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lantern_p2p-1.1.2.tar.gz | 27.5 kB | Without provenance | Details for lantern_p2p-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lantern_p2p-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for lantern_p2p-1.1.2-py3-none-any.whl |
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
|
Security for lantern-p2p 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.