azurpaint


Nameazurpaint JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryAzur Lane painting reconstructor/extractor.
upload_time2024-08-27 07:46:28
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Fernando Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python unity azurlane azur-lane extractor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # azurpaint

[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/azurpaint.svg)](https://pypi.python.org/pypi/azurpaint)
[![MIT](https://img.shields.io/github/license/Fernando2603/azurpaint)](https://github.com/Fernando2603/azurpaint/blob/main/LICENSE)


Azur Lane painting reconstructor/extractor.

## Install
**Python 3.9.0 or higher is required**
```cmd
pip install azurpaint
```

## Usage

Simple example to extract painting

- create new folder
- get and extract `/Android/obb/com.YoStarEN.AzurLane/*.obb` to new folder
- copy `AssetBundles` from `/Android/data/com.YoStarEN.AzurLane/files/AssetBundles`

> [!NOTE]
> only `painting`, `paintings` and `paintingface` folder are required from `AssetBundles`.


```Python
from pathlib import Path
from azurpaint import Azurpaint
from azurpaint.exception import PrefabNotFound

# extract painting with default expression/face
def extract(asset_bundle_path, prefab_path):
  try:
    azurpaint = Azurpaint(asset_bundle_path, prefab_path)

    # search dependencies automatically within AssetBundles (root)
    # this is still in experimental mode so far on testing the result is good
    # load_dependencies only searching in local file and it doesn't know
    # if there any missing dependency it doesn't know what file it is
    # so you should provide complete asset include extracted OBB before running this
    azurpaint.load_dependencies()

    # PIL.Image.Image
    return azurpaint.create()
  except PrefabNotFound:
    print(f"{prefab_path} is not an prefab.")


# extract painting with all face/expression into output_dir
def extract_all_face(asset_bundle_path, prefab_path, output_dir):
  try:
    azurpaint = Azurpaint(asset_bundle_path, prefab_path)
    azurpaint.load_dependencies()

    Path(output_dir).mkdir(parents=True, exist_ok=True)
    azurpaint.create().save(Path(output_dir, f"{azurpaint.prefab.name}-default.png"))

    for face in azurpaint.face_list:
      azurpaint.change_face(face)
      azurpaint.create().save(Path(output_dir, f"{azurpaint.prefab.name}-{face}.png"))

  except PrefabNotFound:
    print(f"{prefab_path} is not an prefab.")


if __name__ == '__main__':
  # azurpaint require asset that have .prefab
  # will raise PrefabNotFound if file is not an prefab
  extract('path_to/AssetBundles', 'painting/tashigan')
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "azurpaint",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "python, unity, azurlane, azur-lane, extractor",
    "author": null,
    "author_email": "Fernando <81207411+Fernando2603@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/d2/98/e5ec7d542fa61b0e4b06529007aa22af8736f949f8fcd8bd11f306c5d6cb/azurpaint-1.0.0.tar.gz",
    "platform": null,
    "description": "# azurpaint\r\n\r\n[![PyPI supported Python versions](https://img.shields.io/pypi/pyversions/azurpaint.svg)](https://pypi.python.org/pypi/azurpaint)\r\n[![MIT](https://img.shields.io/github/license/Fernando2603/azurpaint)](https://github.com/Fernando2603/azurpaint/blob/main/LICENSE)\r\n\r\n\r\nAzur Lane painting reconstructor/extractor.\r\n\r\n## Install\r\n**Python 3.9.0 or higher is required**\r\n```cmd\r\npip install azurpaint\r\n```\r\n\r\n## Usage\r\n\r\nSimple example to extract painting\r\n\r\n- create new folder\r\n- get and extract `/Android/obb/com.YoStarEN.AzurLane/*.obb` to new folder\r\n- copy `AssetBundles` from `/Android/data/com.YoStarEN.AzurLane/files/AssetBundles`\r\n\r\n> [!NOTE]\r\n> only `painting`, `paintings` and `paintingface` folder are required from `AssetBundles`.\r\n\r\n\r\n```Python\r\nfrom pathlib import Path\r\nfrom azurpaint import Azurpaint\r\nfrom azurpaint.exception import PrefabNotFound\r\n\r\n# extract painting with default expression/face\r\ndef extract(asset_bundle_path, prefab_path):\r\n  try:\r\n    azurpaint = Azurpaint(asset_bundle_path, prefab_path)\r\n\r\n    # search dependencies automatically within AssetBundles (root)\r\n    # this is still in experimental mode so far on testing the result is good\r\n    # load_dependencies only searching in local file and it doesn't know\r\n    # if there any missing dependency it doesn't know what file it is\r\n    # so you should provide complete asset include extracted OBB before running this\r\n    azurpaint.load_dependencies()\r\n\r\n    # PIL.Image.Image\r\n    return azurpaint.create()\r\n  except PrefabNotFound:\r\n    print(f\"{prefab_path} is not an prefab.\")\r\n\r\n\r\n# extract painting with all face/expression into output_dir\r\ndef extract_all_face(asset_bundle_path, prefab_path, output_dir):\r\n  try:\r\n    azurpaint = Azurpaint(asset_bundle_path, prefab_path)\r\n    azurpaint.load_dependencies()\r\n\r\n    Path(output_dir).mkdir(parents=True, exist_ok=True)\r\n    azurpaint.create().save(Path(output_dir, f\"{azurpaint.prefab.name}-default.png\"))\r\n\r\n    for face in azurpaint.face_list:\r\n      azurpaint.change_face(face)\r\n      azurpaint.create().save(Path(output_dir, f\"{azurpaint.prefab.name}-{face}.png\"))\r\n\r\n  except PrefabNotFound:\r\n    print(f\"{prefab_path} is not an prefab.\")\r\n\r\n\r\nif __name__ == '__main__':\r\n  # azurpaint require asset that have .prefab\r\n  # will raise PrefabNotFound if file is not an prefab\r\n  extract('path_to/AssetBundles', 'painting/tashigan')\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Fernando  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Azur Lane painting reconstructor/extractor.",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Fernando2603/azurpaint/issues",
        "Homepage": "https://github.com/Fernando2603/azurpaint"
    },
    "split_keywords": [
        "python",
        " unity",
        " azurlane",
        " azur-lane",
        " extractor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64ce58d90503e4422ecfb04edb6412926beca5914c6c2d9fc2c5e6bc2cba0b5f",
                "md5": "30a0508b24f4bfa9277185dfa7858b67",
                "sha256": "32d7bf5187762497ede24e152f41af95b4fbda3b213faa49ba8bc54a37e49fc3"
            },
            "downloads": -1,
            "filename": "azurpaint-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30a0508b24f4bfa9277185dfa7858b67",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 20018,
            "upload_time": "2024-08-27T07:46:27",
            "upload_time_iso_8601": "2024-08-27T07:46:27.137646Z",
            "url": "https://files.pythonhosted.org/packages/64/ce/58d90503e4422ecfb04edb6412926beca5914c6c2d9fc2c5e6bc2cba0b5f/azurpaint-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d298e5ec7d542fa61b0e4b06529007aa22af8736f949f8fcd8bd11f306c5d6cb",
                "md5": "312c8dd556e6a1395ff4077f55d61631",
                "sha256": "27bd5f5a692eb39648f83b0fa4b79945e0e0dd2d3819e8e44ab744b9065dfc4b"
            },
            "downloads": -1,
            "filename": "azurpaint-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "312c8dd556e6a1395ff4077f55d61631",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 17881,
            "upload_time": "2024-08-27T07:46:28",
            "upload_time_iso_8601": "2024-08-27T07:46:28.630544Z",
            "url": "https://files.pythonhosted.org/packages/d2/98/e5ec7d542fa61b0e4b06529007aa22af8736f949f8fcd8bd11f306c5d6cb/azurpaint-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-27 07:46:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Fernando2603",
    "github_project": "azurpaint",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "azurpaint"
}
        
Elapsed time: 4.07182s