factoriocalc


Namefactoriocalc JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryA python module to help you plan your factory for Factorio.
upload_time2024-10-19 17:42:43
maintainerNone
docs_urlNone
authorKevin Atkinson
requires_python>=3.7
licenseNone
keywords factorio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. default-role:: literal

FactorioCalc Readme
===================

FactorioCalc is a Python module to help you symbolically plan your factory for
Factorio.

With FactorioCalc you can:

* Symbolically express your exact machine configuration and ask it what the
  resulting inputs and outputs is.

* Import a blueprint and determine what it produces.

* Specify the recipes you want to use and let FactorioCalc determine the exact
  number of machines needed.

* Specify what you want, and let FactorioCalc determine both the recipes and
  the number of machines required.

* Combine factories, which were created using any of the above methods, to
  create a larger factory.

FactorioCalc has supports for using custom recipe data and mods.  The
companion mod, `Recipe Exporter
<https://mods.factorio.com/mod/RecipeExporter>`_, provides the recipe data.

FactorioCalc contains a custom simplex solver so it can easily handle complex
cases that involve recipes with more than one output, such as oil and uranium
processing.

I, the author, find designing my factory symbolically more natural than
using a spreadsheet and tools like FactorioLab.

Read the docs at https://factoriocalc.readthedocs.io/en/stable/

Examples
--------

::

  >>> from factoriocalc import itm, rcp, mch, presets, config, produce

Create a simple factory that creates electronic circuits from copper and iron plates::

  >>> config.machinePrefs.set(presets.MP_LATE_GAME)
  >>> circuits = 2*rcp.electronic_circuit() + 3*rcp.copper_cable()
  >>> circuits.summary()
      2x electronic_circuit: AssemblingMachine3:
            electronic_circuit 5/s, iron_plate -5/s, copper_cable -15/s, electricity -0.775 MW
      3x copper_cable: AssemblingMachine3:
            copper_cable 15/s, copper_plate -7.5/s, electricity -1.1625 MW
  >>> circuits.flows().print()
  electronic_circuit 5/s
  copper_cable 0/s (15/s - 15/s)
  iron_plate -5/s
  copper_plate -7.5/s
  electricity -1.9375 MW


Use `produce` to create a factory that produces rocket fuel::

  >>> config.machinePrefs.set(presets.MP_MAX_PROD().withBeacons(presets.SPEED_BEACON,
          {mch.AssemblingMachine3:8, mch.ChemicalPlant:8, mch.OilRefinery:12}))
  >>> rocketFuel = produce([itm.rocket_fuel@6], using=[rcp.advanced_oil_processing]).factory
  >>> rocketFuel.summary()
  b-rocket-fuel:
      23.4x rocket_fuel: AssemblingMachine3  +340% speed +40% prod. +880% energy +40% pollution
      9.84x solid_fuel_from_light_oil: ChemicalPlant  +355% speed +30% prod. +800% energy +30% pollution
      4.65x solid_fuel_from_petroleum_gas: ChemicalPlant  +355% speed +30% prod. +800% energy +30% pollution
      2.26x advanced_oil_processing: OilRefinery  +555% speed +30% prod. +1080% energy +30% pollution
      1.06x heavy_oil_cracking: ChemicalPlant  +355% speed +30% prod. +800% energy +30% pollution
    Outputs: rocket_fuel 6/s
    Inputs: water -220.004/s, crude_oil -295.803/s



Installation
------------

FactorioCalc is available on PyPI so you can install it using pip::

  pip3 install factoriocalc

Status
------

FactorioCalc has been used by the author to help produce a factory that
produces around 2k science packs per minute, beat Space Exploration, beat
Krastorio 2, and create a Krastorio 2 factory that produces 3k science packs
per minute.  The calculations, in terms of the rate of items produced and
consumed, should be accurate (which includes tricky cases such as the Kovarex
enrichment process).  The solver, in nearly all cases, should produce optimal
results in terms of materials used.  The API is subject to change but the core
functionality *should be* stable.

Possible Bugs
.............

FactorioCalc uses a custom simplex solver written in pure python.  The solver
has no provisions to prevent cycling, so calls to `solve` could theoretical
loop and need to be killed with `control-c`; however, so far this has not
happened.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "factoriocalc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Factorio",
    "author": "Kevin Atkinson",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/a5/38/dd60b90b25cdef17b2ec715e1a4a99d840b553aab669372b16fcad9877cc/factoriocalc-0.2.1.tar.gz",
    "platform": null,
    "description": ".. default-role:: literal\n\nFactorioCalc Readme\n===================\n\nFactorioCalc is a Python module to help you symbolically plan your factory for\nFactorio.\n\nWith FactorioCalc you can:\n\n* Symbolically express your exact machine configuration and ask it what the\n  resulting inputs and outputs is.\n\n* Import a blueprint and determine what it produces.\n\n* Specify the recipes you want to use and let FactorioCalc determine the exact\n  number of machines needed.\n\n* Specify what you want, and let FactorioCalc determine both the recipes and\n  the number of machines required.\n\n* Combine factories, which were created using any of the above methods, to\n  create a larger factory.\n\nFactorioCalc has supports for using custom recipe data and mods.  The\ncompanion mod, `Recipe Exporter\n<https://mods.factorio.com/mod/RecipeExporter>`_, provides the recipe data.\n\nFactorioCalc contains a custom simplex solver so it can easily handle complex\ncases that involve recipes with more than one output, such as oil and uranium\nprocessing.\n\nI, the author, find designing my factory symbolically more natural than\nusing a spreadsheet and tools like FactorioLab.\n\nRead the docs at https://factoriocalc.readthedocs.io/en/stable/\n\nExamples\n--------\n\n::\n\n  >>> from factoriocalc import itm, rcp, mch, presets, config, produce\n\nCreate a simple factory that creates electronic circuits from copper and iron plates::\n\n  >>> config.machinePrefs.set(presets.MP_LATE_GAME)\n  >>> circuits = 2*rcp.electronic_circuit() + 3*rcp.copper_cable()\n  >>> circuits.summary()\n      2x electronic_circuit: AssemblingMachine3:\n            electronic_circuit 5/s, iron_plate -5/s, copper_cable -15/s, electricity -0.775 MW\n      3x copper_cable: AssemblingMachine3:\n            copper_cable 15/s, copper_plate -7.5/s, electricity -1.1625 MW\n  >>> circuits.flows().print()\n  electronic_circuit 5/s\n  copper_cable 0/s (15/s - 15/s)\n  iron_plate -5/s\n  copper_plate -7.5/s\n  electricity -1.9375 MW\n\n\nUse `produce` to create a factory that produces rocket fuel::\n\n  >>> config.machinePrefs.set(presets.MP_MAX_PROD().withBeacons(presets.SPEED_BEACON,\n          {mch.AssemblingMachine3:8, mch.ChemicalPlant:8, mch.OilRefinery:12}))\n  >>> rocketFuel = produce([itm.rocket_fuel@6], using=[rcp.advanced_oil_processing]).factory\n  >>> rocketFuel.summary()\n  b-rocket-fuel:\n      23.4x rocket_fuel: AssemblingMachine3  +340% speed +40% prod. +880% energy +40% pollution\n      9.84x solid_fuel_from_light_oil: ChemicalPlant  +355% speed +30% prod. +800% energy +30% pollution\n      4.65x solid_fuel_from_petroleum_gas: ChemicalPlant  +355% speed +30% prod. +800% energy +30% pollution\n      2.26x advanced_oil_processing: OilRefinery  +555% speed +30% prod. +1080% energy +30% pollution\n      1.06x heavy_oil_cracking: ChemicalPlant  +355% speed +30% prod. +800% energy +30% pollution\n    Outputs: rocket_fuel 6/s\n    Inputs: water -220.004/s, crude_oil -295.803/s\n\n\n\nInstallation\n------------\n\nFactorioCalc is available on PyPI so you can install it using pip::\n\n  pip3 install factoriocalc\n\nStatus\n------\n\nFactorioCalc has been used by the author to help produce a factory that\nproduces around 2k science packs per minute, beat Space Exploration, beat\nKrastorio 2, and create a Krastorio 2 factory that produces 3k science packs\nper minute.  The calculations, in terms of the rate of items produced and\nconsumed, should be accurate (which includes tricky cases such as the Kovarex\nenrichment process).  The solver, in nearly all cases, should produce optimal\nresults in terms of materials used.  The API is subject to change but the core\nfunctionality *should be* stable.\n\nPossible Bugs\n.............\n\nFactorioCalc uses a custom simplex solver written in pure python.  The solver\nhas no provisions to prevent cycling, so calls to `solve` could theoretical\nloop and need to be killed with `control-c`; however, so far this has not\nhappened.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A python module to help you plan your factory for Factorio.",
    "version": "0.2.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/FactorioCalc/FactorioCalc/issues",
        "Homepage": "https://github.com/FactorioCalc/FactorioCalc"
    },
    "split_keywords": [
        "factorio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "01e638af69cc4f07566cc46f797f0f42fb8516534438bc1160f7197b939fbc8c",
                "md5": "0ce418df9fd5ead96ab717abc1709eba",
                "sha256": "1fd549729a3e0bd7cd8a8f1a60b216ad1c425e8c235a3a7dfd53781245b4726d"
            },
            "downloads": -1,
            "filename": "factoriocalc-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ce418df9fd5ead96ab717abc1709eba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 120748,
            "upload_time": "2024-10-19T17:42:42",
            "upload_time_iso_8601": "2024-10-19T17:42:42.300115Z",
            "url": "https://files.pythonhosted.org/packages/01/e6/38af69cc4f07566cc46f797f0f42fb8516534438bc1160f7197b939fbc8c/factoriocalc-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a538dd60b90b25cdef17b2ec715e1a4a99d840b553aab669372b16fcad9877cc",
                "md5": "35e08daf9b3fd1604d403d492ad55ee6",
                "sha256": "cda0b94374ed40bc4da1ed3b1e89c983999d75a1018ddb33c81321471cd832de"
            },
            "downloads": -1,
            "filename": "factoriocalc-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "35e08daf9b3fd1604d403d492ad55ee6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 1428404,
            "upload_time": "2024-10-19T17:42:43",
            "upload_time_iso_8601": "2024-10-19T17:42:43.584724Z",
            "url": "https://files.pythonhosted.org/packages/a5/38/dd60b90b25cdef17b2ec715e1a4a99d840b553aab669372b16fcad9877cc/factoriocalc-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-19 17:42:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FactorioCalc",
    "github_project": "FactorioCalc",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "factoriocalc"
}
        
Elapsed time: 0.54150s