Skip to content

A powerful cross-platform CLI utility for precise file, directory, and data search and management.

License

Notifications You must be signed in to change notification settings

rahul4732saini/fise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytest CodeFactor

projectStatus pythonVersion License

StarProject Twitter LinkedIn

Description

FiSE (File Search Engine) is a powerful cross-platform command line utility designed for performing seamless file, directory, and data search and delete operations. It empowers users with the ability to perform comprehensive operations using intuitive SQL-like commands. It streamlines file management tasks, making it simple to locate, query, and modify files and directories with precision and efficiency. Additionally, this utility also allows exporting search records to files and databases in a professional manner. Ideal for developers, data analysts, system administrators, and power users, FiSE enhances productivity by providing a robust and flexible toolset for search and delete operations.

Features

  1. Cross-Platform Compatibility: Works seamlessly across multiple operating systems, including Windows, macOS, and Linux.

  2. Comprehensive Search Operations: Performs detailed searches for files, directories, and data within files with precise and efficient results.

  3. Intuitive SQL-like Commands: Utilizes familiar SQL-like syntax for conducting searches and managing files, reducing the learning curve.

  4. Case-Insensitive Queries: Allows queries to be case-insensitive, making searches more flexible and user-friendly.

  5. Advanced File Management: Provides tools for locating, querying, and modifying files and directories with precision and efficiency.

  6. Professional Export Capabilities: Offers export functionalities for search results to external files and databases, facilitating better data management and reporting.

  7. Productivity Enhancement Tools: Enhances workflow and efficiency with a comprehensive and flexible toolset for various file system operations.

Quick Guide

This guide offers a basic overview of the utility, highlighting some of the commonly used queries. It enables users to efficiently search, query, and manipulate files and directories across different operating systems.

FiSE offers two broad categories of operations, namely Search and Delete. These operations can be performed on files, file data, and directories, with the exception for file data for the Delete operation.

For a deeper insight, please refer to the Documentation.

Query Syntax Breakdown

The basic syntax of the query is shown below:

  • Search Query:
(EXPORT (FILE[<FILEPATH>]|SQL[<DATABASE>])) (R|RECURSIVE) SEARCH([<PARAMETERS>]) <FIELDS> FROM (RELATIVE|ABSOLUTE) (<FILEPATH>|<DIRECTORYPATH>) (WHERE <CONDITIONS>)
  • Delete Query:
(R|RECURSIVE) DELETE([<PARAMETERS>]) FROM (RELATIVE|ABSOLUTE) (<DIRECTORYPATH>) (WHERE <CONDITIONS>)

Where:

  1. (EXPORT (FILE[<FILEPATH>]|SQL[<DATABASE>])) is an optional command exclusive to the search operation and is used to export search records to a file or database.
  2. (R|RECURSIVE) is an optional command used to recursively include all the files and subdirectories present within the specified directory. If not explicitly specified, operations are only limited to the root directory.
  3. (SEARCH|DELETE)[<PARAMETERS>] defines the desired operation to be performed. Additional parameters can be specified within [] to toggle operations between different file types, and file-modes explicitly for data search operation.
  4. <FIELDS> is only limited to search operations for accessing metadata fields related to the searched files, data, or directories. Field names must be separated by commas. For more information about the different metadata fields that can be used in FiSE queries, please refer to the Query Fields guide.
  5. (RELATIVE|ABSOLUTE) is an optional command to specify whether to include the absolute path of the files/directories in the operation if the specified path to the directory is relative.
  6. (<FILEPATH>|<DIRECTORYPATH>) defines the path to the file/directory to operate upon. Filepath is only limited to data search operations as other operations cannot be performed on a single file.
  7. (WHERE <CONDITIONS>) is an optional query segment and is used for define conditions for filtering files, data, or directories. To know more about the various way for defining query conditions, please refer to the Query Conditions guide.

For a deeper insight into the query syntax, please refer to the Query Syntax guide.

Several example for both query types are defined in the following sections.

Overview of Search operation

The Search operation encompasses the ability to search files, file data, and directories facilitating precise retrieval by allowing users to filter records based on specified search conditions.

Search Query Syntax

  • File Search Query:
(EXPORT (FILE[<FILEPATH>]|SQL[<DATABASE>])) (R|RECURSIVE) SELECT([TYPE FILE]) <FIELDS> FROM (RELATIVE|ABSOLUTE) <DIRECTORYPATH> (WHERE <CONDITIONS>)
  • Data Search Query:
(EXPORT (FILE[<FILEPATH>]|SQL[<DATABASE>])) (R|RECURSIVE) SELECT[TYPE DATA(, MODE (TEXT|BYTES))] <FIELDS> FROM (RELATIVE|ABSOLUTE) (<FILEPATH>|<DIRECTORYPATH>) (WHERE <CONDITIONS>)
  • Directory Search Query:
(EXPORT (FILE[<FILEPATH>]|SQL[<DATABASE>])) (R|RECURSIVE) SELECT[TYPE DIR] <FIELDS> FROM (RELATIVE|ABSOLUTE) <DIRECTORYPATH> (WHERE <CONDITIONS>)

Search Query Examples

SELECT * FROM ./fise WHERE name LIKE '^.*\.py$'
EXPORT FILE[./records.csv] R SELECT[TYPE FILE] RELATIVE * FROM .
R SELECT[TYPE DIR] name, parent FROM ABSOLUTE ./fise WHERE name IN ('query', 'common')
EXPORT SQL[mysql] RECURSIVE SELECT[TYPE DIR] * FROM . WHERE name IN ('fise', 'tests', '.github') AND parent LIKE '^.*fise$'
SELECT[TYPE DATA] lineno, data FROM ./fise/query/parsers.py WHERE "This" IN data AND lineno BETWEEN (30, 210)
EXPORT FILE[./data.xlsx] R SELECT[TYPE DATA] * FROM ./fise/query WHERE name IN ('parsers.py', 'operators.py') AND data LIKE '^.*get_files.*$'

Overview of Delete Operation

The Delete operation encompasses the capability to remove files and subdirectories within the designated directory, empowering users to systematically eliminate undesired data based on specified filtering conditions.

Delete Query Syntax

  • File Deletion Query
(R|RECURSIVE) DELETE([TYPE FILE]) FROM <DIRECTORYPATH> (WHERE <CONDITIONS>)
  • Directory Deletion Query
(R|RECURSIVE) DELETE[TYPE DIR] FROM <DIRECTORYPATH> (WHERE <CONDITIONS>)

Delete Query Examples

DELETE FROM ./fise WHERE atime < '2015-08-15' AND name != "main.py"
R DELETE[TYPE FILE] FROM . WHERE name LIKE '^.*\.(js|cpp)$' OR SIZE[b] = 0
DELETE[TYPE DIR] FROM . WHERE name IN ("temp", "__pycache__", "test")
R DELETE[TYPE DIR] FROM ./fise

Legals

FiSE is distributed under the MIT License. Refer to LICENSE for more details.

Call for Contributions

The FiSE project always welcomes your precious expertise and enthusiasm! The package relies on its community's wisdom and intelligence to investigate bugs and contribute code. We always appreciate improvements and contributions to this project.

About

A powerful cross-platform CLI utility for precise file, directory, and data search and management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published