GithubHelp home page GithubHelp logo

searchlight's Introduction

Searchlight

GitHub license

Searchlight is a powerful and efficient Text Processing API for PDF's developed with Python. It processes Documents to highlight specified search words and includes various features like word search, unique words count, highlighting search word and integration with MongoDB and AWS S3 bucket.

Features

  • Word Search: Search for specific words in a PDF.
  • Unique Words Count: Count the number of unique words in a PDF.
  • Highlighting: Highlights the Search Word in the PDF.
  • MongoDB Integration: Store data and results in MongoDB.
  • AWS S3 Integration: Upload and retrieve PDFs from an AWS S3 bucket.

Installation

  1. Clone the repository
    git clone https://github.com/tratum/Searchlight.git
  2. Navigate to the project directory
    cd Searchlight
  3. Create and activate a virtual environment
    python -m venv .venv
    source .venv/bin/activate  # On Windows, use `.venv\Scripts\activate`   
  4. Install the required dependencies
    pip install -r requirements.txt

Configuration

  1. Create a .env file in the root directory
    cd Searchlight
    touch .env
  2. Navigate to the .env file and Configure your MongoDB and AWS S3 Settings
    ATLAS_URI= your_mongodb_uri
    DB_NAME= your_db_name
    COLLECTION_NAME= your_collection_name
    RAW_COLLECTION_NAME= your_collection_name
    USER_COLLECTION_NAME=tbl_users
    AWS_ACCESS_KEY ='your_aws_access_key'
    AWS_SECRET_KEY='your_aws_secret_access_key'
    BUCKET_NAME='your_s3_bucket_name'

Usage

  1. Start the API Server

    python -m uvicorn main:app --reload
  2. Use the following endpoint to upload a PDF and perform Text Processing

    http://127.0.0.1:8000/searchlight/upload

    Mandatory Parameters are:

    • keyword: The word to search and highlight in the PDF.
    • pdf : The PDF file to process.

Example

Here is an example of how to use the API with cURL:

  curl -X POST "http://127.0.0.1:8000/searchlight/upload" -F "keyword=example" -F "pdf=@/path/to/your/document.pdf"

Contribution

Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.

License

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

Acknowledgements

  • This project is built with FastAPI

searchlight's People

Contributors

tratum 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.