Skip to main content

cfb

Read-only access to Microsoft Compound File Binary (CFB/OLE2) files from Python.

Installation

pip install cfb

Development

make install     # create .venv and install with dev dependencies

Usage

from cfb import CfbIO
from cfb.directory.entry import SEEK_END

doc = CfbIO("tests/data/simple.doc")

# Read the root entry buffer.
root = doc.root
print(root.read())

# Access entries by name and seek within them.
entry = doc["1Table"]
entry.seek(100, SEEK_END)
print(entry.read(100))

# Access entries by directory ID.
sibling = doc[1].left
sibling.seek(0)
print(sibling.read(64))

All objects are lazy-loaded, so opening a large file only reads data when you explicitly access it.

Development

make install     # create .venv and install all dev dependencies
make format      # run black
make lint        # run ruff
make typecheck   # run mypy
make test        # run pytest with coverage
make tox         # run tests across Python 3.8, 3.10, and 3.12
make clean       # remove build artefacts and the virtualenv

License

BSD 2-Clause — see LICENSE.txt.

Metadata

Release files for cfb 0.9.3

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

Source distribution (sdist)

Source distribution for cfb 0.9.3
File Size Uploaded Provenance
cfb-0.9.3.tar.gz 16.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 29.4 kB

Release files / cfb-0.9.3.tar.gz

Download URL cfb-0.9.3.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
92bd2427d13ba6936665ce6e44598b63f929d87874ed37a971ece4d6a89e7070
BLAKE2b-256 checksum
How to use checksums
6d0351deea75f3b1611b48ef91ec769f190ccf3bdb1c469a83352cb615cd2771
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / cfb-0.9.3-py3-none-any.whl

Download URL cfb-0.9.3-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3560a1446f90598e58051c5816bec0b359b327a6001ac94d19604e6986698ce2
BLAKE2b-256 checksum
How to use checksums
6ffe98076cc6ed976a66949676a00a6fbed8321d8b862f4889871b2bdf39be65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for cfb 0.9.3

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.

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