Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sctech-tr/sendfile
📜 send and recieve files across the local network
https://github.com/sctech-tr/sendfile
file ftp http http-client http-server internet network pip python python-http python-http-client python-http-server python-httpserver python-package python3 pythonhttpserver
Last synced: about 2 months ago
JSON representation
📜 send and recieve files across the local network
- Host: GitHub
- URL: https://github.com/sctech-tr/sendfile
- Owner: sctech-tr
- License: agpl-3.0
- Created: 2024-11-27T17:03:53.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-27T17:34:40.000Z (2 months ago)
- Last Synced: 2024-11-27T19:28:07.719Z (2 months ago)
- Topics: file, ftp, http, http-client, http-server, internet, network, pip, python, python-http, python-http-client, python-http-server, python-httpserver, python-package, python3, pythonhttpserver
- Language: Python
- Homepage: https://pypi.org/project/sendfile/
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📦 SendFile: File Sharing Across Local Network
SendFile is a Python-based tool that allows you to **send** and **receive files** across your local network. It serves files from the `~/.sendfile/uploads` directory on the server and saves downloaded files in the `~/.sendfile/downloads` directory on the client.
## 🎉 Features
- **Host a File Server**: Easily start a server to share files within your local network.
- **Download Files**: Retrieve files from another device using its local IP address.
- **Lightweight**: Built using Python's standard library (no external dependencies! (except for requests)).
- **Modular**: The app is split into multiple files for maintainability and clarity.## 🛠Installation
1. Ensure Python 3.9 or newer is installed.
2. Install via pip:
```bash
pip install sendfile
```
## 🚀 Usage
### Start the Server
Host the server to share files from `~/.sendfile/uploads`:
```bash
python -m sendfile serve --host 0.0.0.0 --port 8000
```
#### Options:
- `--host`: Host to bind the server (default: `0.0.0.0`).
- `--port`: Port to bind the server (default: `80`).
### Download a File
Download a file from a server:
```bash
python -m sendfile download --port 8000
```
#### Example:
```bash
python -m sendfile download 192.168.1.114 my_file.txt --port 8000
```
#### Options:
- ``: Local IP address of the server.
- ``: Name of the file to download.
- `--port`: Port of the server (default: `80`).
## 📜 Using as an HTTP server
You can also use SendFile as an HTTP server. To do this, run the following command:
```bash
python -m sendfile serve --host 0.0.0.0 --port 80
```
## 📂 File Structure
```plaintext
sendfile/
├── __main__.py # Entry point for the application
├── server.py # Server-side implementation
├── client.py # Client-side implementation
├── utils.py # Utility functions (e.g., get local IP)
```
## 🌟 Example Workflow
### Server:
Run the server on one machine:
```bash
python -m sendfile serve
```
Place the file to share in the `~/.sendfile/uploads` directory.### Client:
Download the file from another machine:
```bash
python -m sendfile download 192.168.1.114 my_file.txt
```
## 🔧 Requirements- Python 3.9 or newer.
- Both devices must be connected to the same local network.## 🛡 Security Note
This tool is intended for local network use. Do not expose the server to the public internet without proper security measures.