/sniffler

Primary LanguagePython

Sniffler

Sniff out stuff about your files.

Installation

With rye

rye init . --virtual
rye sync --no-dev

With pip

Suggested to use a virtual environment.

pip install -r requirements.lock
pip install .

Usage

GUI version

Run the following command to start the GUI version of sniffler

sniffler

or

python src/sniffler/gui.py 

Django Web GUI

To run the Django web GUI, follow these steps:

  1. Apply migrations:

    rye run dj migrate
  2. Create a superuser:

    rye run dj createsuperuser
  3. Run the development server:

    rye run dj runserver
  4. Access the web GUI at http://127.0.0.1:8000/.

Testing the Django Web GUI

To test the Django Web GUI run:

rye run dj test sniffler.web_ui

CLI version

> sniffler-cli -h
usage: sniffler [-h] [-O OUTPUT] [--delimiter DELIMITER] path

Collect information about files in a directory.

positional arguments:
  path                  The path to the directory to collect information from.

options:
  -h, --help            show this help message and exit
  -O OUTPUT, --output OUTPUT
                        The path to the output file.
  --delimiter DELIMITER
                        The delimiter to use in the output file (',', ';', or 'tab').
  --search SEARCH       Search for files containing the given string in filename or attributes.

Alternatively, you can run src/sniffler directly.

python src/sniffler -h

This will collect information about the files in the current directory and output it to output.csv.

sniffler . -O output.csv

Note: When no output file is specified, the output will be printed to the console as a CSV.

Documentation

To generate the documentation, run the following command:

rye run build-docs

Documentation will be available in the docs/build/html directory.

To view the documentatation, run:

  1. On Windows:
start docs/build/html/index.html
  1. On MacOS:
open docs/build/html/index.html
  1. On Linux:
xdg-open docs/build/html/index.html