Skip to main content

Coverage Status Build Status

VBA-Precompiler

About

The Microsoft VBA language includes a simple precompilation language (Conditional Compilation). This tool allows users to specify environment parameters to convert a conditional-module-body into a preprocessed-module-body.

This software operates as recommended in the Microsoft VBA Language Specification.

Requirements

vba_precompiler is tested on python 3.8 and higher.

Installation

Use the package manager pip to install VBA-Precompiler.

pip install vba_precompiler

Getting Started

vba_precompiler will take a specified directory that contains vba source code, and a set of environment values, and produce a set of matching vba source files in which code is excluded as directed by the precomiler directives.

For example, the following

Attribute VB_Name = "Input"
#Const TestType="testing"
#If Win16 Or Then
    foo = 6
#ElseIf Win32
    foo = 7
#EndIf
'Additional VBA code follows

Will be transformed to the following:

Attribute VB_Name = "Input"
'#Const TestType="testing"
'#If Win16 Then
    foo = 6
'#ElseIf Win32
'    foo = 7
'#EndIf
'Additional VBA code follows

To run the program

python vba_precompiler.py [-h] [-s SYSTEM] [-v VERSION] [-o OUTPUT] directory

positional arguments:
  directory             The source directory.

options:
  -h, --help            show this help message and
                        exit
  -s, --system          System Type, Win16, Win32, Win64, or Mac.
  -v, --version         VBA version, 6 or 7.
  -o, --output         output path, defaults to ./build.

examples:
  python -m vba_precompiler -s Win32 -v 7 -o ./build32_7 ./project

Tests

The tests directory contains complete unit and functional tests.

Contributing

Contributions are welcome. Please ensure new features include unit tests to maintain 100% coverage. All code must adhere to the PEP8 Standards for both formatting and naming. Method signatures must be fully annotated.

Metadata

Release files for vba-precompiler 0.0.1

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

Source distribution (sdist)

Source distribution for vba-precompiler 0.0.1
File Size Uploaded Provenance Actions
vba_precompiler-0.0.1.tar.gz 7.5 kB Without provenance Details for vba_precompiler-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vba-precompiler 0.0.1
File Interpreter ABI Platform Actions
vba_precompiler-0.0.1-py3-none-any.whl Python 3 none any Details for vba_precompiler-0.0.1-py3-none-any.whl

Total release size: 14.7 kB

Release files / vba_precompiler-0.0.1.tar.gz

Download URL vba_precompiler-0.0.1.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2243fd40c9d57d9bf0dd74ef436ec6b167f30c808f061f7fc28b00fdd2d6431c
BLAKE2b-256 checksum
How to use checksums
99b38026ebd6c41a470faa2da9d7b1779498be9e15ca7c659afa3d7d9a3f02ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release files / vba_precompiler-0.0.1-py3-none-any.whl

Download URL vba_precompiler-0.0.1-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41bc1bbcc6ce73b94a2e592db50d465f74566edfab7970ac23122aa12e2a0393
BLAKE2b-256 checksum
How to use checksums
bb140094709987e1ea0392064ae919d200452ae78d12a5f06020233b70e4d63c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Security for vba-precompiler 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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