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 ftp 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 ftp 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.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distributions

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

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

Uploaded Python 3

binaryflow-1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: binaryflow-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 98b8436e821f96539600f9d7841ba069acd3995efbbff625c02073228c92b594
MD5 bfc7bc86a60761e96708b583b3a14c0e
BLAKE2b-256 264072c6e05a45f313cb626438af12f067089ddd70a127539c92560f815ff521

See more details on using hashes here.

File details

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

File metadata

  • Download URL: binaryflow-1.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f40bf57d1d9a53a74b7bb18e3be70ce8ba6711974a98b0d23981bbf360992b
MD5 5a91f1856a1129d364536d6d634b2430
BLAKE2b-256 e2b18a34616808b12c1825b7eeb32c30e6d63eb310fe357374afe937c1dad35a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: binaryflow-1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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-py3-none-any.whl
Algorithm Hash digest
SHA256 f02c88f89a54bd242bbcff7f94c5adba80be39de7ecd82288c838e071acb95e0
MD5 7abee25e45beac05942bab494f64d28a
BLAKE2b-256 f0ff877e1d2cfbf013f5fdb12af062ccb6f82e33a517d0e68c9e0ce429e9c63a

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