qry

Ultra-fast file search and metadata extraction tool

πŸš€ Installation

Using Poetry (recommended):

# Install Poetry if you don't have it
curl -sSL https://install.python-poetry.org | python3 -


# Clone the repository and install dependencies
poetry install

Or using pip:

pip install -r requirements.txt

πŸš€ Quick Start

Using Poetry:

# Search with default scope (1 level up) and depth (2 levels)
poetry run qry "your search query"

# Custom scope and depth
poetry run qry "your search query" --scope 2 --max-depth 3

Direct Python execution:

# Basic search
python qry.py "your search query"

# With custom scope and depth
python qry.py "your search query" --scope 1 --max-depth 2

πŸ”§ Available Options

CLI Options

Usage: qry [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  search   Search for files
  version  Show version information
  help     Show help

Search Options:
  -t, --type TEXT     Filter by file type (comma-separated)
  -d, --last-days INT  Filter by last N days
  -l, --limit INT      Maximum number of results (default: 100)
  --no-preview        Disable preview generation
  -v, --verbose        Enable verbose output

API Endpoints

πŸ› οΈ Development

Project Structure

Adding a New Search Engine

  1. Create a new file in qry/engines/
  2. Implement the SearchEngine interface from qry.engines.base
  3. Register your engine in qry/engines/__init__.py

Running Tests

# Install test dependencies
pip install -e ".[test]"

# Run tests
pytest

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

🌟 Features

πŸš€ Najszybsze rozwiΔ…zania wedΕ‚ug kategorii:

πŸ“Š Przeszukiwanie JSON/CSV w HTML/MHTML:

Najszybsze jΔ™zyki/narzΔ™dzia:

  1. Rust + ripgrep - najszybszy dla prostych wzorcΓ³w regex
  2. C++ + PCRE2 - maksymalna wydajnoΕ›Δ‡ dla zΕ‚oΕΌonych wzorcΓ³w
  3. Python + ujson + lxml - najlepszy stosunek szybkoΕ›Δ‡/Ε‚atwoΕ›Δ‡
  4. Go + fastjson - bardzo szybki, Ε‚atwy deployment
  5. Node.js + cheerio - dobry dla projektΓ³w JS

πŸ” Ekstraktowanie metadanych:

Najszybsze biblioteki:

⚑ Najszybsze konwersje formatów:

  1. FFmpeg - niepobiΕ‚y w audio/video (C, Python bindings)
  2. ImageMagick/GraphicsMagick - obrazy (CLI + bindings)
  3. Pandoc - dokumenty tekstowe (Haskell, CLI)
  4. LibreOffice CLI - dokumenty biurowe
  5. wkhtmltopdf - HTML→PDF (WebKit engine)

🌐 Najszybsze generowanie HTML:

  1. Template engines: Jinja2 (Python), Mustache (multi-lang), Handlebars (JS)
  2. Direct generation: f-strings (Python), StringBuilder (Java/C#)
  3. Component-based: React SSR, Vue SSR dla zΕ‚oΕΌonych UI
  4. Streaming: Writer patterns dla bardzo duΕΌych plikΓ³w

✨ Key Features

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      QRY Features                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ πŸ” Smart Search               β”‚ Fast pattern matching   β”‚
β”‚ πŸ“Š Metadata Extraction        β”‚ EXIF, PDF, documents    β”‚
| ⚑ Parallel Processing        | Multi-core performance  β”‚
| 🎨 Format Conversion         | Convert between formats  β”‚
| πŸ“± Responsive Output         | HTML, JSON, text        β”‚
| πŸ›‘οΈ  Smart Caching            | Faster repeated queries  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

# Find all Python files containing 'class'
qry "class" --type py

# Search with regex
qry "import\s+\w+" --regex

Advanced Usage

graph LR
    A[Query] --> B{Type?}
    B -->|Search| C[File Search]
    B -->|Metadata| D[Metadata Extraction]
    B -->|Convert| E[Format Conversion]
    
    C --> F[Filter Results]
    D --> F
    E --> F
    
    F --> G[Format Output]
    G --> H[Display Results]
    
    style A fill:#f9f,stroke:#333
    style H fill:#9f9,stroke:#333

πŸ“š Documentation

For more examples and detailed documentation, see EXAMPLES.md.

🎯 Usage Examples

Basic Search

# Search for invoices
qry "invoice OR faktura"

# Search for images with EXIF data
qry "image with exif" --max-depth 3

# Search in parent directory
qry "important document" --scope 2

# Deep search in current directory only
qry "config" --scope 0 --max-depth 5
# Find PDFs modified in the last 7 days
qry "filetype:pdf mtime:>7d"

# Search for large files
qry "size:>10MB"

# Find files with specific metadata
qry "author:john created:2024"

System automatycznie: