Add new CLI command for file name extraction and hash generation
- Implemented `get_filenames` command in `batch_extractor.py` to extract file names from a specified directory and generate a dated hash for each file. - Updated README.md with instructions for using the new command. - Enhanced PDF generation in `build_pdf.py` by modifying file naming conventions to include article and size. - Added example PowerShell script for batch processing tasks. - Introduced new example Excel file for user reference.
This commit is contained in:
30
resources/run_task_example.ps1
Normal file
30
resources/run_task_example.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
# 1. Устанавливаем кодировку вывода (UTF8)
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
|
||||
# 2. Переходим в корневую директорию проекта, где лежит batch_extractor.py
|
||||
# Скрипт находится в \data\, поэтому поднимаемся на один уровень вверх
|
||||
Set-Location "$PSScriptRoot\.."
|
||||
|
||||
# 3. Активация виртуального окружения
|
||||
& "c:/Python/CRPT/LabelExtractor/.venv/Scripts/Activate.ps1"
|
||||
|
||||
Write-Host "--- Окружение активировано. Начинаю обработку файлов... ---" -ForegroundColor Green
|
||||
|
||||
# 4. Список команд
|
||||
# Используем '--' перед аргументами, если пути содержат сложные символы
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск001, р. XL 110 шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975443_quantity_110.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск001, р. XL _04639970975443_110.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск001, р. XXL 20шт _c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975450_quantity_20.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск001, р. XXL _04639970975450_20.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск002, р. M 20 шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975467_quantity_20.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск002, р. M _04639970975467_20.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск002, р. XL 90шт _c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975481_quantity_90.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск002, р. XL _04639970975481_90.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск002, р. XXL 70шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975498_quantity_70.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск002, р. XXL _04639970975498_70.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск003, р. L 35шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975511_quantity_35.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск003, р. L _04639970975511_35.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск003, р. M 20 шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975504_quantity_20.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск003, р. M _04639970975504_20.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск003, р. XL 60 шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975528_quantity_60.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск003, р. XL _04639970975528_60.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск003, р. XXL 50 шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975535_quantity_50.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск003, р. XXL _04639970975535_50.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск004, р. L 10_a8f6b321-2601-4664-bcc0-fad7b529db76_gtin_04639970975559_quantity_10.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск004, р. L _04639970975559_10.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск004, р. M 5шт_c090cb9d-02fa-412b-ac91-ed7446f48d6d_gtin_04639970975542_quantity_5.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск004, р. M _04639970975542_5.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск004, р. XL 30шт _a8f6b321-2601-4664-bcc0-fad7b529db76_gtin_04639970975566_quantity_30.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск004, р. XL _04639970975566_30.xlsx"
|
||||
python batch_extractor.py from-pdf "C:\Python\CRPT\LabelExtractor\data\тнск004, р. XXL 20 шт_a8f6b321-2601-4664-bcc0-fad7b529db76_gtin_04639970975573_quantity_20.pdf" "C:\Python\CRPT\LabelExtractor\data\f\output\тнск004, р. XXL _04639970975573_20.xlsx"
|
||||
|
||||
|
||||
Write-Host "--- Все задачи выполнены успешно! ---" -ForegroundColor Cyan
|
||||
Reference in New Issue
Block a user