VisioNomicon


NameVisioNomicon JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/rehanzo/visionomicon
SummaryA utility leveraging GPT-4V for image file renaming based on content.
upload_time2024-01-05 23:56:15
maintainer
docs_urlNone
authorRehan Rana
requires_python>=3.6
license
keywords gpt-4 gpt-4v openai renaming images
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # VisioNomicon

VisioNomicon is a powerful Python-based command-line utility tool designed to rename image files using the capabilities of GPT-4. The application generates descriptive filenames based on a user given template.

## Features

- Rename image files based on generated filenames from GPT-4V
- Flexible name generation based on user given structure
- Ability to create a mapping file for renamed images
- Execute renaming based on a generated mapping file
- Undo renaming to revert to original filenames
- Verification step for generated names using GPT-4
- Support for multiple retry attempts in case of validation or errors
- Supported file types: `.png`, `.jpeg`, `.jpg`, `.webp`, `.gif` (non-animated)

## Prerequisites

- Python 3.6+
- Access to OpenAI API with GPT-4V capabilities (API key required)

## Installation

You can install the package using pip via the following command:

```bash
pip install VisioNomicon
```

Alternatively, you can manually install the package by downloading the source distribution and running the following commands:

1. Download the latest source distribution (`VisioNomicon-0.1.1.tar.gz`) from the [Releases](https://github.com/rehanzo/VisioNomicon/releases) page.
2. Extract the file and navigate to the extracted directory.
3. Run the following command to install:

```bash
pip install .
```

## Usage

To use VisioNomicon, you need to set the `OPENAI_API_KEY` environment variable to your OpenAI API key. This can generally be done with a command like the following:
```bash
export OPENAI_API_KEY='your_api_key_here'
```

Run the script with the desired flags and arguments:

```bash
VisioNomicon [OPTIONS]
```

Or in one single command:

```bash
OPENAI_API_KEY='your_api_key_here' VisioNomicon [OPTIONS] 
```

### Options

- `-f`, `--files`: Specify file paths of the images to create mapping for
- `-o`, `--output`: Specify a JSON mapping file to be created with original and new file paths. Defaults to `$XDG_DATA_HOME/visionomicon/mapping-%Y-%m-%d-%H-%M-%S.json`
- `-x`, `--execute`: Execute renaming based on existing mapping file. Calling this without a value uses the most recently created mapping in `$XDG_DATA_HOME/visionomicon`
- `-ox`, `--mapex`: Map and execute renaming in one step
- `-u`, `--undo`: Revert renaming to original filenames using a mapping file. Calling this without a value uses the most recently created mapping in `$XDG_DATA_HOME/visionomicon`
  - It is important to note, if the file names or locations change after executing a mapping, you will not be able to undo
- `-t`, `--template`: Define the template for renaming image files, without file extension. It is recommended to use square brackets to define elements of the filename. Defaults to `[SubjectDescription]\_[MainColor/ColorScheme]\_[StyleOrFeel]\_[CompositionElement]`
- `-e`, `--validation-retries`: Specify the number of retries for name validation (defaults to 3)
- `-v`, `--error-retries`: Specify the number of retries in case of OpenAI errors (defaults to 3)
- `-E`, `--ignore-validation-fail`: If validation retries limit is reached, map file to original name instead of returning an error
- `-V`, `--ignore-error-fail`: If error retries limit is reached, map file to original name instead of returning an error

### Example Commands

```bash
VisioNomicon -f image1.jpg image2.png -ox
```

This is the most straightforward usage. A mapping file is created for the images, placed at the default location (`$XDG_DATA_HOME/visionomicon/mapping-%Y-%m-%d-%H-%M-%S.json`). Immediately afterwards, this file is executed, renaming the files.

```bash
VisioNomicon -f image1.jpg image2.png -o mapping.json -s "[Object]_[Color]_[Style]"
```

This command will create a rename mapping file for `image1.jpg` and `image2.png` based on the provided template and output the mapping to `mapping.json`.

Subsequently, you can execute the mapping, renaming the files.

```bash
VisioNomicon -x mapping.json
```

This can also be done in one single command if you'd like, using `-ox`:

```bash
VisioNomicon -f image1.jpg image2.png -ox mapping.json -s "[Object]_[Color]_[Style]"
```

## Limitations

- GPT-4V is limited in the file types it can handle(.png, .jpeg, .jpg, .webp, non-animated .gif), and the size (up to 20MB)
- With some templates it can be quite finicky, not really generating the filenames you might expect
  - part of this could be due to the fact that GPT-4V is fairly new and will get better with time

## Contributing

Contributions are welcome. Please open an issue first to discuss what you would like to change or add.

## License

This project is open-sourced under the [GLP-3.0 License](LICENSE).

## Disclaimer

This tool is not affiliated with OpenAI. The functionality is subject to change based on updates to the API or the terms of service provided by OpenAI.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rehanzo/visionomicon",
    "name": "VisioNomicon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "gpt-4 gpt-4v openai renaming images",
    "author": "Rehan Rana",
    "author_email": "visionomicon@rehanzo.com",
    "download_url": "https://files.pythonhosted.org/packages/f2/a7/b0da97571b8dcae065fa6bf10a3430464fe42176a75497028fcbb274ab7b/VisioNomicon-0.1.2.tar.gz",
    "platform": null,
    "description": "# VisioNomicon\n\nVisioNomicon is a powerful Python-based command-line utility tool designed to rename image files using the capabilities of GPT-4. The application generates descriptive filenames based on a user given template.\n\n## Features\n\n- Rename image files based on generated filenames from GPT-4V\n- Flexible name generation based on user given structure\n- Ability to create a mapping file for renamed images\n- Execute renaming based on a generated mapping file\n- Undo renaming to revert to original filenames\n- Verification step for generated names using GPT-4\n- Support for multiple retry attempts in case of validation or errors\n- Supported file types: `.png`, `.jpeg`, `.jpg`, `.webp`, `.gif` (non-animated)\n\n## Prerequisites\n\n- Python 3.6+\n- Access to OpenAI API with GPT-4V capabilities (API key required)\n\n## Installation\n\nYou can install the package using pip via the following command:\n\n```bash\npip install VisioNomicon\n```\n\nAlternatively, you can manually install the package by downloading the source distribution and running the following commands:\n\n1. Download the latest source distribution (`VisioNomicon-0.1.1.tar.gz`) from the [Releases](https://github.com/rehanzo/VisioNomicon/releases) page.\n2. Extract the file and navigate to the extracted directory.\n3. Run the following command to install:\n\n```bash\npip install .\n```\n\n## Usage\n\nTo use VisioNomicon, you need to set the `OPENAI_API_KEY` environment variable to your OpenAI API key. This can generally be done with a command like the following:\n```bash\nexport OPENAI_API_KEY='your_api_key_here'\n```\n\nRun the script with the desired flags and arguments:\n\n```bash\nVisioNomicon [OPTIONS]\n```\n\nOr in one single command:\n\n```bash\nOPENAI_API_KEY='your_api_key_here' VisioNomicon [OPTIONS] \n```\n\n### Options\n\n- `-f`, `--files`: Specify file paths of the images to create mapping for\n- `-o`, `--output`: Specify a JSON mapping file to be created with original and new file paths. Defaults to `$XDG_DATA_HOME/visionomicon/mapping-%Y-%m-%d-%H-%M-%S.json`\n- `-x`, `--execute`: Execute renaming based on existing mapping file. Calling this without a value uses the most recently created mapping in `$XDG_DATA_HOME/visionomicon`\n- `-ox`, `--mapex`: Map and execute renaming in one step\n- `-u`, `--undo`: Revert renaming to original filenames using a mapping file. Calling this without a value uses the most recently created mapping in `$XDG_DATA_HOME/visionomicon`\n  - It is important to note, if the file names or locations change after executing a mapping, you will not be able to undo\n- `-t`, `--template`: Define the template for renaming image files, without file extension. It is recommended to use square brackets to define elements of the filename. Defaults to `[SubjectDescription]\\_[MainColor/ColorScheme]\\_[StyleOrFeel]\\_[CompositionElement]`\n- `-e`, `--validation-retries`: Specify the number of retries for name validation (defaults to 3)\n- `-v`, `--error-retries`: Specify the number of retries in case of OpenAI errors (defaults to 3)\n- `-E`, `--ignore-validation-fail`: If validation retries limit is reached, map file to original name instead of returning an error\n- `-V`, `--ignore-error-fail`: If error retries limit is reached, map file to original name instead of returning an error\n\n### Example Commands\n\n```bash\nVisioNomicon -f image1.jpg image2.png -ox\n```\n\nThis is the most straightforward usage. A mapping file is created for the images, placed at the default location (`$XDG_DATA_HOME/visionomicon/mapping-%Y-%m-%d-%H-%M-%S.json`). Immediately afterwards, this file is executed, renaming the files.\n\n```bash\nVisioNomicon -f image1.jpg image2.png -o mapping.json -s \"[Object]_[Color]_[Style]\"\n```\n\nThis command will create a rename mapping file for `image1.jpg` and `image2.png` based on the provided template and output the mapping to `mapping.json`.\n\nSubsequently, you can execute the mapping, renaming the files.\n\n```bash\nVisioNomicon -x mapping.json\n```\n\nThis can also be done in one single command if you'd like, using `-ox`:\n\n```bash\nVisioNomicon -f image1.jpg image2.png -ox mapping.json -s \"[Object]_[Color]_[Style]\"\n```\n\n## Limitations\n\n- GPT-4V is limited in the file types it can handle(.png, .jpeg, .jpg, .webp, non-animated .gif), and the size (up to 20MB)\n- With some templates it can be quite finicky, not really generating the filenames you might expect\n  - part of this could be due to the fact that GPT-4V is fairly new and will get better with time\n\n## Contributing\n\nContributions are welcome. Please open an issue first to discuss what you would like to change or add.\n\n## License\n\nThis project is open-sourced under the [GLP-3.0 License](LICENSE).\n\n## Disclaimer\n\nThis tool is not affiliated with OpenAI. The functionality is subject to change based on updates to the API or the terms of service provided by OpenAI.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A utility leveraging GPT-4V for image file renaming based on content.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/rehanzo/visionomicon"
    },
    "split_keywords": [
        "gpt-4",
        "gpt-4v",
        "openai",
        "renaming",
        "images"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca141cbe5a5f79d4b3b00fb86ed61d8b943a6f32540904fba8f9420cd7b084ed",
                "md5": "73f2455e22b877dd661f4256ff3da645",
                "sha256": "e348d22d50b86f41e7b43689b0d281675be8abb5236e3893581e70f8cfb2aef7"
            },
            "downloads": -1,
            "filename": "VisioNomicon-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "73f2455e22b877dd661f4256ff3da645",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 21293,
            "upload_time": "2024-01-05T23:56:04",
            "upload_time_iso_8601": "2024-01-05T23:56:04.028229Z",
            "url": "https://files.pythonhosted.org/packages/ca/14/1cbe5a5f79d4b3b00fb86ed61d8b943a6f32540904fba8f9420cd7b084ed/VisioNomicon-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2a7b0da97571b8dcae065fa6bf10a3430464fe42176a75497028fcbb274ab7b",
                "md5": "ed559ac12f3dc93978f915622aa4e944",
                "sha256": "dd1a95b0661c0e8dff79278afe39b1205eb1b929431cf030f0269d21f908ec1f"
            },
            "downloads": -1,
            "filename": "VisioNomicon-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ed559ac12f3dc93978f915622aa4e944",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 20603,
            "upload_time": "2024-01-05T23:56:15",
            "upload_time_iso_8601": "2024-01-05T23:56:15.288928Z",
            "url": "https://files.pythonhosted.org/packages/f2/a7/b0da97571b8dcae065fa6bf10a3430464fe42176a75497028fcbb274ab7b/VisioNomicon-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-05 23:56:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rehanzo",
    "github_project": "visionomicon",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "visionomicon"
}
        
Elapsed time: 0.15988s