{"id":25518299,"url":"https://github.com/nickjordan289/pyilz","last_synced_at":"2025-12-18T03:30:19.826Z","repository":{"id":171653325,"uuid":"648163533","full_name":"NickJordan289/pyilz","owner":"NickJordan289","description":"A Python Library for Illuvium Zero Land Management. Pull directly from server-side gamestate.","archived":false,"fork":false,"pushed_at":"2023-12-04T16:07:26.000Z","size":142,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T22:13:46.993Z","etag":null,"topics":["illuvium","illuvium-zero","library","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyilz/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NickJordan289.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-01T10:52:37.000Z","updated_at":"2023-06-03T16:09:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4669169-e250-47ff-8e94-c4104360b7f1","html_url":"https://github.com/NickJordan289/pyilz","commit_stats":null,"previous_names":["nickjordan289/pyilz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickJordan289%2Fpyilz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickJordan289%2Fpyilz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickJordan289%2Fpyilz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NickJordan289%2Fpyilz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NickJordan289","download_url":"https://codeload.github.com/NickJordan289/pyilz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239691095,"owners_count":19681229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["illuvium","illuvium-zero","library","python"],"created_at":"2025-02-19T16:25:06.698Z","updated_at":"2025-12-18T03:30:19.781Z","avatar_url":"https://github.com/NickJordan289.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pyilz - An Illuvium Zero Python library\n\n[![build-status-image]][build-status]\n[![pypi-version]][pypi]\n[![coverage-status-image]][codecov]\n\n# Overview\nThis package hopes to make automation and management of Illuvium Zero Land a little easier by allowing you to interact with the gamestate APIs.\n\nAs the current Alpha version has no server-side authority the methods implemented only perform reads as to not break your gamestate.\n\nThis library **CAN** be used while you have the game running as it uses your local machines **[device_id](/pyilz/get_device_id.py)**, without this your game client would log-out due to different devices running the same plot.\n\n*Currently only supports Windows as replicating the **[get_device_id](/pyilz/get_device_id.py)** implementation from the Unity game engine requires WMI.*\n\n# Installation\n\nInstall using `pip`...\n\n    pip install pyilz\n\n\n# Requirements\n\n* Python 3.7+\n* Your Cognito access_token or refresh_token [*See below*](#acquiring-a-cognito-access_token)\n\nTokens can either be passed into the [**get_game_state**](/pyilz/get_game_state.py) function or pulled from the environment variables if available.\n\n## Environment Variables\n```\nREFRESH_TOKEN=...\nACCESS_TOKEN=...\n```\n\n### Acquiring your Cognito tokens\n---\nAt the time of writing this there is no way of generating application scoped access tokens so the only way to authenticate against the gamestate APIs is by logging into https://play.illuvium.io/ and retrieving the tokens from local storage.\n\n**DO NOT** share your refresh_token or access_token, the refresh_token can generate new access_tokens for up to 30 days.\n\n### Example of tokens in Chromium Local Storage\n![access_tokens.png](/images/access_tokens.png)\n\n\n# Example\n```py\nfrom pyilz.get_token import get_token\nfrom pyilz.get_game_state import get_game_state\nfrom pyilz.parse_land import parse_land, get_buildings_and_activities\nfrom pyilz.get_timers import get_timers\nfrom pyilz.get_buildings import get_building_storage, get_active_output, get_passive_output\nfrom pyilz.get_plots import get_plot_metadata\n\n# Load ACCESS_TOKEN and REFRESH_TOKEN env vars\nimport dotenv\ndotenv.load_dotenv()\n\n# Get access token\ntoken = get_token()\n\n# Get list of plots\nplots = get_game_state(token)['data']\n\n# Get the second plot in game state\nplot = plots[2]['data']\nlandId = plots[2]['landId']\n\n# Look up metadata to get region and tier\nmetadata = get_plot_metadata(landId)\ntier = metadata['tier']\nregion = metadata['region']\n\n# Get Paths, Buildings, Current, Automatic and Completed Actions\nbuilding_data = parse_land(plot)\npaths, buildings, ca, aa, completed = get_buildings_and_activities(building_data)\n\n# Get timers from actions\ntimers = get_timers(ca, aa, completed)\n\n# Get total storage\nstorage = get_storage(building_data, tier)\n\n# Get the output from active and passive actions\nhydrogen_pump_5_active = get_active_output(\"Hydrogen Pump\", level=5, tier=tier, efficiency=150)\nsequestrian_plant_5_passive = get_passive_output(\"Sequestrian Plant\", level=5, tier=tier, efficiency=150)\n```\n\n# Package management\n### Build\n```ps\npy -m pip install --upgrade build\npy -m build\n```\n\n### Release\n```ps\npy -m pip install --upgrade twine\npy -m twine upload --repository pypi dist/*\n```\n\n[build-status-image]: https://github.com/nickjordan289/pyilz/actions/workflows/main.yml/badge.svg\n[build-status]: https://github.com/nickjordan289/pyilz/actions/workflows/main.yml\n[coverage-status-image]: https://img.shields.io/codecov/c/github/nickjordan289/pyilz/master.svg\n[codecov]: https://codecov.io/github/nickjordan289/pyilz?branch=main\n[pypi-version]: https://img.shields.io/pypi/v/pyilz.svg\n[pypi]: https://pypi.org/project/pyilz/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickjordan289%2Fpyilz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickjordan289%2Fpyilz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickjordan289%2Fpyilz/lists"}