Skip to content

Pytorio is a Python module designed to generate blueprints for the game Factorio, utilizing a programmable factory planner and calculator. Also, contains tools for importing, exporting, and creating factorio blueprints with python.

License

Notifications You must be signed in to change notification settings

michaelroust/pytorio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorio

Generate blueprints for your factories with a single command.

Alt text

Run

# python src/main.py <rate_per_second> <item>
python src/main.py 1 production-science-pack
Blueprint String
0eNrd3d1u2koUhuF78XEczZofzzi3slVVhDittcGwDUStqtz7NuTPTYbxN2uRgzgHbULBBvNk5Ky80D/F7erQbPu22xc3f4qm27f7ttkVN/88f/H7e3dY3zZ9cUNXRbdYN8VNsdjtmvXtqu1+lOvF8mfbNaUprortZjfceNMdN/SruFFXxe/hz8er4q7tm+XTvwwXDp+32+Nmtv3m7nC6vNwt26ZbNuV2sfy3eLz6sG/9uu+22zX9frjsw/5KOu2w1O/2GNmced3cavOj3e3bZbn82ez2Zd/8dxj+Tm3ePB4fwulq3+/b1XDdp6P1vMF+0a6GG7fdXfPrdMyWm8Px2AZzbcYf9ni3nm/TrIY72w934v7Qd4tl83Z7/Xp7fe29G93m5eA9DI+rXA+fr0Y3M+9u9i1yDCxwSONH1Ea25s4d0e2ApX0Yntl+89DeJXZyPK63i6OzyOar182vm7v2sC5fD9l2c3rgUXvDHY9sy2c6Nhd0HICDrmHGNYOxnpdiUsARtTBjIr5jCzgmnYmvuiA+MsCxcrA+sgx+bmb8HHBIPc6v4vPzCD+fuY5WiXWUQqbl+pKWa+DAB9iyVgzLYV6WNSFnBArGrLXgnEABmrXJBEj6kqek0AkUfk6qHYMgzeykVFfIQTW4QS8waBCDIXNFJZ1YUnWdK9pdULRBzqXI4j9lEUe0nZdog/zoShUs2hiB6AoQbWyuwTBl8PRkxXb1tuTt9gPKMnGEPM6u4rDzELvdftM1MXek3bUauRn20qzK7WqxjzJ7f/W2P35/Dv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o/EtdiK7pjK4Kfq2LyjAmT1ynkDEjV5kL/IVBGeeSlaB0/UQZo+B+6sEaXEYlT08nZFTM+PTM+lMx81MRtFF9P3XsbQY0QYP6mdDwlx5XGdDkUegUtLfVIPKGAGeGjgkV41faRN9yJ6MHhTx4QRFKmvlyYeeunQujN1aIo/AZgSbkwcsTzQkPnhlpnll4RgH6NK+X6Z+EV0afifESFJqfzisjmMR4yZPJCV6BGU2e4TXKwad5PWeziq8rZOSShMyVgyCYJP+5ugLeLxIy5Q3igpHSU97AaxgpPuUdpdnTtIycFl4vYrL4/eJnw6rxmhCCVYtzwglYo0p6mkIlplDjGSFEoeZ3hJ9OAa/6MArirG+KAq/rO7PGjJLlaVi1HBbe8yGwtOIHfZ8MS6uMvA6RpZW8r0vT0ooZ2Gng7e7G79cW3XdGY4fREER2UzZS8+h3U/DxG0LozDeUiGwgTi2joMOoyRO6KWrMhi6+jGnFjOguIZcyOjpILglCui8mlzIqOUguyTO5CbnE7OQuQi0jlcOoCVq5r0YtI4TDqMlLuClqzBTuzCKpmS3cJeTqjBwOkqsFPdwXk6szYjdIrpbXbhNyNTN3O8r9dlXs29Xpv7wZPm2Xm+7pyXl7Anbtj26xOt7y5Vz9dEHZdvebYdP73yeaD22/PwxXO22x3Tfr4bK3/1vnqlgtbpvV8Q4u2m748mFAcLo/3ijyNXlr7ePj/4v4CK8=

Alt text


# -b Generate blueprint with beacons
python src/main.py -b 10 production_science_pack
Blueprint String
0eNrlndtu28gSRf9FzxbAvnfnVw4GA1mmE+LIko4ungkG+fdD+jJmEpK9a7dNWPZTMh5pS6JWV9Gs1cw/i+vNud4fmu1p8eWfRb09NaemPi6+/OfpP77/uT3fXdeHxRd1tdiu7urFl8V1vVrvtourxX53bB/e/rV96t+LL0t7tfje/uF+XC2aU3137H5+3Nf1zfJud3Pe1Euz+KJ//Lj6LVvnsxWbbbLZmo222WjHRrtsdGSjfTZa0Qc75LNpSGI+O7DZKQ9JxWarKh9u6PD8stSeDs+vS53o8P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DG8HUzcVimT3HZeJk9pHyK99HMffgTbK/QjB54/ZXXObozRtcZocwL9mzYaHRm3eczD4jl14qs2NcBl5mvzguIy6zY1ymYpk9w2WoOJm9K79/XC1OzabuvpL2r816t338dl6+h2PzdbvadM98/hIeftCidbtro0/fHzi+bw6nc/uwh8QO3u52dptzvT80224r72Z1XW+6N7hqtu1/3rcUPLyfYCoVkgrtL24/fvwfZDR1Tg==

Alt text


Features

Generated blueprints:

  • Use logistics robots (no belts or trains).
  • Fluid transport using barrels.
  • Works for recipies that require Assemblers and (Electric) Furnances. Covers most recipies.
    • Other machines (stone furnaces, refinery, etc.) not supported yet.

Setup

python3 -m venv env
source env/bin/activate
pip install -r requirements.txt

Tests

    export PYTHONPATH="./src:$PYTHONPATH"
    python3 -m unittest discover -v -s ./test -p *test*.py

Export requirements

    `pip freeze > requirements.txt`

Further ideas

  • Add compatibility with machines that aren't 3x3 size. Add more machines. Chemical plants, refineries and space age content.
  • Optimize placement of machines to minimize logistics robot travel time.

About

Pytorio is a Python module designed to generate blueprints for the game Factorio, utilizing a programmable factory planner and calculator. Also, contains tools for importing, exporting, and creating factorio blueprints with python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published