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.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 flaxfile 1.6.1
File Size Uploaded
flaxfile-1.6.1.tar.gz 51.2 kB Details

Built distribution (wheel)

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

Total release size: 95.0 kB

Release files / flaxfile-1.6.1.tar.gz

Download URL flaxfile-1.6.1.tar.gz
Size 51.2 kB
Tags Source
SHA-256 checksum
How to use checksums
164109caddfb79c642cc934203e9fd9bebbdfdefe38eaf06e34c9409b2af0959
BLAKE2b-256 checksum
How to use checksums
f9fe557be502ea3ca283a95dc6ec5af84219ffa0c2fbe7f0a30759af2e027741
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.1-py3-none-any.whl

Download URL flaxfile-1.6.1-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cf91a86d0b11f00720db4bfa88ce83aead95fd9fb29024ba99657c4eaeddec7
BLAKE2b-256 checksum
How to use checksums
97d33a01abd009189f07a44ff54bdf6d3883d4036291ef1097734b7355bbc3e7
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

This release

1.6.1 This release

2 release files

1.6.0

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