Skip to main content

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

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

Install

You can use pip to install:

pip install agp-py

Usage

First you need to get an Axie Gene String (You can use Axie Infinity GraphQL), after that you can start:

We will be using 0x30000000032cb3300c2320c80c2308c20c63184c04c1304c0c6331420c8320c8 as our hex string.

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.

{
    '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 ....
}

Metadata

Release files for agp-py 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agp-py 0.1.3
File Size Uploaded Provenance
agp_py-0.1.3.tar.gz 13.7 kB Without provenance Details

Release files / agp_py-0.1.3.tar.gz

Download URL agp_py-0.1.3.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4bd3b1d21141cdae1ccaf701d3f594954ccd0625117bafdffee901f4d0d8fc97
BLAKE2b-256 checksum
How to use checksums
bd55e4a626bd4bf9acdb3550d355ea51b049058fe953c6e11e5c50e99221a2d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.6

Security for agp-py 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page