Skip to main content

Keep your important files safe.

Make them unable to be modified or deleted by any user, even root.

Installation

$ pip install entomb

How it works

Entomb recursively sets/unsets the immutable attribute on all files on a path using the chattr command.

Files in .git directories are ignored by default, but can be included.

The immutable attribute is never set on directories, because this would stop files being created in those directories. Entomb works on files only.

At the moment Entomb only works on Linux.

Entomb has no dependencies.

Examples

$ # Make all files in ~/photos immutable.
$ entomb ~/photos

$ # List all files in ~/photos which are not immutable.
$ entomb --list-mutable ~/photos

$ # Report on how many files in ~/photos are and aren't immutable.
$ entomb --report ~/photos

$ # Do a dry run on ~/photos, including any git files/directories.
$ entomb -d -g ~/photos

$ # Make all files in ~/photos mutable (i.e. unset the immutable
$ # attribute).
$ entomb -u ~/photos

Usage

$ entomb --help
usage: entomb [options] path

Manage file immutability.

positional arguments:
  path               the path to operate on

optional arguments:
  -h, --help         show this help message and exit
  -d, --dry-run      make no changes
  -g, --include-git  include .git directories (excluded by default)
  --list-immutable   list all immutable files
  --list-mutable     list all mutable files
  -r, --report       display a status report
  -u, --unset        unset immutability
  -v, --version      show program's version number and exit

Development

Get set up, preferably in a virtualenv:

$ make init
$ make install

Lint the code:

$ make lint

Run the tests:

$ make test

Check the test coverage:

$ make coverage

Releasing

  1. Check out the main branch.

  2. Ensure CHANGELOG.rst includes everything to go in the release and is committed.

  3. Ensure everything to go in the release is committed.

  4. Increment the version in __init__.py.

  5. Shift everything in the Unreleased section of CHANGELOG.rst to a new section named with the new version number and the current date.

  6. Ensure CI runs without warnings or errors:

    $ make ci
  7. Make and tag the release commit:

    $ make release
  8. Build the package:

    $ make package
  9. Publish the package to PyPI:

    $ make publish
  10. Push to the repo and clean up packaging artifacts:

    $ make push
    $ make clean
  11. Create a GitHub release.

Code style

  1. Only modules are imported. Classes, functions and variables are not imported directly.

  2. A module’s functions are ordered alphabetically.

  3. A module’s private functions are placed alphabetically at the bottom of the module.

  4. Docstrings follow the NumPy docstring guide.

  5. Strings are enclosed with double quotes.

  6. The last item of a multi-line dictionary or list has a trailing comma.

Changes

For what has changed in each version, see CHANGELOG.rst.

Metadata

Release files for entomb 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for entomb 0.4.0
File Size Uploaded Provenance Actions
entomb-0.4.0.tar.gz 22.9 kB Without provenance Details for entomb-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for entomb 0.4.0
File Interpreter ABI Platform Actions
entomb-0.4.0-py3-none-any.whl Python 3 none any Details for entomb-0.4.0-py3-none-any.whl

Total release size: 50.3 kB

Release files / entomb-0.4.0.tar.gz

Download URL entomb-0.4.0.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0046984d91bc7f0e8f1be44db99a4b7c8e857995a1024f682257245c5a14661c
BLAKE2b-256 checksum
How to use checksums
d76161f384e8438cee3b0e1ef691ad81414bd2f922caa77c0f88d617f8943cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

Release files / entomb-0.4.0-py3-none-any.whl

Download URL entomb-0.4.0-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b43af44616c14ad5388977359a35951263a36a268a0adbf4511ff391dbf40ee4
BLAKE2b-256 checksum
How to use checksums
59d43046b3f44fad551fd068ec67e1be5f3267f9d454a5ab07251e0faca7377e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

Security for entomb 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page