Skip to main content

GooseFS Python Client

PyPI Python Versions License

goosefs is the official Python client for Tencent Cloud GooseFS, powered by a native Rust implementation (the goosefs-sdk crate) exposed through PyO3.

Docs: https://tencent.github.io/tencent-goosefs-rust-sdk/

Status: alpha — the API is shaping up. See CHANGELOG.md and DEVELOPMENT.md.

Install

pip install goosefs

Pre-built wheels are provided for:

  • Linux x86_64 / aarch64 (manylinux_2_28)
  • macOS x86_64 / arm64
  • Windows x86_64 (MSVC)

Building From Source (Optional)

Most users should just pip install goosefs. Build from source only if you need an unreleased change or a platform without a pre-built wheel.

Prerequisites: Python 3.9+, Rust 1.88+ (rustup).

git clone https://github.com/Tencent/tencent-goosefs-rust-sdk.git
cd tencent-goosefs-rust-sdk/bindings/python

Install maturin:

pip install maturin

Build and install:

# Development mode (editable)
maturin develop

# Or build a wheel
maturin build --release
pip install target/wheels/goosefs-*.whl

To produce a portable Linux wheel (usable on Tencent Cloud Linux), cross-compile with zig:

rustup target add x86_64-unknown-linux-gnu
pip install ziglang
maturin build --release --target x86_64-unknown-linux-gnu --manylinux 2_28 --zig

Verify:

import goosefs
print("GooseFS Python bindings installed:", goosefs.__version__)

Quick start

from goosefs import Config, Goosefs

cfg = Config("127.0.0.1:9200")
with Goosefs(cfg) as fs:
    fs.mkdir("/data", recursive=True)
    fs.write_file("/data/hello.txt", b"hello, goosefs")
    print(fs.read_file("/data/hello.txt"))

For asynchronous code:

import asyncio
from goosefs import AsyncGoosefs, Config, WriteType

async def main() -> None:
    async with await AsyncGoosefs.connect(Config("127.0.0.1:9200")) as fs:
        await fs.mkdir("/data", recursive=True)
        await fs.write_file("/data/x.bin", b"...", write_type=WriteType.MustCache)
        data = await fs.read_file("/data/x.bin")
        print(len(data), "bytes")

asyncio.run(main())

Type stubs

The package ships PEP 561-compliant type stubs (goosefs/*.pyi) and a py.typed marker, so mypy and pyright get full IntelliSense out of the box. Stubs are kept in lock-step with the runtime by mypy.stubtest in CI:

cd bindings/python
uv run python -m mypy.stubtest goosefs

Thread / process safety

  • Goosefs and AsyncGoosefs are safe to share across threads.
  • Both are NOT safe across os.fork() — child processes must reconnect.
  • Goosefs synchronous methods refuse to run from inside a Tokio worker or asyncio event loop and raise RuntimeError instead of deadlocking.
  • File handles (FileReader / FileWriter / their async siblings) are NOT safe to share across threads or tasks — open one per worker.

License

Apache License 2.0. See LICENSE in the repository root.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

goosefs-0.2.0-cp39-abi3-manylinux_2_28_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

goosefs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file goosefs-0.2.0-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for goosefs-0.2.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 480bc7b388181df88b3e13fe001fb012f426592e6050f262864542cfeed63e4f
MD5 c105c93e567017ccb142ea395174c32f
BLAKE2b-256 0b3fb880102496824ef418e5c55453ba03132b9a42c867a4f5d4f066a8a475bc

See more details on using hashes here.

File details

Details for the file goosefs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for goosefs-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f239a5c50b4906eff1a9aac1df33f9921054f74bb82f7c6c8c3de94b1ee03cf
MD5 ed2db7cbf8f61028dbdcc9aa94effc20
BLAKE2b-256 78c9a76ef2f61216a420719e604361b30be1b0282e74c492bc50fa6059a996ce

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

3 files

This release

0.2.0 This release

2 files

0.1.9

3 files

0.1.8

2 files

0.1.7

2 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