vsdx - A python library for processing .vsdx files
Project description
vsdx - A python library for processing Visio .vsdx files
Note: this is an early release with limited functionality
example code to find a shape with specific text, remove it, and then save the updated .vsdx file:
from vsdx import VisioFile
filename = 'my_file.vsdx'
# open a visio file
with VisioFile(filename) as vis:
# get page shapes collection
shapes = vis.page_objects[0].shapes
# get shape to remove by its text value
s = shapes[0].find_shape_by_text('Shape to remove') # type: VisioFile.Shape
# remove the shape if found
if s:
s.remove()
# save a new copy
vis.save_vsdx('shape_removed.vsdx')
Please refer to tests/test.py for more usage examples in the form of pytest tests.
Change Log
- 0.2.2: Added x & y location setters to Shape, and move(x_delta, y_delta) method - both with related tests
- 0.2.3: Updated tests to output files to an /out folder. Added test vsdx file with compound shape. Updated Shape text getter/setter
- 0.2.4: Added find_replace(old, new) method to Shape and Page classes to recursively replace old with new
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vsdx-0.2.4.tar.gz
(6.2 kB
view hashes)
Built Distribution
vsdx-0.2.4-py3-none-any.whl
(7.3 kB
view hashes)