YTsaurus YSON (version 0.4.10) provides high-performance C++ bindings for YSON (Yandex Serialization Object Notation), enabling fast serialization and deserialization of YSON data. It is a sub-package of the larger `ytsaurus-python` project, specifically focused on YSON processing. Releases are tied to the `ytsaurus-python` project, with regular updates that reflect changes in the broader YTsaurus ecosystem.
pip install ytsaurus-ysonVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic serialization (`dumps`) and deserialization (`loads`) of YSON data using `ytsaurus-yson`. Note that `loads` expects bytes and `dumps` produces bytes, consistent with the binary nature of YSON. It also shows how YSON attributes are handled.
Migrate your `pip install` commands from `ytsaurus-python` (if only YSON was needed) or `yt` to `pip install ytsaurus-yson`. Update import paths from `from yt.yson import ...` or `from ytsaurus_python.yson import ...` to `from ytsaurus_yson import ...`.
Always encode Python strings to bytes (e.g., `s.encode('utf-8')`) before passing them to `loads` and decode `bytes` results to strings (e.g., `b.decode('utf-8')`) after `dumps` if string representation is needed. Example: `loads(b'{a=1}')`, `dumps({'a':1}).decode('utf-8')`.Ensure that a C++ compiler (like GCC/Clang) and Python development headers are installed. On Debian/Ubuntu: `sudo apt-get install build-essential python3-dev`. On macOS with Homebrew: `xcode-select --install`.
Be aware of `YsonType` objects when deserializing YSON that contains these specific types or attributes. Use `isinstance()` checks and access `.value` or `.attributes` as needed. If strict Python types are required, manual conversion logic might be necessary.
No dependency data recorded yet.