Skip to content

Python tool that find an author his Chinese characters writing from https://www.shufazidian.com/, uses Selenium to find the matching calligraphy and downloads the full-size images in batched asynchronously into images/.

License

Notifications You must be signed in to change notification settings

prcpham-dev/Shufa-Character-Downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shufa Character Downloader

This project helps my dad automatically download Chinese calligraphy images from shufazidian.com to assist him with his drawing.

Features

  • Search for calligraphy images by author and character/phrase.
  • Automatically match images with the chosen author.
  • Save images to a local images/ folder.

Project images:

Shufa-Character-Downloader
├── images/                    # Downloaded calligraphy images (organized by character)
├── src/
│   ├── processHelpers/        # Helper scripts for different processing steps
│   │   ├── download.py        # Handles downloading calligraphy images
│   │   ├── filtering.py       # Handles finiding the right urls to use for each character.
│   │   ├── preprocess.py      # Load, save and prepare the settings
│   │   ├── scrape.py          # Scrapes image URLs and metadata from shufazidian.com
│   │   └── textRedirector.py  # Redirects or maps text inputs for interface
│   ├── engine.py              # Core engine that orchestrates scraping, downloading
│   ├── interface.py           # User interface logic
│   └── setting.json           # Configuration file to store user settings
├── myApp.py                   # Main entry point to launch the program
├── requirements.txt           # Python dependencies
├── README.md                  # Project documentation
├── LICENSE                    # License information
└── .gitignore                 # Git ignore file

Setup

  1. Install Python (if not already installed):
  • Windows: Download and install Python 3.9 or newer from python.org.
    Make sure to check "Add Python to PATH" during installation.
  • Mac: Download from python.org or use Homebrew:
    brew install python
  1. Create a virtual environment:
  • Windows:
    python -m venv venv
    venv\Scripts\activate
  • macOS and Linux:
    python3 -m venv venv
    source venv/bin/activate
  1. Install dependencies:

    pip install -r requirements.txt
  2. Run the program:

  • Windows:

    • Double-click myApp.py.
    • If it opens in an editor instead of running, right-click → Open with → choose Python.
  • macOS:
    Double-click myApp.py.
    If it opens in a text editor instead of running:

    • Step 1: Right-click myApp.pyGet Info.
    • Step 2: Under Open with, select Python Launcher.
  • Linux:
    Make the file executable (one-time setup):

    chmod +x myApp.py
    

How to Use

  1. Fill in your input:

    • Wait time: Number of seconds to wait between downloads (helps avoid being blocked and stuck on one task)
    • Process Amount: Number of character being progress at a time.
    • Download Amount: Total number of images to download per character.
    • Author: Enter the calligraphy master’s name (e.g., 苏轼).
    • Character Type: Choose calligraphy style (e.g., 行书, 草书, 楷书).
    • Chinese Text: Paste or type in Chinese characters, phrases, or full poems you want to download. !!!Only keep Chinese character
  2. Start the download:

    • Click Start to begin fetching images.
    • Progress and logs will be shown in Logs tab.
    • Download images are saved into the local images/ folder, organized by character.
  3. Manage images:

    • Use Delete Images to clear previously download images.
    • Use Open File to open the images/ file
    • Use Save Settings to preserve your current configuration for next time.

About

Python tool that find an author his Chinese characters writing from https://www.shufazidian.com/, uses Selenium to find the matching calligraphy and downloads the full-size images in batched asynchronously into images/.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages