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.1.9-cp39-abi3-win_amd64.whl (4.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

goosefs-0.1.9-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.1.9-cp39-abi3-manylinux_2_28_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

File details

Details for the file goosefs-0.1.9-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: goosefs-0.1.9-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for goosefs-0.1.9-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f2dd28d5e44d4f2b00a9313b4e7451d389466ff703c137cc95ff65ad0199fcdd
MD5 d25e3051110acc8271620c5aa8483f6e
BLAKE2b-256 a0a85b8cfae5ee14124c5f7cf462639a9a558786077da2b4a7173077383196b6

See more details on using hashes here.

File details

Details for the file goosefs-0.1.9-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goosefs-0.1.9-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2afe611891dd486a2ea82539d1e604fa6815dc467ec02ad1f8eef71d7f37dcfe
MD5 3f5ebd287d0400582463a6894b304291
BLAKE2b-256 89e111132c1291baf67f6b304df80462e7b05d76833f68df60d46e31e7aedcdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goosefs-0.1.9-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 711e9abf038f8adabe1e0d18e11bf36ddd46b71766892e661585674fefd5c661
MD5 a3aeb975c450689891f7b8d561b04642
BLAKE2b-256 9e63cf6bc748a73d8aecf25a57a51de3a8ea55eb436678fdcc2f7a7fd92b1877

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

3 files

0.2.0

2 files

This release

0.1.9 This release

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