Skip to main content

高性能文件传输工具 - 基于ZMQ优化的跨网络文件传输系统

Project description

FlaxFile

基于 ZeroMQ 的高性能跨网络文件传输系统。

核心特性

  • 高性能传输:多Socket并发 + 滑动窗口协议,上传/下载速度可达 1.5+ GB/s
  • 安全加密:支持 CurveZMQ (NaCl) 端到端加密传输
  • 增量同步:基于 xxHash3-64 快速哈希,智能跳过未修改文件
  • 异步架构:单端口异步服务器,高并发低延迟
  • 友好界面:Rich 终端进度条,实时显示传输状态

快速开始

安装

pip install -e .

启动服务器

# 默认配置启动
flaxfile serve

# 指定端口和存储目录
flaxfile serve --host 0.0.0.0 --port 25555

# 启用加密(推荐)
export FLAXFILE_PASSWORD="your_password"
flaxfile serve

客户端操作

# 上传文件
flaxfile set /path/to/file.bin [key]

# 下载文件
flaxfile get key [output_path]

# 目录同步(增量)
flaxfile push /local/dir remote_dir
flaxfile pull remote_dir /local/dir

# 列出文件
flaxfile list [prefix]

# 删除文件
flaxfile delete key

Python API

异步 API(推荐)

import asyncio
from flaxfile import MultiSocketFlaxFileClient

async def main():
    client = MultiSocketFlaxFileClient(
        server_host="127.0.0.1",
        port=25555,
        password="your_password"  # 可选
    )

    # 上传/下载(自适应选择最优Socket数量)
    await client.upload_file("video.mp4", "my_video", show_progress=True)
    await client.download_file("my_video", "output.mp4", show_progress=True)

    await client.close()

asyncio.run(main())

同步 API

from flaxfile import MultiSocketFlaxFileClientSync

client = MultiSocketFlaxFileClientSync(server_host="127.0.0.1", port=25555)
try:
    client.upload_file("video.mp4", "my_video", show_progress=True)
    client.download_file("my_video", "output.mp4", show_progress=True)
finally:
    client.close()

配置文件

在项目目录或家目录创建 flaxfile.toml

[client]
default_server = "prod"

[server]
host = "0.0.0.0"
port = 25555
storage_dir = "./zmq_streaming_storage"

[servers.prod]
host = "192.168.1.100"
port = 25555

性能特性

  • 自适应传输策略:根据文件大小自动调整Socket数量和窗口大小
  • 滑动窗口协议:多个chunk并发传输,充分利用网络带宽
  • 异步I/O:aiofiles避免阻塞,保持高并发性能
  • 智能缓存:乱序chunk缓存机制,确保数据正确性

许可证

MIT License

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

flaxfile-1.2.0.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

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

flaxfile-1.2.0-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file flaxfile-1.2.0.tar.gz.

File metadata

  • Download URL: flaxfile-1.2.0.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flaxfile-1.2.0.tar.gz
Algorithm Hash digest
SHA256 5704d04986fcc8594529e24264d7e3537a30e240672789d41899a436697115a4
MD5 118307aa806f7a541cbe9d7cadd35377
BLAKE2b-256 63a58f084e3f496f01c9fbd7e1df24901764b3083a9c1087257d08783b2d204b

See more details on using hashes here.

Provenance

The following attestation bundles were made for flaxfile-1.2.0.tar.gz:

Publisher: python-publish.yml on KenyonY/flaxfile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flaxfile-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: flaxfile-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for flaxfile-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d423d020b632bce8a98245413e266623ac5742d3532c543da8a1d164c93be1b1
MD5 6fc4af446cd8f02c9a5824a55fe0180a
BLAKE2b-256 50ab9a07ce2bc327c20897b636ba4dbf54b6f4524f34c0b8530cbb1ad4180fb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for flaxfile-1.2.0-py3-none-any.whl:

Publisher: python-publish.yml on KenyonY/flaxfile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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