(http://pineapplemachine.com/pydwarf/logo_transparent.png)
Download PyDwarf 1.1.4 (https://github.com/pineapplemachine/PyDwarf/releases/tag/v1.1.4)
View PyDwarf on GitHub (https://github.com/pineapplemachine/PyDwarf)
For players, PyDwarf is an easy way to manage your preferred mods. Never worry about incompatible or obsolete mods again! (Or, at least, not nearly as often.) And for modders, PyDwarf is your new best friend. PyDwarf's mod manager exposes a very handy API for interacting with the raws. Here's an example of how effortless it is to customize raws even from a python console:
>>> import raws
>>> df = raws.dir('raw/objects')
>>> elf = df.getobj('CREATURE:ELF')
>>> description = elf.get('DESCRIPTION')
>>> print description
[DESCRIPTION:A medium-sized creature dedicated to the ruthless protection of nature.]
>>> description.setarg('A medium-sized creature undeserving of life.')
>>> df.write('raw/objects')
client-170:PyDwarf pineapple$ grep 'CREATURE:ELF' raw/objects/creature_standard.txt -A 4
[CREATURE:ELF]
[DESCRIPTION:A medium-sized creature undeserving of life.]
[NAME:elf:elves:elven]
[CASTE_NAME:elf:elves:elven]
[CREATURE_TILE:'e'][COLOR:3:0:0]
Here's just a few examples of the mods included with this release of PyDwarf:
- Omniclasm's State of Decay (http://www.bay12forums.com/smf/index.php?topic=150782.0).
- DragonDePlatino's Gemset (http://www.bay12forums.com/smf/index.php?topic=150753.0).
- Umiman's Small Things (http://www.bay12forums.com/smf/index.php?topic=18552.0).
- Stalhansch's Armoury Packs (http://www.bay12forums.com/smf/index.php?topic=142993.0).
Normally you'd be bound to run into compatibility issues when trying to install so many of these mods at once, and you'd surely have to wait for authors to update their mods before reinstalling everything whenever Dwarf Fortress updates. Not so with PyDwarf. PyDwarf is highly capable of avoiding conflicts between mods, and it cares little about which version of Dwarf Fortress you're modifying. Not only does PyDwarf make it much easier for the player to install mods, it also makes it easier for the modder to craft something excellent. Instead of editing text files on your own, PyDwarf allows you to write scripts which edit them for you: What this means for you is an enormous reduction in tedium.
Here's a step-by-step tutorial (https://github.com/pineapplemachine/PyDwarf/blob/master/docs/introduction.md) to guide you through your first time configuring and running PyDwarf, and here's another tutorial (https://github.com/pineapplemachine/PyDwarf/blob/master/docs/modding.md) to help you get started creating your first mod. Also, here's a handy list of scripts (https://github.com/pineapplemachine/PyDwarf/blob/master/docs/scripts.md) with which PyDwarf comes packaged. And here's where all those scripts are actually located (https://github.com/pineapplemachine/PyDwarf/tree/master/scripts), in case you'd like to see what their innards look like.
PyDwarf is cross-platform. Only Python 2.7 (https://www.python.org/downloads/release/python-2713/) is required to run PyDwarf.
Looks pretty neat, naturally just as I'm getting comfortable screwing around in lua I'm looking at this trying to see how it works like:
(http://i3.kym-cdn.com/photos/images/facebook/000/234/767/8d0.jpg)
Finally put out a first release! https://github.com/pineapplemachine/PyDwarf/releases
A list of scripts included with the current release:
pineapple.adoptsowner
pineapple.bauxitetoaluminum
pineapple.boneflux
pineapple.butcherinorganic
pineapple.castanvil
pineapple.cavegrass
pineapple.deerappear
pineapple.diff
pineapple.discipline
pineapple.flybears
pineapple.greensteel
pineapple.maxage
pineapple.metalitems
pineapple.noaquifers
pineapple.noexotic
pineapple.nograzers
pineapple.nomaxage
pineapple.orientation
pineapple.skillrust
pineapple.stoneclarity
pineapple.subplants
pineapple.useablemats
pineapple.utils.addreaction
pineapple.utils.addtoentity
pineapple.utils.objecttokens
pineapple.woodmechanisms
putnam.materialsplus
putnam.microreduce
shukaro.creationforge
shukaro.higherlearning
smeeprocket.transgender
stal.armoury
umiman.smallthings.engraving
umiman.smallthings.prefstring
witty.restrictednobles
witty.restrictednobles.custom
Here's the second release, v1.0.1: Strange Mood (https://github.com/pineapplemachine/PyDwarf/releases/tag/v1.0.1). Mostly it adds a lot of documentation and fixes/improves stuff that was already there.
I'm still trying to gain traction for PyDwarf! I believe the best way to do this is to add more mods. If you have a mod you'd like to see rewritten for PyDwarf, please let me know and I'll work with you to get it done. PyDwarf is very good at this sort of thing! Mods that might previously have been limited to a small range of Dwarf Fortress versions, and might have been troublesome to merge with other mods, can now be written in such a way that compatibility becomes almost a non-issue.
Changelog:
Fixed pineapple.boneflux reaction by being less bad at string formatting
Fixed pineapple.utils.addreaction not adding an OBJECT:REACTION token to created files
Fixed new grasses in pineapple.cavegrass not being recognized by DF
Fixed a small issue with logging in pineapple.cavegrass
Fixed non-raws files from input directory not being written to output
Fixed pydwarf.response casting to string always returning a string starting with "SUCCESS" even when unsuccessful
Added a lot more documentation
Added a shitty WIP tool for outputting docstrings as more readable html
Added a list method to queryable raws objects which acts as a shortcut for raw.tokenlist(something.tokens())
Added a file attribute to raws.token objects for tracking which file they belong to, if any
Added a bunch of helpful operator overloads
Added length and clear methods to raws.file
Added some convenience things to the raws package: raws.parse and raws.parseone refer to the raws.token static methods, raws.filter refers to raws.tokenfilter
Added index and slice functionality to raws.token and raws.file, most easily accessible via conventional notations like token[1] or token[-8:0:2]
Added step argument to tokens method for raws.token and raws.file
Improved error handling for bad config settings
Improved raws.tokenlist casting to string
Improved objdict method to return a dictionary of raws.tokenlist objects where previously they were regular lists
Improved handling of assignment of illegal strings to token text, now automatically resolves some common pitfalls
Improved argument handling for raws.boolfilter static methods all, any, one, and none
Tweaked grass colors in pineapple.cavegrass
Tweaked names, craftable items, and material values in pineapple.greensteel