Giter Club home page Giter Club logo

clean-text's Introduction

Clean Text Clipboard

This project provides a Python script that cleans text from the clipboard by removing unnecessary spaces from text extracted from PDFs (principally but not exclusively). The goal is to make it easier to handle pasted text, making it more readable and ready for use in other applications.

Description

clean_text.py is a simple script that uses xclip to get text from the clipboard, cleans unnecessary spaces, and puts the cleaned text back into the clipboard. This script is especially useful for those working with text extracted from PDFs who want to automatically remove unwanted spaces.


Prerequisites

Make sure you have the following prerequisites installed on your system:

  • Python 3.x
  • xclip

Installation

  1. Clone the repository:

    git clone https://github.com/r0bertds/clean-text-clipboard.git /
    cd clean-text-clipboard
  2. Make the script executable:

    chmod +x clean_text.py
    
  3. Usage

3.1. Copy the text you want to clean to the clipboard.

3.2. Run the script manually:

xclip -o | python3 clean_text.py | xclip -selection clipboard

or set up a shortcut. In this case, I will use an example for the i3wm config file to run the script with an example command:

bindsym $mod+Shift+ç exec "xclip -o | python3 /path/to/clean_text.py | xclip -selection clipboard"

Paste the cleaned text wherever you need.


Contribution

Contributions are welcome! Feel free to open an issue or submit a pull request with improvements and fixes.

Fork the repository

  • Create a branch for your feature or bug fix (git checkout -b feature/MyFeature)
  • Commit your changes (git commit -am 'Added MyFeature')
  • Push to the branch (git push origin feature/MyFeature)
  • Open a Pull Request

Contact

For more information, please contact:

clean-text's People

Contributors

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