Skip to main content

A custom file transmission utility based on the Binary Flow Protocol for transferring files using IP and hostname.

Project description

Binary Flow

Binary Flow is a custom Python library for fast and reliable file transfers over a network.It works over Binary Flow Protocol and supports transferring files between different devices on the same network using IP addresses and hostnames.

Features

  • File Transfer: Simple client-server architecture for transferring files.
  • Network Communication: Uses TCP/IP for communication across IP-based networks.
  • Binary Encoding: Transfers any file type, including binary data.
  • Automatic Port Handling: Server can assign ports automatically or use a fixed port.

Installation

To install the package in python using pip:

pip install binaryflow

Usage

FTPServer (Server-side)

The FTPServer class is used to host the server and send files to connected clients.

Methods:

  • start_server(file_path: str, host: str = '0.0.0.0', port: int = 18367) -> None
    Starts the server on the specified IP address and port, and waits for client connections.

    Parameters:

    • file_path (str): Path to the file that will be transferred.
    • host (str, optional): The IP address to bind the server to (default: '0.0.0.0', which means all interfaces).
    • port (int, optional): The port number on which the server will listen (default: 18367).

Example Usage:

from binaryflow import FTPServer

# Path to the file you want to send
file_path = 'example.txt'

# Create an FTPServer instance
server = FTPServer()

# Start the server, bind it to port 18367
server.start_server(file_path)

FTPServer (Client-side)

The FTPClient class is used to connect to an FTPServer and receive files.

Methods

  • start_client(server_ip: str, server_port: int = 18367) -> None Connects to a server using the specified IP and port, then receives and saves the transferred file.

    Parameters:

    • server_ip: The IP address of the server.
    • server_port: The port on which the server is listening (default: 18367).

Example Usage:

from binaryflow import FTPClient

# IP address of the server
server_ip = '192.168.1.249'

# Create an FTPClient instance
client = FTPClient()

# Start the client, connect to the server at port 18367
client.start_client(server_ip)

Advanced Use Cases

Using a Custom Port

You can specify a different port if needed, as long as both the server and client agree on the port.

Server-side:

server.start_server(file_path, port=9000)

Client-Side

client.start_client(server_ip, server_port=9000)

Transferring Large Files

The system supports large file transfers in chunks. Just ensure the file path is valid, and the protocol will handle the rest automatically.

Common Issues

Firewall Blocking

Ensure that the firewall on both the server and client machines allows traffic on the specified port. If necessary, configure firewall settings to permit communication through the chosen port.

IP Configuration

Make sure both devices are on the same network and can communicate via IP when running the server and client on different machines. If using virtual machines, apply a bridge connection to ensure proper network communication between the devices.

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

binaryflow-1.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

binaryflow-1.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file binaryflow-1.1.1.tar.gz.

File metadata

  • Download URL: binaryflow-1.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for binaryflow-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6961b0d0763444abb87d6e0036d7ccd24b916405f9e795e1a87d3d2c955cb42f
MD5 d6952ebb4ad3af2cbf0e152ecab8e133
BLAKE2b-256 664015487ea81615feab1f249055f67a73a29b40c6103a7c2791add11bc885a7

See more details on using hashes here.

File details

Details for the file binaryflow-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: binaryflow-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for binaryflow-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f985f69652233310d83f92f62d1b353f03819610d22fb14341b1107466121b65
MD5 cd227b57b73ba9dee0326801fdc52a5b
BLAKE2b-256 8487d372e87cd3a4a7ee70816bf406e5aeba8e27a262aeea2f030baf44122e5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page