Skip to main content

Blueprint editing tools for Dyson Sphere Program

Project description

Dyson Sphere Program blueprint tool, python bindings.

Features

  • Load and save blueprint files.
  • Replace blueprint items and recipes (partial).
  • Upgrade buildings.
  • Print blueprint info.

Example usage

import dspbp
from dspbp import DSPItem

data = open("my_blueprint.txt", "rb").read()
bp = dspbp.load(data)

replacement = {
    DSPItem.IronOre: DSPItem.CopperOre,
    DSPItem.IronIngot: DSPItem.CopperIngot,
}
bp.replace_item(replacement)

open("edited_blueprint.txt", "wb").write(dspbp.save(bp))

Brief reference

PyBlueprint

Blueprint class.

DSPItem

DSP item enum. Use dir(DSPItem) to get a list of all item types.

DSPRecipe

DSP recipe enum. Use dir(DSPRecipe) to get a list of all recipes.

dspbp.load(data: bytes) -> PyBlueprint

Load a blueprint from a bytes object.

dspbp.save(bp: PyBlueprint) -> bytes

Turn a blueprint into a bytes object.

PyBlueprint.icon_text: str

Icon text property. Use it to set blueprint text under the icons.

PyBlueprint.get_description(self) -> str

Get blueprint description.

PyBlueprint.replace_item(self, r: dict[DSPItem, DSPItem])

Replace items in the blueprint. Any item with a key in r gets replaced with a corresponding value.

Supports belt labels, logistic station slots and item icons.

TODO: inserter filters, splitter filters, traffic monitors.

PyBlueprint.replace_item(self, r: dict[DSPRecipe, DSPRecipe])

Replace recipes in the blueprint. Any recipe with a key in r gets replaced with a corresponding value.

PyBlueprint.replace_both(self, r: dict[DSPItem, DSPItem])

Replace both items and recipes. Items get converted into a most basic recipe.

PyBlueprint.replace_building(self, r: dict[DSPItem, DSPItem])

Upgrade and downgrade buildings.

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

dspbp-0.1.1.tar.gz (20.7 kB view hashes)

Uploaded Source

Built Distributions

dspbp-0.1.1-pp39-pypy39_pp73-win_amd64.whl (281.4 kB view hashes)

Uploaded PyPy Windows x86-64

dspbp-0.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dspbp-0.1.1-pp38-pypy38_pp73-win_amd64.whl (281.2 kB view hashes)

Uploaded PyPy Windows x86-64

dspbp-0.1.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dspbp-0.1.1-pp37-pypy37_pp73-win_amd64.whl (283.1 kB view hashes)

Uploaded PyPy Windows x86-64

dspbp-0.1.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dspbp-0.1.1-cp310-cp310-win_amd64.whl (281.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

dspbp-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dspbp-0.1.1-cp39-cp39-win_amd64.whl (281.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

dspbp-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dspbp-0.1.1-cp38-cp38-win_amd64.whl (281.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

dspbp-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dspbp-0.1.1-cp37-cp37m-win_amd64.whl (281.2 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

dspbp-0.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

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