Skip to main content

Package to check the integrity of a directory.

Project description

Treecker

What does it mean?

The name "Treecker" comes from the contraction of "tree" and "tracker".

What is it for?

Treecker is a Python package to control the integrity of a directory.

Is it hard to use?

Just type one of the available commands in a terminal.

Background

Have you ever wondered if you had accidentally destroyed or altered a part of the data contained in your favorite directory without realizing it? Do you want to be able to stamp a part of your data and to control at any time that they are always the state where you had left them? Do you think that one of your files has been corrupted, but you don't know which one? If so, this package is for you.

Features

This Python package is for inspecting and tracking the organization of files in a directory. A snapshot of the tree structure is saved in a file placed at the root of the tracked directory. At any time it is possible to compare the current state of the directory with the latest snapshot, and to save the new state. The program can also check that the file and folder names match a regular expression. This allows to detect errors in the naming of files. These features are accessible via the following commands:

  • init: To create the first snapshot of a directory.
  • status: To display the changes since last snapshot.
  • commit: To save the change in a new snapshot.
  • issues: To display incorrectly named files and directories.

Installation

Treecker is available on the Python Package Index. The easiest way to install it is to run the following command:

pip install treecker

Usage

Accepted arguments

Run the following commands to display information about the accepted arguments in each of the program features.

treecker init --help
treecker status --help
treecker commit --help
treecker issues --help

To execute the following commands in another directory than the one in which the command is executed, it is possible to use the option --dir, followed by the path of the tracked directory.

Initialization

To initialize a tree tracker in a directory, run the following command. This will create a file named treecker.json in the directory to track.

treecker init --hash

With the option --hash, treecker will compute and store a hash value of the tracked files. If this option is used, the generation time of the snapshot will be strongly lengthened, but it will be possible to detect possible data corruption in the future. If the option --no-hash is given instead, only the size of the files will be saved for future comparisons. Selecting --hash or --no-hash in the treecker initialization will determine if hash values are computed in future commits.

Status

To display the changes made since the last snapshot, execute the following command.

treecker status --hash

With the option --hash, treecker will compute the current hash values of the files in tracked directory and compare them to those saved in the latest snapshot. This option cannot be used if the treecker was initialized without hash values. With the option --no-hash, treecker will only perform file comparisons based on their size.

Commit

To save the change displayed in the status, run the following command. This will overwrite the treecker.json file.

treecker commit

Name verification

To display incorrectly nammed files and directories, execute the following command.

treecker issues

The regular expression to be matched can be redefined in a local configuration file.

Configuration

A special configuration can be set up to track a directory. For this, add a configuration file called treecker.conf at the root of the tracked directory, that is, next to the treecker.json file. It is then possible to choose, among others, which file or directory names will be ignored in the tracking or in the name verification:

[treecker.core.naming]
ignore = README* LICENSE* CITATION* INSTALL* SETUP* *.php LC_MESSAGES en_US en_GB fr_FR

[treecker.core.snapshot]
ignore = __pycache__ .git

For more configuration options, see the default configuration file default.conf.

Credits

  • Dunstan Becht

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

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

treecker-1.0.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

treecker-1.0.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file treecker-1.0.0.tar.gz.

File metadata

  • Download URL: treecker-1.0.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for treecker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 52484a9acdc3a0b3345e16400d594dbcdca9aa9e5fa2e5c89bf71476f842bf09
MD5 ac08d98f98c077f146471a734409c01d
BLAKE2b-256 1c17072304f9eb1f82ae152fc465b97f037186cdcd139cf6805620a6bd9da642

See more details on using hashes here.

File details

Details for the file treecker-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: treecker-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for treecker-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c4fe61045bab5020a1df534c01df4cf6940ad4f87c5dace67bb8d4d304ff908
MD5 22261be1f78af41ee0e187ccc06d7ba3
BLAKE2b-256 fd5ad3995c4ede8592235f9966bdc2eac44c735125b9597c456af3ea98786b6c

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