Skip to content

Repository files navigation

Convenient Toolkit

Bộ công cụ CLI tổng hợp gồm 5 script độc lập, quản lý qua một menu trung tâm.


Cấu trúc thư mục

├── app.py
├── backup_automation_script
│   └── backup_automation_script.py
├── file_convert
│   ├── converter.py
│   └── requirements.txt
├── requirements.txt
├── system_info_script
│   ├── requirements.txt
│   └── system_info_script.py
├── video2text
│   ├── input
│   ├── output
│   ├── requirements.txt
│   ├── venv
│   │   ├── Include
│   │   ├── Lib
│   │   ├── pyvenv.cfg
│   │   ├── Scripts
│   │   └── share
│   └── video2text.py
└── video_downloader
    ├── requirements.txt
    └── video_downloader.py


Yêu cầu hệ thống

Thứ Phiên bản tối thiểu
Python 3.10+
FFmpeg bất kỳ (stable)
LibreOffice 7.x+

1. Cài Python

Windows

  1. Tải tại https://www.python.org/downloads/
  2. Tick "Add Python to PATH" khi cài
  3. Kiểm tra:
python --version
pip --version

Linux (Ubuntu/Debian)

sudo apt update
sudo apt install python3 python3-pip python3-venv -y

macOS

brew install python

2. Tạo môi trường ảo (khuyến nghị)

Windows

python -m venv venv
venv\Scripts\activate

Linux / macOS

python3 -m venv venv
source venv/bin/activate

Sau khi kích hoạt, dấu nhắc terminal sẽ hiển thị (venv).
Để thoát môi trường ảo: deactivate


3. Cài thư viện Python

pip install -r requirements.txt

Danh sách thư viện:

Thư viện Dùng bởi
psutil system_info_script
pyyaml system_info_script
pdf2docx converter
reportlab converter
yt-dlp video_downloader, video2text
faster-whisper video2text
tqdm video2text

4. Cài FFmpeg

Dùng bởi converter.py (video→audio) và video_downloader.py.

Windows

  1. Tải tại https://ffmpeg.org/download.html → chọn Windows builds
  2. Giải nén, ví dụ vào C:\ffmpeg\
  3. Thêm C:\ffmpeg\bin vào System PATH:
    • Tìm kiếm "Environment Variables"PathEditNew → dán đường dẫn
  4. Kiểm tra:
ffmpeg -version

Linux

sudo apt install ffmpeg -y

macOS

brew install ffmpeg

5. Cài LibreOffice

Dùng bởi converter.py để chuyển đổi DOC / PPT → PDF.

Windows

Tải và cài tại: https://www.libreoffice.org/download/

Linux

sudo apt install libreoffice -y

macOS

brew install --cask libreoffice

6. Chạy toàn bộ qua menu trung tâm

python convenient/menu.py

Giao diện menu sẽ hiển thị, chọn tool bằng số 15.

Các flag CLI

# Liệt kê tất cả tool
python convenient/menu.py --list

# Mở thẳng một tool (sẽ hỏi args)
python convenient/menu.py --tool backup
python convenient/menu.py --tool convert
python convenient/menu.py --tool sysinfo
python convenient/menu.py --tool downloader
python convenient/menu.py --tool video2text

# Mở tool và truyền args luôn
python convenient/menu.py --tool sysinfo --args "--short"
python convenient/menu.py --tool downloader --args '-u "https://youtu.be/xxx" -p ./videos'

# Tắt màu (dùng khi SSH hoặc pipe output)
python convenient/menu.py --no-color

7. Chạy từng tool riêng lẻ

Backup Automation

# Backup một file
python backup_automation_script/backup_automation_script.py -f document.txt

# Backup thư mục, giữ cấu trúc, lưu vào ./backups
python backup_automation_script/backup_automation_script.py -f ./src -p ./backups -k -r

# Backup chỉ file .py và nén zip
python backup_automation_script/backup_automation_script.py -f ./src --pattern "*.py" -r -c

# Xem lịch sử backup
python backup_automation_script/backup_automation_script.py -l

File Converter

# TXT → PDF
python file_convert/converter.py -f document.txt -o pdf

# PDF → DOCX
python file_convert/converter.py -f document.pdf -o docx

# PPT → PDF
python file_convert/converter.py -f slides.pptx -o pdf

# Video → MP3
python file_convert/converter.py -f video.mp4 -o mp3

# Nhiều file, lưu vào thư mục chỉ định
python file_convert/converter.py -f a.txt b.md -o pdf -p ./output

System Info

# Hiển thị đầy đủ (như neofetch)
python system_info_script/system_info_script.py

# Tóm tắt
python system_info_script/system_info_script.py -s

# Xuất JSON
python system_info_script/system_info_script.py -j

# Theo dõi real-time (cập nhật mỗi 2s)
python system_info_script/system_info_script.py --watch

# Chỉ hiển thị CPU và RAM
python system_info_script/system_info_script.py --filter CPU,Memory

Video Downloader

# Tải 1 video (chất lượng cao nhất)
python video_downloader/video_downloader.py -u "https://youtu.be/xxx"

# Tải nhiều video
python video_downloader/video_downloader.py -u "https://youtu.be/aaa" "https://youtu.be/bbb"

# Tải vào thư mục chỉ định
python video_downloader/video_downloader.py -u "https://youtu.be/xxx" -p ./videos

Video → Text (Whisper)

# Transcribe file local → TXT
python video2text/video2text.py -f video.mp4

# Transcribe → Markdown + file phụ đề .srt
python video2text/video2text.py -f video.mp4 -o md --subtitle --timestamps

# Transcribe từ YouTube URL
python video2text/video2text.py -u "https://youtu.be/xxx"

# Dùng model lớn hơn (chính xác hơn, chậm hơn)
python video2text/video2text.py -f video.mp4 --model large-v3

# Dùng GPU (cần CUDA)
python video2text/video2text.py -f video.mp4 --device cuda --model large-v3

# Lưu kết quả vào thư mục chỉ định
python video2text/video2text.py -f video.mp4 -p ./video2text/output

Gỡ lỗi thường gặp

Lỗi Nguyên nhân Cách xử lý
ModuleNotFoundError Chưa cài thư viện pip install -r requirements.txt
ffmpeg not found FFmpeg chưa vào PATH Xem mục 4
LibreOffice not found LibreOffice chưa cài Xem mục 5
CUDA error GPU không hỗ trợ Dùng --device cpu
Script không tìm thấy Sai thư mục chạy Chạy từ thư mục gốc project/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages