hf-doc-builder
raw JSON → 0.5.0 verified Fri May 01 auth: no python maintenance
Doc building utility by Hugging Face, version 0.5.0, used to generate and push documentation from source code and markdown files. Release cadence is irregular, with last release v0.5.0 in 2022.
pip install doc-builder Common errors
error ImportError: cannot import name 'DocBuilder' from 'docbuilder' ↓
cause Incorrect package name in import; the correct module name is `doc_builder`.
fix
Change import to
from doc_builder import DocBuilder. error TypeError: __init__() missing required argument: 'token' ↓
cause DocBuilder requires a token for Hub authentication.
fix
Pass
token argument or set HF_TOKEN environment variable. Warnings
gotcha The import path uses underscores: `from doc_builder import ...` even though the PyPI package is `doc-builder`. Using `docbuilder` will fail with ImportError. ↓
fix Always use `doc_builder` in import statements.
breaking v0.5.0 reverted a commit that added deletion support in `create_commit` command. If you rely on deletions, update your code. ↓
fix Do not expect deletions to work; manually handle deletions outside the builder.
gotcha The library requires authentication for private repositories; the token must be passed as a parameter or via `HF_TOKEN` environment variable. ↓
fix Set `HF_TOKEN` environment variable or pass `token="..."` to DocBuilder constructor.
Imports
- DocBuilder wrong
from docbuilder import DocBuildercorrectfrom doc_builder import DocBuilder - push_to_hub wrong
from doc_builder import push_to_hubcorrectfrom doc_builder.commands.push import push_to_hub
Quickstart
from doc_builder import DocBuilder
builder = DocBuilder(
repo_id="huggingface/my-docs",
repo_type="dataset",
token=os.environ.get("HF_TOKEN", ""),
)
builder.build()