>>> 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]



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:Here's just a few examples of the mods included with this release of PyDwarf: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 to guide you through your first time configuring and running PyDwarf, and here's another tutorial to help you get started creating your first mod. Also, here's a handy list of scripts with which PyDwarf comes packaged. And here's where all those scripts are actually located , in case you'd like to see what their innards look like.PyDwarf is cross-platform. Only Python 2.7 is required to run PyDwarf.