Skip to main content

python-nrbf

PyPI version Python versions License

A pure-Python parser for .NET BinaryFormatter streams (MS-NRBF spec). No dependencies beyond the standard library.

Installation

pip install nrbf

# YAML output support for nrbfdump
pip install "nrbf[yaml]"

Library usage

import nrbf

# From a file
with open("data.dat", "rb") as f:
    data = nrbf.load(f)

# From bytes
data = nrbf.loads(raw_bytes)

Both functions return plain Python objects — dict, list, str, int, float, bool, or None. The .NET type name is preserved in a __class__ key on dicts so you can identify types if needed.

System.Collections.Generic.List<T> and Dictionary<K,V> are automatically unwrapped to Python list and dict. .NET enum values are unwrapped to plain ints.

Command-line usage

nrbfdump is installed automatically with the package. It reads a BinaryFormatter file (or stdin) and prints it. It automatically decompresses gzip input.

usage: nrbfdump [FILE] [--format FORMAT]

positional arguments:
  FILE                  input file (default: stdin)

options:
  -h, --help            show this help message and exit
  --format, -f          json (default), pprint, yaml

Examples:

# Decode a file to JSON
nrbfdump data.dat

# Pipe a gzip-compressed file
cat data.dat.gz | nrbfdump

# Pretty-print for quick inspection
nrbfdump data.dat --format pprint

# YAML output (requires: pip install "nrbf[yaml]")
nrbfdump data.dat --format yaml

What's decoded

All MS-NRBF record types are supported:

  • All 16 primitive types (bool, int, float, double, DateTime, TimeSpan, Char, etc.)
  • Strings, object references, nulls
  • Single-dimensional and multi-dimensional arrays (primitive, object, string)
  • Classes with full member type info (ClassWithMembersAndTypes, SystemClassWithMembersAndTypes, ClassWithId)
  • System.Collections.Generic.List<T> → list
  • System.Collections.Generic.Dictionary<K,V> → dict
  • .NET enum values → int

License

MIT — see LICENSE.

Metadata

Release files for nrbf 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nrbf 0.1.2
File Size Uploaded Provenance Actions
nrbf-0.1.2.tar.gz 8.5 kB Without provenance Details for nrbf-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nrbf 0.1.2
File Interpreter ABI Platform Actions
nrbf-0.1.2-py3-none-any.whl Python 3 none any Details for nrbf-0.1.2-py3-none-any.whl

Total release size: 17.5 kB

Release files / nrbf-0.1.2.tar.gz

Download URL nrbf-0.1.2.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0d0aab884f4b1ced82f054bca789d84ede8b2a718a44ead25be382dd709529ac
BLAKE2b-256 checksum
How to use checksums
e7b3b4f54daa3411ac5a02056f0ba47f9180b8abeb4aac5579f548d97c2ba8d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / nrbf-0.1.2-py3-none-any.whl

Download URL nrbf-0.1.2-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3fd1c0b9cfc3e7025f94b37bbea1afcef4b81b153f82d66764f4e47f680c994
BLAKE2b-256 checksum
How to use checksums
7d0780af583b8db0ab2887dbf6d625184e37ec844f52dd3f0ed531d76429e1ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for nrbf 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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