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.1-cp39-abi3-manylinux_2_28_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

goosefs-0.2.1-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.1-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goosefs-0.2.1-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 051d3c47864178eb39a35e47bbb8ddb4e0e8a8101861463c5ef64b71a44f379b
MD5 9b1b72dadad4b9e8df97baf50b43c971
BLAKE2b-256 f2b7f37ad27471d91ca78bf666c9c33cb4ec4a11f993904b67738b5f0b43c0f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goosefs-0.2.1-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e20aa52f53b953e617f6be93fc90c79920812964248fcf939a9bab37b803398f
MD5 0f7929eabd7767cbbf68fb159fd0a7e2
BLAKE2b-256 0a707b8b05169622b121562d344e88cf4be6dafcc134a295e1ac851e1cfb24c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goosefs-0.2.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ba7abed953076411a72de1a8b2378e2bd3a1ff3dd3a8aa2a0107e00672be894
MD5 8a14897789c9e61f0f285c65907833e7
BLAKE2b-256 c4196f7f7a2b08b6c417976acf694e45d7fe908bb0b46c61f70648e5fecd667d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

3 files

0.2.0

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