vcxproj-stream-editor
Simple Python library to parse Microsoft Visual Studio .vcxproj files and modify/rewrite without spurious changes
Usage:
Given the following simplified myproject.vcxproj:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{96F21549-A7BF-4695-A1B1-B43625B91A14}</ProjectGuid>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
</Project>
Example 1 (input only):
import vcxproj
@vcxproj.coroutine
def print_project_guid():
while True:
action, params = yield
if action == "start_elem" and params["name"] == "ProjectGuid":
action, params = yield
assert action == "chars"
print("Project GUID is ", params["content"])
vcxproj.check_file("myproject.vcxproj", print_project_guid)
Output:
Project GUID is {96F21549-A7BF-4695-A1B1-B43625B91A14}
Example 2 (input and output):
import vcxproj
@vcxproj.coroutine
def remove_warning_level(target)
while True:
action, params = yield
if action == "start_elem" and params["name"] == "WarningLevel":
action, params = yield
assert action == "chars"
action, params = yield
assert action == "end_elem"
assert params["name"] == "WarningLevel"
continue
target.send((action, params))
vcxproj.filter_file("myproject.vcxproj", remove_warning_level, "myproject.stripped.vcxproj")
myproject.stripped.vcxproj will have the following content:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{96F21549-A7BF-4695-A1B1-B43625B91A14}</ProjectGuid>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
</ClCompile>
</ItemDefinitionGroup>
</Project>
Possible values for (action, params):
| action | params |
|---|---|
start_elem |
{"name":<elem_name>, "attrs":{<attr1>:<value1>, <attr2>:<value2>}} |
chars |
{"content":<content>} |
end_elem |
{"name":<elem_name>} |
Metadata
Release files for vcxproj-stream-editor 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vcxproj_stream_editor-0.1.0.tar.gz | 7.5 kB | Without provenance | Details for vcxproj_stream_editor-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vcxproj_stream_editor-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for vcxproj_stream_editor-0.1.0-py3-none-any.whl |
Total release size: 14.9 kB
Release files / vcxproj_stream_editor-0.1.0.tar.gz
| Download URL | vcxproj_stream_editor-0.1.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
545da0f021c93666ba0b96590aad9f39772985a51957c3b48c8646daa307c411
|
|
BLAKE2b-256 checksum How to use checksums |
9625a0d978d6b34cced23ba0e6d84f9503f3956d838661ba22d328c507ef76ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / vcxproj_stream_editor-0.1.0-py3-none-any.whl
| Download URL | vcxproj_stream_editor-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb386c02534e0eb46c04abba3af33a78b4428b07afb0e4d95219c21199f4ef93
|
|
BLAKE2b-256 checksum How to use checksums |
eb4309b1ad059c17b17b3e9da43bd311f03e915efe8a8693e2fa8eceaf1db891
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Security for vcxproj-stream-editor 0.1.0
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.