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.

Disclaimer: Although the project name contains "minecraft", this project is not supported by Mojang Studios or Microsoft.

Install

pip install minecraft-schemes

Usage

To run the following demo code, you need to:

#!/usr/bin/env python3
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.post1 - 2025-12-5

Changes

Project metadata

  • Added project urls into pyproject.toml.
  • Added disclaimer in README.md

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.post1.tar.gz (15.2 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.post1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minecraft_schemes-0.1.0.post1.tar.gz
  • Upload date:
  • Size: 15.2 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.post1.tar.gz
Algorithm Hash digest
SHA256 7106d1aaf16ef9e7a476ba94ac538cb6a17ee858e79e25b4bf5661c0b7757dcb
MD5 c892bc6f16cabcdbb1e4f3a467b76cd7
BLAKE2b-256 5d6395950d14f3e8dfd8c14f74663a995c1d6810be2da0e65cb59e155e8ebdc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minecraft_schemes-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 88e1f2af0b647499b5e542d29e73cef7a6c037cc84aec4011248b92582e351c3
MD5 a9f2e703dd433a0fe947d76dc4c1e6e6
BLAKE2b-256 f8e03a607f4973455f13d0958d5f4559face07f6253ae105ad2fbcda8ab7e5b6

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