All docs
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.
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.
MAX_FILE_BYTES = 256 * 1024 * 1024
lsdtools.publish.MAX_MANIFEST_BYTES#
Kind: value. Source: sdk/src/lsdtools/publish.py:53.
MAX_MANIFEST_BYTES = 4 * 1024 * 1024
lsdtools.publish.MAX_MANIFEST_FILES#
Kind: value. Source: sdk/src/lsdtools/publish.py:52.
MAX_MANIFEST_FILES = 20000
lsdtools.publish.MAX_REVISION_BYTES#
Kind: value. Source: sdk/src/lsdtools/publish.py:51.
MAX_REVISION_BYTES = 2 * 1024 * 1024 * 1024
lsdtools.publish.PUBLISH_SCHEMA_VERSION#
Kind: value. Source: sdk/src/lsdtools/publish.py:49.
PUBLISH_SCHEMA_VERSION = 1
lsdtools.publish.PublishClient#
Kind: class. Source: sdk/src/lsdtools/publish.py:667.
Source docstring:
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.
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
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:
One immutable content-addressed file in a v1 publish manifest.
lsdtools.publish.PublishFile.path#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:312.
path: str
lsdtools.publish.PublishFile.sha256#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:313.
sha256: str
lsdtools.publish.PublishFile.size#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:314.
size: int
lsdtools.publish.PublishFile.media_type#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:315.
media_type: str
lsdtools.publish.PublishFile.to_dict#
Kind: method. Source: sdk/src/lsdtools/publish.py:327.
to_dict(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Return a fresh JSON-safe v1 file descriptor.
lsdtools.publish.PublishManifest#
Kind: class. Source: sdk/src/lsdtools/publish.py:394.
Source docstring:
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.
title: str
lsdtools.publish.PublishManifest.entrypoint#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:403.
entrypoint: str
lsdtools.publish.PublishManifest.files#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:404.
files: tuple[PublishFile, ...]
lsdtools.publish.PublishManifest.representations#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:405.
representations: tuple[PublishRepresentation, ...]
representations = ()
lsdtools.publish.PublishManifest.metadata#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:406.
metadata: Mapping[str, Any]
metadata = field(default_factory=dict)
lsdtools.publish.PublishManifest.schema_version#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:407.
schema_version: int
schema_version = PUBLISH_SCHEMA_VERSION
lsdtools.publish.PublishManifest.content_sha256#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:408.
content_sha256: str
content_sha256 = field(init=False)
lsdtools.publish.PublishManifest.from_directory#
Kind: method. Source: sdk/src/lsdtools/publish.py:459.
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
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:
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.
to_dict(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
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:
A package-owned semantic representation inside a generic published site.
lsdtools.publish.PublishRepresentation.id#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:342.
id: str
lsdtools.publish.PublishRepresentation.kind#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:343.
kind: str
lsdtools.publish.PublishRepresentation.entrypoint#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:344.
entrypoint: str | None
entrypoint = None
lsdtools.publish.PublishRepresentation.files#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:345.
files: tuple[str, ...]
files = ()
lsdtools.publish.PublishRepresentation.metadata#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:346.
metadata: Mapping[str, Any]
metadata = field(default_factory=dict)
lsdtools.publish.PublishRepresentation.version#
Kind: attribute. Source: sdk/src/lsdtools/publish.py:347.
version: int
version = PUBLISH_SCHEMA_VERSION
lsdtools.publish.PublishRepresentation.to_dict#
Kind: method. Source: sdk/src/lsdtools/publish.py:380.
to_dict(self) -> dict[str, Any]
self: (unannotated)
Source docstring:
Return a fresh JSON-safe v1 representation descriptor.
lsdtools.publish.PublishUnavailableError#
Kind: class. Source: sdk/src/lsdtools/publish.py:100.
Source docstring:
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.
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
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:
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.