Coder Social home page Coder Social logo

lysergic's Introduction

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.

lysergic's People

Contributors

philiporange avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.