Skip to main content

No project description provided

Project description

z3r-sramr

Installation

pip install z3r-sramr-py

Functions

parse_sram(sram, validate_sram=true)

Accepts a bytes object and optional boolean argument. If you want to skip the SRAM validation checks, you can pass False as the second argument. Returns a dict with three sub dicts: 'meta', 'stats', and 'equipment'. See keys.txt for a list of all keys.

Can raise a ParseException if one of the validation checks fail or another error occurs.

validate_sram(sram)

Accepts a bytes object. Returns True if the object is valid ALTTPR SRAM and False if one of the checks fail. The parse_sram() function calls this function by default.

Example

from z3rsramr import parse_sram

with open("example.srm", "rb") as f:
    sram = f.read()

sram_map = parse_sram(sram)

print(f'Current Rupees: {sram_map['equipment']['current rupees']}')
print(f'Collection Rate: {sram_map['stats']['collection rate']}')
print(f'Menu Time: {sram_map['stats']['menu time']}')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

z3r_sramr_py-0.2.1-cp38-none-win_amd64.whl (110.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

z3r_sramr_py-0.2.1-cp38-cp38-manylinux1_x86_64.whl (135.3 kB view hashes)

Uploaded CPython 3.8

z3r_sramr_py-0.2.1-cp38-cp38-macosx_10_7_x86_64.whl (119.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

z3r_sramr_py-0.2.1-cp37-none-win_amd64.whl (110.6 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

z3r_sramr_py-0.2.1-cp37-cp37m-manylinux1_x86_64.whl (135.3 kB view hashes)

Uploaded CPython 3.7m

z3r_sramr_py-0.2.1-cp37-cp37m-macosx_10_7_x86_64.whl (119.4 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

z3r_sramr_py-0.2.1-cp36-none-win_amd64.whl (110.7 kB view hashes)

Uploaded CPython 3.6 Windows x86-64

z3r_sramr_py-0.2.1-cp36-cp36m-manylinux1_x86_64.whl (135.4 kB view hashes)

Uploaded CPython 3.6m

z3r_sramr_py-0.2.1-cp36-cp36m-macosx_10_7_x86_64.whl (119.5 kB view hashes)

Uploaded CPython 3.6m macOS 10.7+ x86-64

z3r_sramr_py-0.2.1-cp35-none-win_amd64.whl (110.7 kB view hashes)

Uploaded CPython 3.5 Windows x86-64

z3r_sramr_py-0.2.1-cp35-cp35m-manylinux1_x86_64.whl (135.4 kB view hashes)

Uploaded CPython 3.5m

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page