pytwee
Features
Parse the .twee file with twee 3 spec
Convert the Story to twine 2 HTML spec
Run as a command
[TODO] Convert the Story to twine 2 JSON doc
Use
# Install by pip
$ python -m pip install pytwee
# Run in console
$ python -m pytwee tests/t001.tw
# Import as a module
import pytwee
story = pytwee.story.Story()
with open('my-story.tw', 'rt') as f:
parser = pytwee.twee3.Parser(story)
for line in iter(f.readline, ''):
parser(line)
del parser #<- very important
print('story:', story)
License
Table of Contents