Skip to main content

Create timestamp records for recursive operations on directory trees.

Reason this release was yanked:

storing wrong timestamp paths.

Project description

Treestamps

A library to set and retrieve timestamps to speed up operations run recursively on directory trees.

Documentation is pretty poor. Read the code for now.

Usage

Used in picopt and nudebomb. You can see how it's used in those projects.

    from pathlib import Path
    from treestamps import Grovestamps, GrovestampsConfig

    config = GrovestampsConfig(
        "MyProgramName",
        paths=("/foo", "/bar"),
        program_config={ "option_a": True, "option_b": False}
    )
    gs = Grovestamps(config)

    timestamp = gs[Path("/foo")].get()
    assert None == timestamp.get("file_relative_to_foo.txt")
    mtime = timestamp.set("file_relative_to_foo.txt")
    # mtime ~= now()
    # Also writes to `/foo/.MyProgramName_treestamps.wal.yaml`

    gs.dump()

Dumping removes /foo/.MyProgramName_treestamps.wal.yaml and writes to /foo/.MyProgramName_treestamps.yaml and /bar/.MyProgramName_treestamps.yaml

    # With similar config to above
    gs = Grovestamps(config)
    # Auto loads timestamps relevant to paths in config.

    timestamp_foo = gs[Path("/foo")].get()
    mtime_b = timestamp_foo.get("file_relative_to_foo.txt")
    mtime_a = timestamp_foo.get("another_file_relative_to_foo.txt")
    # mtime will be the time gs.dump() you called above.
    assert mtime_a == mtime_b

    timestamp_bar = gs[Path("/bar")].get()
    mtime_c = timestamp_foo.get("file_relative_to_bar.txt")
    assert mtime_c == mtime_a

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

treestamps-1.2.2.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

treestamps-1.2.2-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file treestamps-1.2.2.tar.gz.

File metadata

  • Download URL: treestamps-1.2.2.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for treestamps-1.2.2.tar.gz
Algorithm Hash digest
SHA256 f9940441d15a1be7a76eb27921e0142f48892822098660144b1a1c12e107e9c2
MD5 848b0ed1693438501e7476c8685e55ef
BLAKE2b-256 575cd4d77370ad9ec56af5ee384e0ff11a0cb8f770ddd5ef606a798b507b3931

See more details on using hashes here.

File details

Details for the file treestamps-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: treestamps-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for treestamps-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33fb4777dc1f857a63e19be5b940a5ac57e460267032f3b4e5e264e3013e427d
MD5 4d8751af52068ec47248197b4eca2ad4
BLAKE2b-256 3d960735d714fff698b59c9d8ba17d525a431130cb4ede6b2a04ed92dbc3f2a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page