Skip to main content

pyvba

PyPI - Python Version PyPI GitHub

The pyvba package was designed to gather data from VBA-based applications (e.g. Microsoft Excel, CATIA, etc.). It may also be used to assist programming VBA macro scripts using the Python language.

Getting Started

Install the Python Package:

pip install pyvba

To export data from a VBA program:

import pyvba

catia = pyvba.Browser("CATIA.Application")
active_document = catia.ActiveDocument

exporter = pyvba.XMLExport(active_document)
exporter.save("output", r"C:\Documents")

The current supported output types are XML and JSON formats. Both support a form the imitates the VBA object tree as well as a dictionary form where each unique object is in the outermost layer.

Example Output:

Note: BrowserObject denotes an object defined elsewhere in the output.

{ "MainBody": [
	{ "Pad": [
		{ "Shapes": [
			{ "DirectionOrientation": 0 },
			{ "DirectionType": 0 },
			{ "FirstLimit": "BrowserObject" },
			{ "IsSymmetric": false },
			{ "IsThin": false },
			{ "MergeEnd": false },
			{ "Name": "Pad.1" },
			{ "NeutralFiber": false },
			{ "SecondLimit": "BrowserObject" },
			{ "Sketch": "BrowserObject" }
		]},
		{ "Shapes": [
			{ "DirectionOrientation": 0 },
			{ "DirectionType": 0 },
			{ "FirstLimit": "BrowserObject" },
			{ "IsSymmetric": false },
			{ "IsThin": false },
			{ "MergeEnd": false },
			{ "Name": "Pad.1" },
			{ "NeutralFiber": false },
			{ "SecondLimit": "BrowserObject" },
			{ "Sketch": "BrowserObject" }
		]},
		{ "Shapes": [
			{ "DirectionOrientation": 0 },
			{ "DirectionType": 0 },
			{ "FirstLimit": "BrowserObject" },
			{ "IsSymmetric": false },
			{ "IsThin": false },
			{ "MergeEnd": false },
			{ "Name": "Pad.3" },
			{ "NeutralFiber": false },
			{ "SecondLimit": "BrowserObject" },
			{ "Sketch": "BrowserObject" }
		]}
	]}
]}

Developer Notes

This package is in beta. Therefore, there are still some problematic bugs and issues that cause errors in certain applications. Contributors are welcome! The project is hosted on GitHub. Report any issues at the issue tracker, but please check to see if the issue already exists!

Metadata

Release files for pyvba 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvba 0.6.0
File Size Uploaded
pyvba-0.6.0.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyvba 0.6.0
File Interpreter ABI Platform
pyvba-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / pyvba-0.6.0.tar.gz

Download URL pyvba-0.6.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b9690a224242c9052054e50a5a83bc07b5da1fb3e5a4aec18a562d1dbbd1fe25
BLAKE2b-256 checksum
How to use checksums
4c9d3a72b7dcdd1841845bd9d2106d8711409b6dd2920bfdc342de5e29bfc5f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / pyvba-0.6.0-py3-none-any.whl

Download URL pyvba-0.6.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d8de0a1fb449e0b6a9d96f2b1177ce447e92271c91a65a689cdf1b71b289e5c
BLAKE2b-256 checksum
How to use checksums
1137c82d689d1e8a1e640809e03aafe8cc010e4d7700aa7cd85a0ccb9eda620a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page