A Python library to read and write SWF files
Python
Switch branches/tags
Latest commit 0b04b2e Feb 28, 2016 @timknip Merge pull request #40 from CounterPillow/py3
Add python3 support
Permalink
Failed to load latest commit information.
bin Add python3 support Feb 20, 2016
docs initial commit May 29, 2011
swf Various small fixes Feb 20, 2016
test Add python3 support Feb 20, 2016
.gitignore added gitignore Oct 14, 2011
.travis.yml adding tests Jul 29, 2015
LICENSE added LICENSE May 29, 2011
MANIFEST.in updating readme Jul 24, 2015
README.md enabling travis Jul 29, 2015
TODO updated TODO May 29, 2011
setup.cfg updating readme Jul 24, 2015
setup.py Add python3 support Feb 20, 2016

README.md

PYSWF

A Python library for reading and writing SWF files. PYSWF is a Python port of Claus Wahlers great SWF parser https://github.com/claus/as3swf Can't thank Claus enough!

Build Status

INSTALL

$ pip install pyswf==1.5.4

or:

$ git clone git@github.com:timknip/pyswf.git
$ cd pyswf
$ python setup.py install

or you might need do:

$ sudo python setup.py install

WINDOWS

Install Pillow, lxml and pylzma from a binary distribution before running setup.

Installing the *.whl files:

$ pip install the-downloaded.whl

USAGE

Basic example:

from swf.movie import SWF

# create a file object
file = open('path/to/swf', 'rb')

# print out the SWF file structure
print SWF(file)

SVG export example:

from swf.movie import SWF
from swf.export import SVGExporter

# create a file object
file = open('path/to/swf', 'rb')

# load and parse the SWF
swf = SWF(file)

# create the SVG exporter
svg_exporter = SVGExporter()

# export!
svg = swf.export(svg_exporter)

# save the SVG
open('path/to/svg', 'wb').write(svg.read())