agp-py


Nameagp-py JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/Stiggu/agp-py
SummaryGene parser for Axie Infinity
upload_time2024-06-22 20:33:15
maintainerNone
docs_urlNone
authorStiggu
requires_pythonNone
licenseNone
keywords python axie infinity
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Axie Gene Parser for Python

### WIP - haven't ported all the stuff the other module has (Mostly because I only find the genes useful)

This is a port of the Javascript version of a plugin, you can find it here: [agp-npm](https://github.com/ShaneMaglangit/agp-npm)

It parses the Axie Infinity hexadecimal gene strings into a human-readable format.

## Install

You can use pip to install:

```python
pip install agp-py
```

## Usage

First you need to get an Axie Gene String (You can use [Axie Infinity GraphQL](https://axie-graphql.web.app/)), after that you can start:

We will be using `0x30000000032cb3300c2320c80c2308c20c63184c04c1304c0c6331420c8320c8` as our hex string.

```python
from agp_py import AxieGene

hex_string = '0x30000000032cb3300c2320c80c2308c20c63184c04c1304c0c6331420c8320c8'
hex_type = 256
gene = AxieGene(hex_string, hex_type)
print(gene.genes)
```

The `AxieGene` class requires 2 arguments, First one is the hex string, Second one is the hex type (Either 256 or 512)

Then you can access the genes by using the method `genes`, it will give you a dictionary with the gene data.

```python
{
    'cls': 'plant', 
    'region': 'global', 
    'tag': '', 
    'bodySkin': '', 
    'pattern': {'d': '000011', 'r1': '001011', 'r2': '001011'}, 
    'color': {'d': 'efd636', 'r1': 'efd636', 'r2': 'ffffff'}, 
    'eyes': {
        'd': {'class': 'plant', 'name': 'Papi', 'partId': 'eyes-papi', 'specialGenes': '', 'type': 'eyes'}, 
        'r1': {'class': 'plant', 'name': 'Cucumber Slice', 'partId': 'eyes-cucumber-slice', 'specialGenes': '', 'type': 'eyes'}, 
        'r2': {'class': 'plant', 'name': 'Cucumber Slice', 'partId': 'eyes-cucumber-slice', 'specialGenes': '', 'type': 'eyes'},
        'mystic': False
    }, 
    
    # Other parts ....
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Stiggu/agp-py",
    "name": "agp-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, axie infinity",
    "author": "Stiggu",
    "author_email": "stiggu@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bd/55/e4a626bd4bf9acdb3550d355ea51b049058fe953c6e11e5c50e99221a2d4/agp_py-0.1.3.tar.gz",
    "platform": null,
    "description": "# Axie Gene Parser for Python\r\n\r\n### WIP - haven't ported all the stuff the other module has (Mostly because I only find the genes useful)\r\n\r\nThis is a port of the Javascript version of a plugin, you can find it here: [agp-npm](https://github.com/ShaneMaglangit/agp-npm)\r\n\r\nIt parses the Axie Infinity hexadecimal gene strings into a human-readable format.\r\n\r\n## Install\r\n\r\nYou can use pip to install:\r\n\r\n```python\r\npip install agp-py\r\n```\r\n\r\n## Usage\r\n\r\nFirst you need to get an Axie Gene String (You can use [Axie Infinity GraphQL](https://axie-graphql.web.app/)), after that you can start:\r\n\r\nWe will be using `0x30000000032cb3300c2320c80c2308c20c63184c04c1304c0c6331420c8320c8` as our hex string.\r\n\r\n```python\r\nfrom agp_py import AxieGene\r\n\r\nhex_string = '0x30000000032cb3300c2320c80c2308c20c63184c04c1304c0c6331420c8320c8'\r\nhex_type = 256\r\ngene = AxieGene(hex_string, hex_type)\r\nprint(gene.genes)\r\n```\r\n\r\nThe `AxieGene` class requires 2 arguments, First one is the hex string, Second one is the hex type (Either 256 or 512)\r\n\r\nThen you can access the genes by using the method `genes`, it will give you a dictionary with the gene data.\r\n\r\n```python\r\n{\r\n    'cls': 'plant', \r\n    'region': 'global', \r\n    'tag': '', \r\n    'bodySkin': '', \r\n    'pattern': {'d': '000011', 'r1': '001011', 'r2': '001011'}, \r\n    'color': {'d': 'efd636', 'r1': 'efd636', 'r2': 'ffffff'}, \r\n    'eyes': {\r\n        'd': {'class': 'plant', 'name': 'Papi', 'partId': 'eyes-papi', 'specialGenes': '', 'type': 'eyes'}, \r\n        'r1': {'class': 'plant', 'name': 'Cucumber Slice', 'partId': 'eyes-cucumber-slice', 'specialGenes': '', 'type': 'eyes'}, \r\n        'r2': {'class': 'plant', 'name': 'Cucumber Slice', 'partId': 'eyes-cucumber-slice', 'specialGenes': '', 'type': 'eyes'},\r\n        'mystic': False\r\n    }, \r\n    \r\n    # Other parts ....\r\n}\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Gene parser for Axie Infinity",
    "version": "0.1.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/Stiggu/agp-py/issues",
        "Homepage": "https://github.com/Stiggu/agp-py"
    },
    "split_keywords": [
        "python",
        " axie infinity"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd55e4a626bd4bf9acdb3550d355ea51b049058fe953c6e11e5c50e99221a2d4",
                "md5": "86fcff60bb9797d61874036766bf8cb2",
                "sha256": "4bd3b1d21141cdae1ccaf701d3f594954ccd0625117bafdffee901f4d0d8fc97"
            },
            "downloads": -1,
            "filename": "agp_py-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "86fcff60bb9797d61874036766bf8cb2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13724,
            "upload_time": "2024-06-22T20:33:15",
            "upload_time_iso_8601": "2024-06-22T20:33:15.706183Z",
            "url": "https://files.pythonhosted.org/packages/bd/55/e4a626bd4bf9acdb3550d355ea51b049058fe953c6e11e5c50e99221a2d4/agp_py-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-22 20:33:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Stiggu",
    "github_project": "agp-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "agp-py"
}
        
Elapsed time: 0.54623s