Merge branch 'refactor/package-structure' into 'main'

Refactor/package structure

See merge request CodeByMrFinchum/optima35!10
This commit is contained in:
Mr Finchum 2025-01-03 12:56:30 +00:00
commit 3d19c81385
9 changed files with 73 additions and 37 deletions

7
.gitignore vendored
View file

@ -1,7 +1,4 @@
local_files/
debug.*
debug_log/
test/
dist/
.ropeproject/
__pycache__/
config/tui_settings.yaml
config/exif.yaml

View file

@ -1,6 +1,12 @@
# Changelog
## 0.6.x
### 0.6.3-a2
- Adding __version__ to `__init__.py` so version is automaticly updated in program as well as pypi.
### 0.6.3-a1
- Adding postfix a to indicate alpha version, making it clear that it is in an early state
### 0.6.2
- Version on pypi.
- .1 and .2 have no change, but had to republish the file, which required to increase the version number.

View file

@ -1,11 +1,13 @@
# OPTIMA-35
Very WIP...
Splitting core (OPTIMA35 (this)) and ui ([OptimaLab35](https://gitlab.com/CodeByMrFinchum/optima-lab-35))
# OPTIMA35
[optima35](https://gitlab.com/CodeByMrFinchum/optima35) is a package utilizing pillow and piexif to modify images, I have also an GUI for this package, [OptimaLab35](https://gitlab.com/CodeByMrFinchum/OptimaLab35)
[pip package](https://pypi.org/project/optima35/)
can be installed with pip, dependencies will be installed automaticly.
```bash
pip install optima35
```
## Overview
**OPTIMA-35** (**Organizing, Processing, Tweaking Images, and Modifying scanned Analogs from 35mm Film**) is a Python-based project designed to streamline the management and editing of metadata and images from analog photography. While it was created with analog photography in mind, it is versatile enough to handle any type of images.
**OPTIMA35** (**Organizing, Processing, Tweaking Images, and Modifying scanned Analogs from 35mm Film**) is a Python-based project designed to streamline the management and editing of metadata and images from analog photography. While it was created with analog photography in mind, it is versatile enough to handle any type of images.
This project replaces my earlier [analogphotography](https://gitlab.com/sf-bashscripts/analogphotography) bash script collection, which has now been archived in favor of OPTIMA-35.
@ -13,29 +15,30 @@ This project replaces my earlier [analogphotography](https://gitlab.com/sf-bashs
### Development and Versioning Notes
**OPTIMA-35** is currently in an **alpha stage** and under active development. As a result:
**OPTIMA35** is currently in an **alpha stage** and under active development. As a result:
- The README may occasionally be outdated.
- Users are encouraged to check for new branches and read the [**CHANGELOG**](https://gitlab.com/CodeByMrFinchum/optima-35/-/blob/main/CHANGELOG.md?ref_type=heads), which is consistently updated and well-documented.
- Users are encouraged to check for new branches and read the [**CHANGELOG**](https://gitlab.com/CodeByMrFinchum/optima35/-/blob/main/CHANGELOG.md?ref_type=heads), which is consistently updated and well-documented.
- Bugs or unforeseen behavior may occur.
While the project follows a semantic versioning structure (major.minor.patch), breaking changes—typically reserved for major version increments—may also occur in minor version updates during this development phase. Please review the changelog carefully before updating.
### Available Features:
**Implemented Features:**
- **Image Processing:**
**Image Processing:**
- Resizing
- Renaming with order adjustment
- Grayscale conversion
- Brightness adjustment
- Contrast adjustment
- **EXIF Management:**
**EXIF Management:**
- Copy EXIF data
- Add custom EXIF information
- Add GPS data
- Add a date to EXIF
- Remove EXIF
- **Watermarking**
**Watermarking**
## Dependencies
@ -43,15 +46,6 @@ While the project follows a semantic versioning structure (major.minor.patch), b
- **piexif**: For reading, modifying, and writing EXIF metadata.
- **pillow**: For image processing.
### Installing Dependencies
You can install the dependencies using the requirements.txt
Using `pip`:
```bash
pip install -r requirements.txt
```
# Use of LLMs
In the interest of transparency, I disclose that Generative AI (GAI) large language models (LLMs), including OpenAIs ChatGPT and Ollama models (e.g., OpenCoder and Qwen2.5-coder), have been used to assist in this project.

View file

29
pyproject.toml Normal file
View file

@ -0,0 +1,29 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "optima35"
dynamic = ["version"]
authors = [{ name = "Mr. Finchum" }]
description = "OPTIMA35 is a package to modify images with pillow and piexif."
readme = "README.md"
requires-python = ">=3.8"
dependencies = ["piexif", "pillow"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://gitlab.com/CodeByMrFinchum/optima35"
[project.scripts]
optima35 = "optima35.__main__:main"
[tool.hatch.build.targets.wheel]
packages = ["src/optima35"]
[tool.hatch.version]
path = "src/optima35/__init__.py"

1
src/optima35/__init__.py Normal file
View file

@ -0,0 +1 @@
__version__ = "0.6.3-a2"

8
src/optima35/__main__.py Normal file
View file

@ -0,0 +1,8 @@
from . import __version__
def main():
print(f"optima35 (v{__version__}) is a core library and not intended to be run directly.")
print("Please use OptimaLab35 for a UI, run pip install OptimaLab35 and start with OptimaLab35.")
if __name__ == "__main__":
main()

View file

@ -2,11 +2,12 @@ import re
import os
from datetime import datetime
from optima35.image_handler import ImageProcessor, ExifHandler
from optima35 import __version__
class OptimaManager:
def __init__(self):
self.name = "OPTIMA-35"
self.version = "0.6.0"
self.name = "OPTIMA35"
self.version = __version__
self.image_processor = ImageProcessor()
self.exif_handler = ExifHandler()