@@ -167,13 +167,19 @@ def encode(self, value: bytes, *, key: dict | None = None, store_name: str | Non
167167 """
168168 Store content and return metadata.
169169
170- Args:
171- value: Raw bytes to store.
172- key: Primary key values (unused).
173- store_name: Store to use. If None, uses default store.
174-
175- Returns:
176- Metadata dict: {hash, store, size}
170+ Parameters
171+ ----------
172+ value : bytes
173+ Raw bytes to store.
174+ key : dict, optional
175+ Primary key values (unused).
176+ store_name : str, optional
177+ Store to use. If None, uses default store.
178+
179+ Returns
180+ -------
181+ dict
182+ Metadata dict: ``{hash, store, size}``.
177183 """
178184 from .content_registry import put_content
179185
@@ -183,11 +189,16 @@ def decode(self, stored: dict, *, key: dict | None = None) -> bytes:
183189 """
184190 Retrieve content by hash.
185191
186- Args:
187- stored: Metadata dict with 'hash' and optionally 'store'.
188- key: Primary key values (unused).
192+ Parameters
193+ ----------
194+ stored : dict
195+ Metadata dict with ``'hash'`` and optionally ``'store'``.
196+ key : dict, optional
197+ Primary key values (unused).
189198
190- Returns:
199+ Returns
200+ -------
201+ bytes
191202 Original bytes.
192203 """
193204 from .content_registry import get_content
@@ -275,19 +286,20 @@ def encode(
275286 """
276287 Store content and return metadata.
277288
278- Args:
279- value: Content to store. Can be:
280- - bytes: Raw bytes to store as file
281- - str/Path: Path to local file or folder to upload
282- key: Dict containing context for path construction:
283- - _schema: Schema name
284- - _table: Table name
285- - _field: Field/attribute name
286- - Other entries are primary key values
287- store_name: Store to use. If None, uses default store.
288-
289- Returns:
290- Metadata dict suitable for ObjectRef.from_json()
289+ Parameters
290+ ----------
291+ value : bytes, str, or Path
292+ Content to store: bytes (raw data), or str/Path (file/folder to upload).
293+ key : dict, optional
294+ Context for path construction with keys ``_schema``, ``_table``,
295+ ``_field``, plus primary key values.
296+ store_name : str, optional
297+ Store to use. If None, uses default store.
298+
299+ Returns
300+ -------
301+ dict
302+ Metadata dict suitable for ``ObjectRef.from_json()``.
291303 """
292304 from datetime import datetime , timezone
293305 from pathlib import Path
@@ -381,12 +393,17 @@ def decode(self, stored: dict, *, key: dict | None = None) -> Any:
381393 """
382394 Create ObjectRef handle for lazy access.
383395
384- Args:
385- stored: Metadata dict from database.
386- key: Primary key values (unused).
387-
388- Returns:
389- ObjectRef for accessing the stored content.
396+ Parameters
397+ ----------
398+ stored : dict
399+ Metadata dict from database.
400+ key : dict, optional
401+ Primary key values (unused).
402+
403+ Returns
404+ -------
405+ ObjectRef
406+ Handle for accessing the stored content.
390407 """
391408 from .objectref import ObjectRef
392409 from .content_registry import get_store_backend
@@ -396,7 +413,7 @@ def decode(self, stored: dict, *, key: dict | None = None) -> Any:
396413 return ObjectRef .from_json (stored , backend = backend )
397414
398415 def validate (self , value : Any ) -> None :
399- """Validate that value is bytes, path, dict metadata, or (extension , data) tuple."""
416+ """Validate value is bytes, path, dict metadata, or (ext , data) tuple."""
400417 from pathlib import Path
401418
402419 if isinstance (value , bytes ):
@@ -463,13 +480,19 @@ def encode(self, value: Any, *, key: dict | None = None, store_name: str | None
463480 """
464481 Read file and encode as filename + contents.
465482
466- Args:
467- value: Path to file (str or Path).
468- key: Primary key values (unused).
469- store_name: Unused for internal storage.
470-
471- Returns:
472- Bytes: filename (UTF-8) + null byte + file contents
483+ Parameters
484+ ----------
485+ value : str or Path
486+ Path to file.
487+ key : dict, optional
488+ Primary key values (unused).
489+ store_name : str, optional
490+ Unused for internal storage.
491+
492+ Returns
493+ -------
494+ bytes
495+ Filename (UTF-8) + null byte + file contents.
473496 """
474497 from pathlib import Path
475498
@@ -487,12 +510,17 @@ def decode(self, stored: bytes, *, key: dict | None = None) -> str:
487510 """
488511 Extract file to download path and return local path.
489512
490- Args:
491- stored: Blob containing filename + null + contents.
492- key: Primary key values (unused).
493-
494- Returns:
495- Path to extracted file as string.
513+ Parameters
514+ ----------
515+ stored : bytes
516+ Blob containing filename + null + contents.
517+ key : dict, optional
518+ Primary key values (unused).
519+
520+ Returns
521+ -------
522+ str
523+ Path to extracted file.
496524 """
497525 from pathlib import Path
498526
@@ -592,13 +620,19 @@ def encode(self, value: Any, *, key: dict | None = None, store_name: str | None
592620 """
593621 Store path reference as JSON metadata.
594622
595- Args:
596- value: Relative path within the store (str).
597- key: Primary key values (unused).
598- store_name: Store where the file exists.
599-
600- Returns:
601- Metadata dict: {path, store}
623+ Parameters
624+ ----------
625+ value : str
626+ Relative path within the store.
627+ key : dict, optional
628+ Primary key values (unused).
629+ store_name : str, optional
630+ Store where the file exists.
631+
632+ Returns
633+ -------
634+ dict
635+ Metadata dict: ``{path, store}``.
602636 """
603637 from datetime import datetime , timezone
604638
@@ -629,12 +663,17 @@ def decode(self, stored: dict, *, key: dict | None = None) -> Any:
629663 """
630664 Create ObjectRef handle for lazy access.
631665
632- Args:
633- stored: Metadata dict with path and store.
634- key: Primary key values (unused).
635-
636- Returns:
637- ObjectRef for accessing the file.
666+ Parameters
667+ ----------
668+ stored : dict
669+ Metadata dict with path and store.
670+ key : dict, optional
671+ Primary key values (unused).
672+
673+ Returns
674+ -------
675+ ObjectRef
676+ Handle for accessing the file.
638677 """
639678 from .objectref import ObjectRef
640679 from .content_registry import get_store_backend
0 commit comments