Skip to main content

Parse Minecraft-relative JSON to structured objects

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

minecraft-schemes

Parse Minecraft-relative JSON to structured objects.

Install

pip install minecraft-schemes

Usage

To run the following demo code, you need to:

from shutil import get_terminal_size

from rich.console import Console

import mcschemes

console = Console(markup=False)

# Version manifest
console.print('Version manifest'.center(get_terminal_size()[0], '='))
with open('version_manifest_v2.json') as f:
    version_manifest = mcschemes.load(f, mcschemes.Scheme.VERSION_MANIFEST)
    console.print('Latest release:', version_manifest.latest.release)
    console.print('Latest snapshot:', version_manifest.latest.snapshot)
    console.print('Prettified the first client manifest file info:', end=' ')
    console.print(version_manifest.versions[0])
console.print('=' * get_terminal_size()[0])

console.print()

# Client manifest
console.print('Client manifest of 1.21.10'.center(get_terminal_size()[0], '='))
with open('1.21.10.json') as f:
    client_manifest = mcschemes.load(f, mcschemes.Scheme.CLIENT_MANIFEST)
    console.print('Version ID:', client_manifest.id)
    console.print('Released at:', client_manifest.releaseTime.to_datetime_string())
    console.print('Updated at:', client_manifest.time.to_datetime_string())
    console.print('Main class name:', client_manifest.mainClass)
    console.print('Asset version ID:', client_manifest.assets)
    console.print('Prettified asset index file info:', end=' ')
    console.print(client_manifest.assetIndex)
    console.print('Prettified the first library dependency info:', end=' ')
    console.print(client_manifest.libraries[0])
console.print('=' * get_terminal_size()[0])

Outputs in the terminal (the size is 80x24):

================================Version manifest================================
Latest release: 1.21.10
Latest snapshot: 1.21.11-pre5
Prettified the first client manifest file info: VersionEntry(
    id='1.21.11-pre5',
    type=<VersionType.SNAPSHOT: 'snapshot'>,
    url='https://piston-meta.mojang.com/v1/packages/0c44a8417875d1b1d5d3056c3a35
ff9717342de0/1.21.11-pre5.json',
    time=DateTime(2025, 12, 3, 13, 26, 59, tzinfo=datetime.timezone.utc),
    releaseTime=DateTime(2025, 12, 3, 13, 14, 25, tzinfo=datetime.timezone.utc),
    sha1='0c44a8417875d1b1d5d3056c3a35ff9717342de0',
    complianceLevel=1
)
================================================================================

===========================Client manifest of 1.21.10===========================
Version ID: 1.21.10
Released at: 2025-10-07 09:17:23
Updated at: 2025-10-07 09:17:23
Main class name: net.minecraft.client.main.Main
Asset version ID: 27
Prettified asset index file info: AssetIndexFileInfo(
    id='27',
    sha1='4a667d8cb576e16de8197074c978531c01cd6544',
    size=507362,
    totalSize=435439577,
    url='https://piston-meta.mojang.com/v1/packages/4a667d8cb576e16de8197074c978
531c01cd6544/27.json'
)
Prettified the first library dependency info: LibraryDependencyInfo(
    name='ca.weblite:java-objc-bridge:1.1',
    artifact=None,
    classifiers={},
    natives={},
    extract=None,
    rules=[
        RuleEntry(
            action=<RuleAction.ALLOW: 'allow'>,
            features={},
            os=RuleOSEntry(name='osx', version=None, arch=None)
        )
    ]
)
================================================================================

History

Versions follow Semantic Versioning.

0.1.0 - 2025-12-4

The initial release.

Project details


Download files

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

Source Distribution

minecraft_schemes-0.1.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minecraft_schemes-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file minecraft_schemes-0.1.0.tar.gz.

File metadata

  • Download URL: minecraft_schemes-0.1.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for minecraft_schemes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf6987c131fe26447158962e3d9d8ef1d734ea4b1acd3c1e643ad31dffae918d
MD5 cb8ee56f439e866f38f388655afe573e
BLAKE2b-256 36de8a7aa03c08ed64dc672b03c59618fbdf1e75f4a790bb435528e6b11edcf7

See more details on using hashes here.

File details

Details for the file minecraft_schemes-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for minecraft_schemes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd675e7feacd56306f2b3d122a1fdf0a91765eb820dd89b0558417d9923ddba7
MD5 9e7577d6121a5889c541931d20f7de02
BLAKE2b-256 588e5e7d13c6b8e8e8782ed4d84e3ccb004623409c49b529c874890c7c7c064c

See more details on using hashes here.

Supported by

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