Python-Charmers

July 2, 2021 ยท View on GitHub

header

PyPI version GitHub version Execute Python-Charmers Upload to PyPI with Poetry license

A collection of useful python programs.

Installation

  1. Install MySQL
    • Debian/Ubuntu
      $ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
      
    • Red Hat/Cent OS
      % sudo yum install python3-devel mysql-devel
      
    • macOS
      # Install MySQL server
      $ brew install mysql
      # If you don't want to install MySQL server, you can use mysql-client instead:
      $ brew install mysql-client
      $ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.zprofile
      $ export PATH="/usr/local/opt/mysql-client/bin:$PATH"
      
  2. Install Python-Charmers (There are two ways to install):
    • Create an environment for Python-Charmers using Pyenv and Poetry (recommended)
      $ pyenv install 3.8.9
      $ pyenv local 3.8.9
      $ python -V
      Python 3.8.9
      $ poetry install
      
    • Install in a specific environment
      • Install from PyPI:
        $ sudo pip install Python-Charmers
        
      • Alternatively: install PyGuitar from the GitHub source:
        $ git clone https://github.com/iwasakishuto/Python-Charmers.git
        # If you want to use the latest version (under development)
        $ git clone -b develop https://github.com/iwasakishuto/Python-Charmers.git
        $ cd Python-Charmers
        $ sudo python setup.py install
        
  3. Install driver for selenium: Selenium requires a driver to interface with the chosen browser, so please visit the documentation to install it.
    # Example: Chrome
    # visit "chrome://settings/help" to check your chrome version.
    # visit "https://chromedriver.chromium.org/downloads" to check <Suitable.Driver.Version> for your chrome.
    $ wget https://chromedriver.storage.googleapis.com/<Suitable.Driver.Version>/chromedriver_mac64.zip
    $ unzip chromedriver_mac64.zip
    $ mv chromedriver /usr/local/bin/chromedriver
    $ chmod +x /usr/local/bin/chromedriver
    

Pyenv + Poetry

  • Pyenv is a python installation manager.
  • Poetry is a packaging and dependency manager.

I recommend you to use these tools to avoid the chaos of the python environment. See other sites for how to install these tools.

$ pyenv install 3.8.9
$ pyenv local 3.8.9
$ python -V
Python 3.8.9
$ poetry install 
$ poetry run pycharmers-show
$ poetry run book2img

CLI

CLI is a command line program that accepts text input to execute operating system functions.

# If you use Poetry to set up the environment.
$ poetry run pycharmers-show
|       command       |                         path                         |
|:-------------------:|:-----------------------------------------------------|
|            book2img | pycharmers.cli.book2img:book2img                     |
|         cv-cascades | pycharmers.cli.cvCascades:cvCascades                 |
|               :     |              :                                       |
|            tweetile | pycharmers.cli.tweetile:tweetile                     |
|           video2gif | pycharmers.cli.video2gif:video2gif                   |
commanddescription
book2imgConvert Book into Sequential Images.
cv-cascadesControl the OpenCV cascade Examples.
cv-paper-scannerPaper Scanner using OpenCV.
cv-pencil-sketchConvert the image like a pencil drawing.
cv-windowUse cvWindow to control frames.
form-auto-fill-inAuto fill in your form using your saved information (or answer on the spot).
jupyter-arrangeArrange Jupyter Notebook.
openBrowserDisplay url using the default browser.
pdfmineAnalyze PDF and extract various elements.
regexp-replacementString replacement in a file using regular expression
render-templateRender templates.
requirements-createCreate a requirements.text
revise_textRevise word file.
pycharmers-showShow all Python-Charmers's command line programs.
tweetileDivide one image into three so that you can tweet beautifully.
video_of_lyricCreate a lyric Video.
video_of_typingCreate a typing video. Before using this program, please do the following things
video2gifConvert Video into Gif.