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.3.0.tar.gz (44.9 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.3.0-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for flaxfile-1.3.0.tar.gz
Algorithm Hash digest
SHA256 7ff40ba6bb8ff394fbb2787abd9207c4edda4604301a2d15c2e8d89b04a961e8
MD5 a497ed3f9e9663daecdab5643e1821e5
BLAKE2b-256 ec26ddc41aad631430fe3618d587acff0a1b0b2eb153343bdf6cb59e9fa8b44b

See more details on using hashes here.

Provenance

The following attestation bundles were made for flaxfile-1.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: flaxfile-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 40.7 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf2eeb703d8622185a5b130232f0edffadb646738f4baa85ec5d1cafb1a702dc
MD5 1c597127b8035ec331c93a980b7e6f01
BLAKE2b-256 bd050a91736cc1d8dda46340f99cc8ece9a0becba508066e51d2fc77fe996031

See more details on using hashes here.

Provenance

The following attestation bundles were made for flaxfile-1.3.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