A directory scanning tool
Project description
Lysergic
Lysergic is a directory scanning tool. It allows you to quickly analyze file systems, compute file hashes, and extract metadata. It includes support for multi-threading and optional Magika integration for advanced file type detection.
Installation
You can install Lysergic using pip:
pip install lysergic
For Magika support, install with the 'magika' extra:
pip install lysergic[magika]
Command Line Usage
After installation, you can use Lysergic from the command line with the lsd
command:
lsd /path/to/directory
Optional arguments:
-o, --output FILE
: Specify output file (default: stdout)-c, --compress
: Compress output with gzip-m, --metadata
: Include file metadata-t, --threads N
: Number of threads to use (default: 1)--magika
: Use Magika for file type detection--eta
: Estimate processing time--no-progress
: Disable progress bars--salt STRING
: Salt to prepend to file contents before hashing
Example:
lsd /home/user/documents -o output.jsonl -c -m -t 4 --magika
This command will scan the /home/user/documents
directory, include metadata, use 4 threads, enable Magika, and save the compressed output to output.jsonl.gz
.
Python Module Usage
You can also use Lysergic as a Python module in your scripts:
from lysergic import LSD
# Initialize LSD
lsd = LSD("/path/to/directory", include_metadata=True, num_threads=4, use_magika=True)
# Process the directory and iterate over results
for file_info in lsd.process_directory():
print(file_info)
# Or process and save to a file
lsd.process_and_save("output.jsonl", compress=True)
# Estimate processing time
estimate = lsd.estimate_processing_time()
print(f"Estimated time: {LSD.format_time(estimate['total_estimated_time'])}")
License
This project is licensed under the Creative Commons Zero v1.0 Universal (CC0-1.0) License. This means you can copy, modify, distribute, and perform the work, even for commercial purposes, all without asking permission.
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
Built Distribution
File details
Details for the file lysergic-0.1.5.tar.gz
.
File metadata
- Download URL: lysergic-0.1.5.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c07a74e9d69d6a4b97d6dc386da2028098be8985fff445b1709772cc74a8d8b |
|
MD5 | db772a41b44424a19d078b3186fc0109 |
|
BLAKE2b-256 | cc9f6a44b65d203f4a012076150c3e83048020d120f4708de9a1d9f31b84a246 |
File details
Details for the file lysergic-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: lysergic-0.1.5-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f92dfde65604e367ac8497f48a0c20fddd901097b65a6adc2a1838bfbb582584 |
|
MD5 | d874d6590d232479e5dd4ed1fb069ed5 |
|
BLAKE2b-256 | d1c7820811620cc3426c758d66b3c372360a4e120744881c42b2bd0becd12dd8 |