Skip to main content

Tencent Cloud GooseFS Python Client (powered by Rust)

Project description

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.

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 wheels are best-effort and may be added in a later release.

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.

Project details


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

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

goosefs-0.1.8-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.8-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goosefs-0.1.8-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef1ba02cf0fb9c2f27aa61a5a444284c513fa12980e68dca66f240abb6214383
MD5 c607708e390ffc1cfe7f70709a63c241
BLAKE2b-256 c5995a50b76efaa7bc6a86831e607e3e6bd029898df88483627a7cd0a78ba772

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goosefs-0.1.8-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9c4146894b59d9c6d8629f2766528662635d01c1c05889442fd5dd1fac2a0a65
MD5 d27a8a286466db2b3f16ce6d75b991b1
BLAKE2b-256 e977975fa67bc7b4a70a677188a36675e269b3166b8c49335f06ec9f568b2247

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page