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 the development roadmap.

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://git.woa.com/tencent-cloud-datalake/goosefs-client-rust.git
cd goosefs-client-rust/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.7-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.7-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.7-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goosefs-0.1.7-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7621f6c20cad5d1b909610da8e530427551b574d4dd171b8d1340f02d8ab9d20
MD5 698ff60d937e8cec9f3b3fce6cf8a672
BLAKE2b-256 b29b7220192c53c01873ee0d53989da23c39cccb20bb374ebb51ef71ff049ea0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for goosefs-0.1.7-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b7ce490468afbdaa96cce5add1d36b8fddc3131a184757ec25a2eb860c33e604
MD5 e1e9bc738cbba1ee3bd3d3230a93bc7d
BLAKE2b-256 3ae2bd7112d3a911cd2315f17bd5b0616b161abfc24ce55a0454a5f7015d9dfb

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