Create timestamp records for recursive operations on directory trees.
Project description
Treestamps
A library to set and retrieve timestamps to speed up operations run recursively on directory trees.
Documentation is pretty poor.
📜 News
Treestamps has a NEWS file to summarize changes that affect users.
🕸️ HTML Docs
HTML formatted docs are available here
🛠️ Use
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
🛠️ API
There are some autogenerated API docs that might be better than nothing available in the header of this documentations, but it might just be better to read the code and look at the example of use in nudebomb.
🛠️ Development
Treestamps is hosted at Github
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file treestamps-2.2.7.tar.gz.
File metadata
- Download URL: treestamps-2.2.7.tar.gz
- Upload date:
- Size: 176.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f554abe09a27a437328ed2f9c18ac70893fef1a5e4855ba40ac5d677a7000b
|
|
| MD5 |
e944f7b50e4b1a50e3186090bc3e76ae
|
|
| BLAKE2b-256 |
ef68f53fcb6223dd00c6493f30328a31ec909cf3c61a3fde5dd12e201944be12
|
File details
Details for the file treestamps-2.2.7-py3-none-any.whl.
File metadata
- Download URL: treestamps-2.2.7-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4871ea255037eaad3bb759887bc08f3ba387c19ffee7dabba2477c04051828ee
|
|
| MD5 |
8b818b2df53cade278d08460dc262117
|
|
| BLAKE2b-256 |
cc8c43b4a7ea32e2117691f16964ce1225753ea9c814e994b1d39f924439c304
|