Skip to content

Documentation / tutorial: File operations as data management #12

@djdarcy

Description

@djdarcy

Summary

Write a "File operations as data management" tutorial that demonstrates
the v0.3.0 dazzle_filekit.data API in realistic workflows without
ever mentioning the word "primitive".

This is the user-facing counterpart to the v0.2.4 docs/unctools-integration.md
guide, but one layer up: instead of showing how to compose primitives,
it shows how to use the seamless data.* API to do backup, mirror,
sync, and archive operations.

Target audience

Someone who:

  • Knows Python but isn't a systems programmer
  • Has heard "copy this file from there to here with metadata and a
    hash" and wants one obvious way to do it
  • Doesn't want to think about UNC vs drive letter, or whether they're
    on Windows or WSL
  • Wants their code to work the same on all three platforms

Structure

  1. Intro: the "data management" framing. A file is data with a
    location, not a sequence of bytes at a particular OS path.
  2. Hello world: data.copy(src, dst) with a Windows path, a Linux
    path, and a UNC path. Show they all work the same.
  3. Rich preservation: data.copy(src, dst, preserve="all") with
    a Windows SDDL example, a Linux xattrs example, and a macOS
    quarantine-skip example.
  4. Verification: data.copy(src, dst, verify="sha256") and how the
    hash comparison catches silent corruption.
  5. Manifests: data.copy(src, dst, manifest=True) and what the
    sidecar .json file looks like. Show how to restore from the
    manifest later.
  6. Mirror a directory: data.sync(src_dir, dst_dir, mode="mirror")
    with a real example (back up ~/projects to an external drive).
  7. The object flavor: doc = data.open(path); doc.copy_to(...)
    as an alternative style. Show .metadata, .hash_sha256, .sibling().
  8. Graceful degradation: what happens if you don't install preservelib
    or unctools. When do you need them? (Short answer: only for specific
    features; the default behavior works without them.)
  9. Cross-platform: show the same tutorial code running identically
    on Windows, Linux, and WSL. Mention is_wsl() as an escape hatch
    for tools that need to know.
  10. "I'm coming from shutil": migration guide from shutil.copy*,
    shutil.move, shutil.copytree to the data.* equivalents.

Where it lives

  • Primary location: docs/data-management-tutorial.md
  • README should link to it from the Quick Start section as
    "For a full walkthrough, see the Data Management tutorial"
  • Possibly also published as a blog post or GitHub wiki page (future)

Acceptance criteria

  • docs/data-management-tutorial.md exists
  • Every code example in the tutorial is runnable -- ideally
    as doctests or as snippets pulled from an actual test file
  • The tutorial runs cleanly on both Windows and Linux (the
    cross-platform runner script should cover it)
  • README links to the tutorial from the Quick Start section
  • The tutorial does NOT use the word "primitive" or explain
    filekit's internal architecture -- it's user-facing only

Dependencies

  • Blocked by: #N+1 (data submodule), #N+2 (DataRef API), and
    #N+4 (parse_user_input_path) -- needs the full v0.3.0 API to
    exist before we can document it

Non-goals

  • This is NOT the reference documentation -- that's a separate,
    generated-from-docstrings artifact (see API_STABILITY.md for the
    locked surface we'd auto-generate from)
  • This is NOT a design document -- no "why we made this decision"
    content, just "here's how to use it"

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationlayer-1High-level workflow API on top of primitivesv0.3.0Targeted for v0.3.0 release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions