Skip to main content

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.

Release files for binaryflow 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binaryflow 1.1.1
File Size Uploaded
binaryflow-1.1.1.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for binaryflow 1.1.1
File Interpreter ABI Platform
binaryflow-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / binaryflow-1.1.1.tar.gz

Download URL binaryflow-1.1.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6961b0d0763444abb87d6e0036d7ccd24b916405f9e795e1a87d3d2c955cb42f
BLAKE2b-256 checksum
How to use checksums
664015487ea81615feab1f249055f67a73a29b40c6103a7c2791add11bc885a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / binaryflow-1.1.1-py3-none-any.whl

Download URL binaryflow-1.1.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f985f69652233310d83f92f62d1b353f03819610d22fb14341b1107466121b65
BLAKE2b-256 checksum
How to use checksums
8487d372e87cd3a4a7ee70816bf406e5aeba8e27a262aeea2f030baf44122e5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page