mil-kit 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mil_kit-0.3.0/.github/workflows/release.yml +42 -0
- mil_kit-0.3.0/.github/workflows/test.yml +33 -0
- mil_kit-0.3.0/.gitignore +207 -0
- mil_kit-0.3.0/.python-version +1 -0
- mil_kit-0.3.0/.vscode/settings.json +5 -0
- mil_kit-0.3.0/LICENSE +21 -0
- mil_kit-0.3.0/PKG-INFO +126 -0
- mil_kit-0.3.0/README.md +98 -0
- mil_kit-0.3.0/pyproject.toml +44 -0
- mil_kit-0.3.0/src/mil_kit/__init__.py +2 -0
- mil_kit-0.3.0/src/mil_kit/job.py +308 -0
- mil_kit-0.3.0/src/mil_kit/main.py +45 -0
- mil_kit-0.3.0/src/mil_kit/psd/__init__.py +0 -0
- mil_kit-0.3.0/src/mil_kit/psd/processor.py +77 -0
- mil_kit-0.3.0/tests/__init__.py +0 -0
- mil_kit-0.3.0/tests/data/simple-1textlayer-with-artboard.psd +0 -0
- mil_kit-0.3.0/tests/data/simple-2textlayer-with-artboard copy.psd +0 -0
- mil_kit-0.3.0/tests/smoke_test.py +26 -0
- mil_kit-0.3.0/tests/test_format.py +42 -0
- mil_kit-0.3.0/uv.lock +478 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
pypi-publish:
|
|
10
|
+
name: Upload release to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment:
|
|
13
|
+
name: pypi
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write
|
|
16
|
+
contents: read
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup uv
|
|
22
|
+
uses: astral-sh/setup-uv@v6
|
|
23
|
+
with:
|
|
24
|
+
version: latest
|
|
25
|
+
|
|
26
|
+
- name: Sync (install) dependencies
|
|
27
|
+
run: uv sync --frozen
|
|
28
|
+
|
|
29
|
+
- name: Build package
|
|
30
|
+
run: uv build
|
|
31
|
+
|
|
32
|
+
- name: Build
|
|
33
|
+
run: uv build
|
|
34
|
+
|
|
35
|
+
- name: Smoke test (wheel)
|
|
36
|
+
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
|
|
37
|
+
|
|
38
|
+
- name: Smoke test (source distribution)
|
|
39
|
+
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
|
|
40
|
+
|
|
41
|
+
- name: Publish
|
|
42
|
+
run: uv publish
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
tests:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12"]
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup uv
|
|
21
|
+
uses: astral-sh/setup-uv@v3
|
|
22
|
+
with:
|
|
23
|
+
version: latest
|
|
24
|
+
enable-cache: true
|
|
25
|
+
cache-dependency-glob: "uv.lock"
|
|
26
|
+
|
|
27
|
+
- name: Sync (install) dependencies
|
|
28
|
+
# --frozen ensures the lockfile isn't updated in CI
|
|
29
|
+
# --python ensures the correct version from the matrix is used
|
|
30
|
+
run: uv sync --dev --frozen --python ${{ matrix.python-version }}
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: uv run pytest -q --ignore=tests/smoke_test.py
|
mil_kit-0.3.0/.gitignore
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
#poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
#pdm.lock
|
|
116
|
+
#pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
#pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# SageMath parsed files
|
|
135
|
+
*.sage.py
|
|
136
|
+
|
|
137
|
+
# Environments
|
|
138
|
+
.env
|
|
139
|
+
.envrc
|
|
140
|
+
.venv
|
|
141
|
+
env/
|
|
142
|
+
venv/
|
|
143
|
+
ENV/
|
|
144
|
+
env.bak/
|
|
145
|
+
venv.bak/
|
|
146
|
+
|
|
147
|
+
# Spyder project settings
|
|
148
|
+
.spyderproject
|
|
149
|
+
.spyproject
|
|
150
|
+
|
|
151
|
+
# Rope project settings
|
|
152
|
+
.ropeproject
|
|
153
|
+
|
|
154
|
+
# mkdocs documentation
|
|
155
|
+
/site
|
|
156
|
+
|
|
157
|
+
# mypy
|
|
158
|
+
.mypy_cache/
|
|
159
|
+
.dmypy.json
|
|
160
|
+
dmypy.json
|
|
161
|
+
|
|
162
|
+
# Pyre type checker
|
|
163
|
+
.pyre/
|
|
164
|
+
|
|
165
|
+
# pytype static type analyzer
|
|
166
|
+
.pytype/
|
|
167
|
+
|
|
168
|
+
# Cython debug symbols
|
|
169
|
+
cython_debug/
|
|
170
|
+
|
|
171
|
+
# PyCharm
|
|
172
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
173
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
174
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
175
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
176
|
+
#.idea/
|
|
177
|
+
|
|
178
|
+
# Abstra
|
|
179
|
+
# Abstra is an AI-powered process automation framework.
|
|
180
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
181
|
+
# Learn more at https://abstra.io/docs
|
|
182
|
+
.abstra/
|
|
183
|
+
|
|
184
|
+
# Visual Studio Code
|
|
185
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
186
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
188
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
189
|
+
# .vscode/
|
|
190
|
+
|
|
191
|
+
# Ruff stuff:
|
|
192
|
+
.ruff_cache/
|
|
193
|
+
|
|
194
|
+
# PyPI configuration file
|
|
195
|
+
.pypirc
|
|
196
|
+
|
|
197
|
+
# Cursor
|
|
198
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
199
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
200
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
201
|
+
.cursorignore
|
|
202
|
+
.cursorindexingignore
|
|
203
|
+
|
|
204
|
+
# Marimo
|
|
205
|
+
marimo/_static/
|
|
206
|
+
marimo/_lsp/
|
|
207
|
+
__marimo__/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.10
|
mil_kit-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Heru Handika
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
mil_kit-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mil-kit
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A toolkit for processing the ASM's Mammal Image Library (MIL).
|
|
5
|
+
Project-URL: Homepage, https://github.com/hhandika/mil-kit
|
|
6
|
+
Project-URL: Repository, https://github.com/hhandika/mil-kit
|
|
7
|
+
Project-URL: Issues, https://github.com/hhandika/mil-kit/issues
|
|
8
|
+
Author-email: Heru Handika <herubiolog@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: automation,batch-processing,image-processing,photoshop,psd
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: pillow>=12.0.0
|
|
25
|
+
Requires-Dist: psd-tools>=1.12.0
|
|
26
|
+
Requires-Dist: tqdm>=4.67.1
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# mil-kit
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+

|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
A Python toolkit for batch processing the Mammal Image Library (MIL) images. Reshape, convert, and optimize images for the mammal diversity database and other applications.
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- 🚀 Batch process multiple PSD files in a directory
|
|
40
|
+
- ⚡ Parallel processing for faster execution
|
|
41
|
+
- 📊 Progress bar with detailed status
|
|
42
|
+
- 📝 Automatically hide all text layers
|
|
43
|
+
- 🖼️ Export processed files as PNG (default) or other formats
|
|
44
|
+
- 📁 Support for recursive directory processing
|
|
45
|
+
- ⚡ Preserve folder structure in output
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
Install using pip:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install mil-kit
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or using uv:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv add mil-kit
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
### Command Line
|
|
64
|
+
|
|
65
|
+
Process PSD files in a directory:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
mil-kit -d /path/to/psd/files
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Process recursively, specify output directory, and use JPEG format:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
mil-kit -d /path/to/psd/files -o /path/to/output -r -f jpeg
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Options
|
|
78
|
+
|
|
79
|
+
- `-d, --dir`: Input directory containing PSD files (required)
|
|
80
|
+
- `-o, --output`: Output directory for processed files (default: input directory)
|
|
81
|
+
- `-f, --output-format`: Output image format (default: png)
|
|
82
|
+
- `-r, --recursive`: Process subdirectories recursively
|
|
83
|
+
|
|
84
|
+
### Python API
|
|
85
|
+
|
|
86
|
+
You can also use mil-kit as a Python library:
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from mil_kit.psd.processor import PSDProcessor
|
|
90
|
+
from mil_kit.job import BatchJob
|
|
91
|
+
|
|
92
|
+
# Process a single file
|
|
93
|
+
processor = PSDProcessor("image.psd")
|
|
94
|
+
processor.load()
|
|
95
|
+
processor.hide_non_image_layers()
|
|
96
|
+
processor.export("output.jpg", format="jpeg")
|
|
97
|
+
|
|
98
|
+
# Batch process
|
|
99
|
+
job = BatchJob(
|
|
100
|
+
input_dir="./psd_files",
|
|
101
|
+
output_dir="./output",
|
|
102
|
+
recursive=True,
|
|
103
|
+
output_format="png",
|
|
104
|
+
max_workers=4
|
|
105
|
+
)
|
|
106
|
+
job.run()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Requirements
|
|
110
|
+
|
|
111
|
+
- Python >= 3.10
|
|
112
|
+
- psd-tools >= 1.12.0
|
|
113
|
+
- pillow >= 12.0.0
|
|
114
|
+
- tqdm >= 4.67.1
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
119
|
+
|
|
120
|
+
## Contributing
|
|
121
|
+
|
|
122
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
123
|
+
|
|
124
|
+
## Issues
|
|
125
|
+
|
|
126
|
+
Report bugs and request features on [GitHub Issues](https://github.com/hhandika/psd-toolkit/issues).
|
mil_kit-0.3.0/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# mil-kit
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
A Python toolkit for batch processing the Mammal Image Library (MIL) images. Reshape, convert, and optimize images for the mammal diversity database and other applications.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🚀 Batch process multiple PSD files in a directory
|
|
12
|
+
- ⚡ Parallel processing for faster execution
|
|
13
|
+
- 📊 Progress bar with detailed status
|
|
14
|
+
- 📝 Automatically hide all text layers
|
|
15
|
+
- 🖼️ Export processed files as PNG (default) or other formats
|
|
16
|
+
- 📁 Support for recursive directory processing
|
|
17
|
+
- ⚡ Preserve folder structure in output
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Install using pip:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install mil-kit
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or using uv:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
uv add mil-kit
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### Command Line
|
|
36
|
+
|
|
37
|
+
Process PSD files in a directory:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mil-kit -d /path/to/psd/files
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Process recursively, specify output directory, and use JPEG format:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
mil-kit -d /path/to/psd/files -o /path/to/output -r -f jpeg
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Options
|
|
50
|
+
|
|
51
|
+
- `-d, --dir`: Input directory containing PSD files (required)
|
|
52
|
+
- `-o, --output`: Output directory for processed files (default: input directory)
|
|
53
|
+
- `-f, --output-format`: Output image format (default: png)
|
|
54
|
+
- `-r, --recursive`: Process subdirectories recursively
|
|
55
|
+
|
|
56
|
+
### Python API
|
|
57
|
+
|
|
58
|
+
You can also use mil-kit as a Python library:
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from mil_kit.psd.processor import PSDProcessor
|
|
62
|
+
from mil_kit.job import BatchJob
|
|
63
|
+
|
|
64
|
+
# Process a single file
|
|
65
|
+
processor = PSDProcessor("image.psd")
|
|
66
|
+
processor.load()
|
|
67
|
+
processor.hide_non_image_layers()
|
|
68
|
+
processor.export("output.jpg", format="jpeg")
|
|
69
|
+
|
|
70
|
+
# Batch process
|
|
71
|
+
job = BatchJob(
|
|
72
|
+
input_dir="./psd_files",
|
|
73
|
+
output_dir="./output",
|
|
74
|
+
recursive=True,
|
|
75
|
+
output_format="png",
|
|
76
|
+
max_workers=4
|
|
77
|
+
)
|
|
78
|
+
job.run()
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Requirements
|
|
82
|
+
|
|
83
|
+
- Python >= 3.10
|
|
84
|
+
- psd-tools >= 1.12.0
|
|
85
|
+
- pillow >= 12.0.0
|
|
86
|
+
- tqdm >= 4.67.1
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
91
|
+
|
|
92
|
+
## Contributing
|
|
93
|
+
|
|
94
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
95
|
+
|
|
96
|
+
## Issues
|
|
97
|
+
|
|
98
|
+
Report bugs and request features on [GitHub Issues](https://github.com/hhandika/psd-toolkit/issues).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "mil-kit"
|
|
3
|
+
version = "0.3.0"
|
|
4
|
+
description = "A toolkit for processing the ASM's Mammal Image Library (MIL)."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
authors = [{ name = "Heru Handika", email = "herubiolog@gmail.com" }]
|
|
9
|
+
keywords = [
|
|
10
|
+
"psd",
|
|
11
|
+
"photoshop",
|
|
12
|
+
"batch-processing",
|
|
13
|
+
"image-processing",
|
|
14
|
+
"automation",
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: End Users/Desktop",
|
|
20
|
+
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
|
|
21
|
+
"Topic :: Utilities",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
]
|
|
29
|
+
dependencies = ["pillow>=12.0.0", "psd-tools>=1.12.0", "tqdm>=4.67.1"]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/hhandika/mil-kit"
|
|
33
|
+
Repository = "https://github.com/hhandika/mil-kit"
|
|
34
|
+
Issues = "https://github.com/hhandika/mil-kit/issues"
|
|
35
|
+
|
|
36
|
+
[dependency-groups]
|
|
37
|
+
dev = ["pytest>=9.0.1"]
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
mil-kit = "mil_kit.main:main"
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = ["hatchling"]
|
|
44
|
+
build-backend = "hatchling.build"
|