SWF Parsing Utilities
Project description
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!
INSTALL
=======
python setup.py install
or you might need do:
$sudo python setup.py install
DEPENDENCIES
============
- lxml
- StringIO
- Image (PIL)
You can use easy_install or pip to install these.
NOTE: this code is only tested with python 2.6
USAGE
=====
Basic example:
--------------
```python
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:
-------------------
```python
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())
```
=====
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!
INSTALL
=======
python setup.py install
or you might need do:
$sudo python setup.py install
DEPENDENCIES
============
- lxml
- StringIO
- Image (PIL)
You can use easy_install or pip to install these.
NOTE: this code is only tested with python 2.6
USAGE
=====
Basic example:
--------------
```python
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:
-------------------
```python
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())
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyswf-1.5.2.tar.gz
(36.7 kB
view details)
File details
Details for the file pyswf-1.5.2.tar.gz
.
File metadata
- Download URL: pyswf-1.5.2.tar.gz
- Upload date:
- Size: 36.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a71cfe46c704d534f2cd476afacb2dab8c1969aa3037d415736f297c432dfd44 |
|
MD5 | 24470489fc27f26408d81f104d4727b3 |
|
BLAKE2b-256 | 2911536849b148308693839f0b9e68d4feb541355db637d2b532f085823691d4 |