Tencent Cloud GooseFS Python Client (powered by Rust)
Project description
GooseFS Python Client
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
GoosefsandAsyncGoosefsare safe to share across threads.- Both are NOT safe across
os.fork()— child processes must reconnect. Goosefssynchronous methods refuse to run from inside a Tokio worker or asyncio event loop and raiseRuntimeErrorinstead 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goosefs-0.1.7-cp39-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: goosefs-0.1.7-cp39-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7621f6c20cad5d1b909610da8e530427551b574d4dd171b8d1340f02d8ab9d20
|
|
| MD5 |
698ff60d937e8cec9f3b3fce6cf8a672
|
|
| BLAKE2b-256 |
b29b7220192c53c01873ee0d53989da23c39cccb20bb374ebb51ef71ff049ea0
|
File details
Details for the file goosefs-0.1.7-cp39-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: goosefs-0.1.7-cp39-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.9+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7ce490468afbdaa96cce5add1d36b8fddc3131a184757ec25a2eb860c33e604
|
|
| MD5 |
e1e9bc738cbba1ee3bd3d3230a93bc7d
|
|
| BLAKE2b-256 |
3ae2bd7112d3a911cd2315f17bd5b0616b161abfc24ce55a0454a5f7015d9dfb
|