{ "info": { "author": "Mike Bayer", "author_email": "mike_mp@zzzcomputing.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "========\nnbt2yaml\n========\n\nnbt2yaml presents a command line interface for reading and editing Minecraft NBT files using a\ncustom YAML format. It also includes a Python API for parsing and writing NBT files to/from\na simple Python data structure.\n\nThe key tool is ``nbtedit``, a command line utility that will shell out the\nYAML version of the target NBT file to your editor of choice, allowing\nrelatively easy editing of NBT data. When the editing session is closed,\nthe saved file is parsed back into NBT, and if changes have occurred, the original\nfile is updated; a copy of the previous version is saved as well.\n\nNBT format: http://wiki.vg/NBT\n\nYAML: http://www.yaml.org/\n\nInstallation\n============\n\nFirst, **be sure to read** the disclaimer_ down below.\n\nInstall via ``pip`` is easiest::\n\n pip install nbt2yaml\n\nor alternatively ``easy_install``::\n\n easy_install nbt2yaml\n\nOnce installed, the ``nbtedit``, ``nbt2yaml``, and ``yaml2nbt`` commands\nshould be available, from the same place other Python utilities are installed.\n\nCommands\n========\n\nNote that an nbt file is typically in gzip format. nbt2yaml commands\nwill assume gzip format for all nbt files written and read, unless the ``--no-gzip``\nflag is specified.\n\nFor the ``nbt2yaml`` and ``yaml2nbt`` commands, the filename can be specified as ``-``,\nwhich indicates the data should be read from standard input.\n\nnbtedit\n--------\n\nEdits an nbt file in-place, allowing YAML format within the editor.\n\nThe script uses the standard ``EDITOR`` environment variable to determine which\ntext editor should be invoked.\n\nThe program detects if changes were made when the editing session is closed;\nif so, the existing nbt file is copied to a backup unconditionally, and the new\ndata is written to the file in place.\n\nSynopsis::\n\n usage: nbtedit [-h] [-n] filename\n\n Edit an nbt file in-place in Yaml format.\n\n positional arguments:\n filename filename\n\n optional arguments:\n -h, --help show this help message and exit\n -n, --no-gzip Don't use gzip\n\nnbt2yaml\n--------\n\nDumps an nbt file as YAML to standard output::\n\n usage: nbt2yaml [-h] [-n] filename\n\n Dump an nbt file or stream to yaml.\n\n positional arguments:\n filename Filename. Specify as '-' to read from stdin.\n\n optional arguments:\n -h, --help show this help message and exit\n -n, --no-gzip Don't use gzip\n\nyaml2nbt\n--------\n\nDumps a YAML file generated by nbt2yaml as nbt to standard output::\n\n usage: yaml2nbt [-h] [-n] filename\n\n Dump a yaml file or stream to nbt.\n\n positional arguments:\n filename Filename. Specify as '-' to read from stdin.\n\n optional arguments:\n -h, --help show this help message and exit\n -n, --no-gzip Don't use gzip\n\nExample Use\n===========\n\nSuppose we want to switch the \"GameMode\" from \"0\" (survival) to \"1\"\n(creative).\n\nFirst, ensure that Minecraft itself is **not running**. Then, navigate to\nwhere your Minecraft save files are. Here's how it looks on a mac::\n\n $ cd ~/Library/Application\\ Support/minecraft/saves/\n\nOnce there, edit the ``level.dat`` file for any selected world::\n\n nbtedit myworld/level.dat\n\nAssuming you have your EDITOR variable set, an editor like ``vim``, ``nano``, ``emacs``,\nor something else should pop up. Window based editors can be used\nif they present a command line command that doesn't exit until the file is saved\n(such as, I can use ``mate -w`` here to use TextMate).\n\nThen navigate down to the \"GameType\" value::\n\n - foodSaturationLevel: 0.0\n - FallDistance: 0.0\n - XpTotal: 0\n - Rotation:\n - -476.3782043457031\n - 28.349964141845703\n - Xp: 0\n - RandomSeed: !long \"1201953322384967445\"\n - GameType: 0\n - MapFeatures: !byte \"0\"\n - version: 19132\n - Time: !long \"5601373\"\n - raining: !byte \"0\"\n - thunderTime: 19527\n\nChange it from \"0\" (survival) to \"1\" (creative)::\n\n - RandomSeed: !long \"1201953322384967445\"\n - GameType: 1\n - MapFeatures: !byte \"0\"\n\nSave the file. ``nbtedit`` reports that it saved a copy of the old file and wrote\nthe changes to the existing file. Now you can build some castles !\n\nFormat\n======\n\nThe specifics of how NBT is mapped to YAML is of course a\ndecision this program has to make, as there are any\nnumber of ways to do it. The goal here is to have a YAML\nformat that is as minimal and readable as possible, while\nstill maintaining the ability to write the identical nbt\nfile as the one parsed; for this reason, many datatypes\nhave explicit directives (i.e. short, long, double, byte)\nwhich will result in the appropriate nbt tag (i.e.\nTAG_Short, TAG_Long, TAG_Double, TAG_Byte). The default\nfor ``int``, ``str`` and ``float`` Python types are\nTAG_Int, TAG_String, and TAG_Float, respectively.\n\nWhen editing a YAML file, it's important to keep the\nformatting **exactly** the same! nbt2yaml can only handle\nstructures that are in the form in which it generates;\nsee the example below to see all of these forms.\n\nWhile nbt2yaml can handle any kind of data provided the\nformat is correct, it's expected that the normal use of\nthis tool is just to change individual values without\nchanging the document structure.\n\nA current dump of the Minecraft reference file\n``bigtest.nbt`` in YAML format is below. Suggestions on\nimproving this format are welcome !\n\n::\n\n Level:\n - longTest: !long \"9223372036854775807\"\n - shortTest: !short \"32767\"\n - stringTest: !!python/str \"HELLO WORLD THIS IS A TEST STRING \\xC5\\xC4\\xD6!\"\n - floatTest: 0.4982314705848694\n - intTest: 2147483647\n - nested compound test:\n - ham:\n - name: Hampus\n - value: 0.75\n - egg:\n - name: Eggbert\n - value: 0.5\n - listTest (long):\n - !long \"11\"\n - !long \"12\"\n - !long \"13\"\n - !long \"14\"\n - !long \"15\"\n - listTest (compound):\n - - name: 'Compound tag #0'\n - created-on: !long \"1264099775885\"\n - - name: 'Compound tag #1'\n - created-on: !long \"1264099775885\"\n - byteTest: !byte \"127\"\n - byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...)): !byte_array \"00\\\n \\ 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E\\\n \\ 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54\\\n \\ 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42\\\n \\ 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08\\\n \\ 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A\\\n \\ 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48\\\n \\ 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E\\\n \\ 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C\\\n \\ 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12\\\n \\ 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14\\\n \\ 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52\\\n \\ 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04\\\n \\ 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56\\\n \\ 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C\\\n \\ 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E\\\n \\ 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C\\\n \\ 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E\\\n \\ 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60\\\n \\ 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26\\\n \\ 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28\\\n \\ 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02\\\n \\ 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18\\\n \\ 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06\\\n \\ 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30\\\n \\ 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32\\\n \\ 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C\\\n \\ 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22\\\n \\ 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10\\\n \\ 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A\\\n \\ 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C\\\n \\ 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16\\\n \\ 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C\\\n \\ 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A\\\n \\ 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44\\\n \\ 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46\\\n \\ 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20\\\n \\ 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36\\\n \\ 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24\\\n \\ 4E 1E 5C 40 2E 26 28 34 4A 06 30\"\n - doubleTest: !double \"0.4931287132182315\"\n\n.. _disclaimer:\n\nDisclaimer\n==========\n\nnbtedit is **brand new**. If it's September, 2011, you are one of the **first** people reading this\nREADME. If there is a bug in nbtedit, you're about to be the person who finds it! It's also\nvery possible that an incorrectly edited YAML file could save an NBT file that Minecraft no longer\nknows how to read.\n\n**Back EVERYTHING up before tinkering with your files !!** nbtedit saves a backup of each file it edits, but\n**don't rely solely on that!** Please note you are **using this editor at your own risk**. The code is\nunit tested, works great, but I'd hate to be the reason you screwed up your world so **make copies of all\nfiles being edited first**. Thanks!\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/zzzeek/nbt2yaml", "keywords": "minecraft", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "nbt2yaml", "package_url": "https://pypi.org/project/nbt2yaml/", "platform": "", "project_url": "https://pypi.org/project/nbt2yaml/", "project_urls": { "Homepage": "http://bitbucket.org/zzzeek/nbt2yaml" }, "release_url": "https://pypi.org/project/nbt2yaml/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Read and write Minecraft NBT files using Yaml.", "version": "0.3.1" }, "last_serial": 4223065, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "8b82aab79e63fc5128237a715afa9b06", "sha256": "34d4b1e5734c84b20f845bad01ede9ba670fabf6be6751fc4f16b74ef6ba8aaf" }, "downloads": -1, "filename": "nbt2yaml-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8b82aab79e63fc5128237a715afa9b06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11020, "upload_time": "2011-10-02T20:25:11", "url": "https://files.pythonhosted.org/packages/a7/ea/965c878bf219cc7391f7354a5ca8559c3049cfbee3a2ae07db59d004250c/nbt2yaml-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "96b0f44a0aea0594649cc398086c85eb", "sha256": "b513a9a720b8165948e3bfd58b14d1efc1bb55777796d42ab917a8cc3aeb768a" }, "downloads": -1, "filename": "nbt2yaml-0.2.1.tar.gz", "has_sig": false, "md5_digest": "96b0f44a0aea0594649cc398086c85eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11354, "upload_time": "2012-10-15T06:06:28", "url": "https://files.pythonhosted.org/packages/a2/e2/79e5a1ed44cda65c50ef32cbf5d0a8888de9617b60762643f973803875a9/nbt2yaml-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "8501bc7645bc8378b1574e22f8880032", "sha256": "f3dc3f78c13641865b2129a50093358743dbe69cdd55cd910c8d1dccc9441ab0" }, "downloads": -1, "filename": "nbt2yaml-0.2.2.tar.gz", "has_sig": false, "md5_digest": "8501bc7645bc8378b1574e22f8880032", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11677, "upload_time": "2012-10-26T19:13:34", "url": "https://files.pythonhosted.org/packages/df/15/24b746bd351c7959cf24b5da93264352dc60d9458ba5da31ee472955ae5e/nbt2yaml-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "8dd55e2c97d265aae4ae207e7573a0cc", "sha256": "ba8db0a5406aa6e0d022986dd953565be64452d836e9791e4291eb055c0d1133" }, "downloads": -1, "filename": "nbt2yaml-0.3.0.tar.gz", "has_sig": false, "md5_digest": "8dd55e2c97d265aae4ae207e7573a0cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12392, "upload_time": "2012-11-06T02:22:19", "url": "https://files.pythonhosted.org/packages/b8/1a/96164deb41754b6a89380e8a0818ed456a3b45886a296d1e3471f30e31df/nbt2yaml-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "0cf1e73407f31c573d1696d340f760ca", "sha256": "5cc560fdc34bd1d4676525d0c7675e627d714efc5051892a5b5937793a12e8cd" }, "downloads": -1, "filename": "nbt2yaml-0.3.1.tar.gz", "has_sig": false, "md5_digest": "0cf1e73407f31c573d1696d340f760ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13237, "upload_time": "2018-08-30T15:26:04", "url": "https://files.pythonhosted.org/packages/9a/e7/f3ea270163a7351f8a0f6573a680656bf2d882a3111b5ebae732b259741e/nbt2yaml-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0cf1e73407f31c573d1696d340f760ca", "sha256": "5cc560fdc34bd1d4676525d0c7675e627d714efc5051892a5b5937793a12e8cd" }, "downloads": -1, "filename": "nbt2yaml-0.3.1.tar.gz", "has_sig": false, "md5_digest": "0cf1e73407f31c573d1696d340f760ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13237, "upload_time": "2018-08-30T15:26:04", "url": "https://files.pythonhosted.org/packages/9a/e7/f3ea270163a7351f8a0f6573a680656bf2d882a3111b5ebae732b259741e/nbt2yaml-0.3.1.tar.gz" } ] }