All docs
Docs/ API Reference/ lsdtools.publish reference
API Reference

lsdtools.publish reference

Generated public SDK reference for lsdtools.publish.

SDK distribution 1.0.0; API contract 1.0; generator 1.0.0.

Product source digest: 4ea39055732e8883c03ccfecf12af6ccebd2041a12ce1b843e4a769e200f5ef9.

Generated from declared public exports and source syntax. Signatures and annotations are declaration spellings; decorators, factories and annotations are never executed. Class members below are declared members; base classes remain explicit. Source docstrings describe their owning implementation; they do not grant app permissions.

text
Immutable, transport-neutral descriptors for published LSD sites.

Package code owns the bytes in a static site directory.  This module validates and hashes those
bytes into the exact ``lsd.publish/v1`` manifest understood by the publish service, but deliberately
does not select a URL, implement HTTP, or start infrastructure.  Uploading is delegated to a public
client supplied by the caller (or, when the product provides one, by
``lsdtools.server.publish_client``).

The directory walk is fail-closed: only regular files and ordinary directories are accepted;
symbolic links, junctions/reparse points, traversal paths, and special files are rejected.  Limits
mirror the v1 service defaults so a package cannot spend unbounded work constructing a manifest the
service will refuse.

lsdtools.publish.MAX_FILE_BYTES#

Kind: value. Source: sdk/src/lsdtools/publish.py:50.

Python
MAX_FILE_BYTES = 256 * 1024 * 1024

lsdtools.publish.MAX_MANIFEST_BYTES#

Kind: value. Source: sdk/src/lsdtools/publish.py:53.

Python
MAX_MANIFEST_BYTES = 4 * 1024 * 1024

lsdtools.publish.MAX_MANIFEST_FILES#

Kind: value. Source: sdk/src/lsdtools/publish.py:52.

Python
MAX_MANIFEST_FILES = 20000

lsdtools.publish.MAX_REVISION_BYTES#

Kind: value. Source: sdk/src/lsdtools/publish.py:51.

Python
MAX_REVISION_BYTES = 2 * 1024 * 1024 * 1024

lsdtools.publish.PUBLISH_SCHEMA_VERSION#

Kind: value. Source: sdk/src/lsdtools/publish.py:49.

Python
PUBLISH_SCHEMA_VERSION = 1

lsdtools.publish.PublishClient#

Kind: class. Source: sdk/src/lsdtools/publish.py:667.

Source docstring:

text
Public high-level client seam consumed by :func:`publish_directory`.

A client owns authentication, delta upload, retries, and generation compare-and-swap.  The SDK
supplies only a verified directory and immutable manifest.

Declared bases: Protocol.

lsdtools.publish.PublishClient.publish_directory#

Kind: method. Source: sdk/src/lsdtools/publish.py:674.

Python
publish_directory(self, directory: Path, *, manifest: PublishManifest, visibility: str, allowed_users: tuple[str, ...], expires_at: datetime | str | None, site_id: str | None, share_url: str | None=None) -> Any
Python
allowed_users: tuple[str, ...]
directory: Path
expires_at: datetime | str | None
manifest: PublishManifest
self: (unannotated)
share_url: str | None
site_id: str | None
visibility: str

lsdtools.publish.PublishFile#

Kind: class. Source: sdk/src/lsdtools/publish.py:309.

Source docstring:

text
One immutable content-addressed file in a v1 publish manifest.

lsdtools.publish.PublishFile.path#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:312.

Python
path: str

lsdtools.publish.PublishFile.sha256#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:313.

Python
sha256: str

lsdtools.publish.PublishFile.size#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:314.

Python
size: int

lsdtools.publish.PublishFile.media_type#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:315.

Python
media_type: str

lsdtools.publish.PublishFile.to_dict#

Kind: method. Source: sdk/src/lsdtools/publish.py:327.

Python
to_dict(self) -> dict[str, Any]
Python
self: (unannotated)

Source docstring:

text
Return a fresh JSON-safe v1 file descriptor.

lsdtools.publish.PublishManifest#

Kind: class. Source: sdk/src/lsdtools/publish.py:394.

Source docstring:

text
A detached, immutable v1 manifest for one exact directory revision.

``title`` is site presentation metadata used by a client while creating or updating a site; it
is deliberately not part of the server's immutable content manifest.  ``content_sha256`` is
the SHA-256 of the canonical UTF-8 JSON returned by :meth:`to_dict`.

lsdtools.publish.PublishManifest.title#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:402.

Python
title: str

lsdtools.publish.PublishManifest.entrypoint#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:403.

Python
entrypoint: str

lsdtools.publish.PublishManifest.files#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:404.

Python
files: tuple[PublishFile, ...]

lsdtools.publish.PublishManifest.representations#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:405.

Python
representations: tuple[PublishRepresentation, ...]
Python
representations = ()

lsdtools.publish.PublishManifest.metadata#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:406.

Python
metadata: Mapping[str, Any]
Python
metadata = field(default_factory=dict)

lsdtools.publish.PublishManifest.schema_version#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:407.

Python
schema_version: int
Python
schema_version = PUBLISH_SCHEMA_VERSION

lsdtools.publish.PublishManifest.content_sha256#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:408.

Python
content_sha256: str
Python
content_sha256 = field(init=False)

lsdtools.publish.PublishManifest.from_directory#

Kind: method. Source: sdk/src/lsdtools/publish.py:459.

Python
from_directory(cls, directory: str | os.PathLike[str], *, title: str, entrypoint: str='index.html', representations: Iterable[PublishRepresentation]=(), metadata: Mapping[str, Any] | None=None, max_files: int=MAX_MANIFEST_FILES, max_file_bytes: int=MAX_FILE_BYTES, max_total_bytes: int=MAX_REVISION_BYTES, max_manifest_bytes: int=MAX_MANIFEST_BYTES) -> PublishManifest
Python
cls: (unannotated)
directory: str | os.PathLike[str]
entrypoint: str
max_file_bytes: int
max_files: int
max_manifest_bytes: int
max_total_bytes: int
metadata: Mapping[str, Any] | None
representations: Iterable[PublishRepresentation]
title: str

Source docstring:

text
Hash a directory into a deterministic, bounded v1 publish manifest.

Custom limits may lower, but never raise, the service's v1 limits.  They are useful for
package-specific policy and focused tests.

lsdtools.publish.PublishManifest.to_dict#

Kind: method. Source: sdk/src/lsdtools/publish.py:515.

Python
to_dict(self) -> dict[str, Any]
Python
self: (unannotated)

Source docstring:

text
Return a fresh JSON-safe server manifest (title and derived digest are client-side).

lsdtools.publish.PublishRepresentation#

Kind: class. Source: sdk/src/lsdtools/publish.py:339.

Source docstring:

text
A package-owned semantic representation inside a generic published site.

lsdtools.publish.PublishRepresentation.id#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:342.

Python
id: str

lsdtools.publish.PublishRepresentation.kind#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:343.

Python
kind: str

lsdtools.publish.PublishRepresentation.entrypoint#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:344.

Python
entrypoint: str | None
Python
entrypoint = None

lsdtools.publish.PublishRepresentation.files#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:345.

Python
files: tuple[str, ...]
Python
files = ()

lsdtools.publish.PublishRepresentation.metadata#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:346.

Python
metadata: Mapping[str, Any]
Python
metadata = field(default_factory=dict)

lsdtools.publish.PublishRepresentation.version#

Kind: attribute. Source: sdk/src/lsdtools/publish.py:347.

Python
version: int
Python
version = PUBLISH_SCHEMA_VERSION

lsdtools.publish.PublishRepresentation.to_dict#

Kind: method. Source: sdk/src/lsdtools/publish.py:380.

Python
to_dict(self) -> dict[str, Any]
Python
self: (unannotated)

Source docstring:

text
Return a fresh JSON-safe v1 representation descriptor.

lsdtools.publish.PublishUnavailableError#

Kind: class. Source: sdk/src/lsdtools/publish.py:100.

Source docstring:

text
No public publish client is available in the active LSD runtime.

Declared bases: RuntimeError.

lsdtools.publish.publish_directory#

Kind: function. Source: sdk/src/lsdtools/publish.py:757.

Python
publish_directory(directory: str | os.PathLike[str], *, title: str, entrypoint: str='index.html', representations: Iterable[PublishRepresentation]=(), metadata: Mapping[str, Any] | None=None, visibility: str='private', allowed_users: Iterable[str]=(), expires_at: datetime | str | None=None, site_id: str | None=None, share_url: str | None=None, client: PublishClient | Any=None) -> Any
Python
allowed_users: Iterable[str]
client: PublishClient | Any
directory: str | os.PathLike[str]
entrypoint: str
expires_at: datetime | str | None
metadata: Mapping[str, Any] | None
representations: Iterable[PublishRepresentation]
share_url: str | None
site_id: str | None
title: str
visibility: str

Source docstring:

text
Publish one exact directory through the product's public client seam.

The facade constructs and verifies the manifest locally, then delegates the complete
prepare/upload/commit transaction.  It never performs HTTP itself.  Until a runtime provides
``lsdtools.server.publish_client()``, callers that need server publication must pass an explicit
client; local artifacts can still use :meth:`PublishManifest.from_directory` directly.
By LSD Team · Last updated Sep 09, 2026 Ask a question View as Markdown
Type to search every doc, guide, and tutorial.
↑↓ navigate openesc close