Skip to main content

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

Metadata

Release files for flaxfile 1.6.0

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

Source distribution (sdist)

Source distribution for flaxfile 1.6.0
File Size Uploaded
flaxfile-1.6.0.tar.gz 50.7 kB Details

Built distribution (wheel)

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

Total release size: 94.0 kB

Release files / flaxfile-1.6.0.tar.gz

Download URL flaxfile-1.6.0.tar.gz
Size 50.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fa53f5eed6aa1de44da03c38116e3961c65f0fa6bae2799c7dd5cac52e76c13e
BLAKE2b-256 checksum
How to use checksums
20be26489afe4b2307b2c49b3a464500131a59cbb2dc0115e1c186e79f32575e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release files / flaxfile-1.6.0-py3-none-any.whl

Download URL flaxfile-1.6.0-py3-none-any.whl
Size 43.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56f45406916b26966a84ba4e8b41686ec17d1b4d92ff5518d12b065e5855422e
BLAKE2b-256 checksum
How to use checksums
e59cfcde66d67e7a7b996e64d47297229f0056ef403c0a672d38126cc0494093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release history Release notifications | RSS feed

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

This release

1.6.0 This release

2 release files

1.5.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 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