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
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.
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.

Initialize a DocBuilder with a Hugging Face Hub repo, then build documentation.

from doc_builder import DocBuilder

builder = DocBuilder(
    repo_id="huggingface/my-docs",
    repo_type="dataset",
    token=os.environ.get("HF_TOKEN", ""),
)
builder.build()