Registry / web-framework / vbuild

vbuild

JSON →
library0.8.2pypypi✓ verified 84d ago

vbuild is a Python library (v0.8.2) designed to extract HTML, JavaScript, and CSS from Vue.js `.vue` single-file components. Its primary advantage is operating without a Node.js environment, making it suitable for Python-only backends. It supports minification and targets ES2015-compliant JavaScript. The project is currently in active maintenance with infrequent updates.

pip install vbuild
INSTALL
IMPORT
SIG · VBUILD
V
vbuild
web-frameworkpythonv0.8.2
Install
1.6s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VBuild
from vbuild import VBuild
from vbuild.vbuild import VBuild
Content
from vbuild import Content
VueParser
from vbuild import VueParser

This quickstart demonstrates how to instantiate VBuild with a Vue SFC string and extract its `html`, `script`, and `style` components. It also shows basic minification options.

from vbuild.vbuild import VBuild vue_sfc_content = """ <template> <div id="app"> <h1>Hello {{ name }}</h1> <p>Message: {{ msg }}</p> </div> </template> <script> export default { data() { return { name: 'Registry', msg: 'This is a vbuild example' } } } </script> <style scoped> #app { font-family: Arial, sans-serif; color: #333; } h1 { color: #007bff; } </style> """ vb = VBuild(vue_sfc_content) print("--- HTML ---") print(vb.html) print("\n--- Script ---") print(vb.script) print("\n--- Style ---") print(vb.style) # Example with minification vb_minified = VBuild(vue_sfc_content, minify=True, minify_js=True) print("\n--- Minified Script (first 100 chars) ---") print(vb_minified.script[:100])
Debug
Known issues
gotchavbuild relies on a regex-based parser, which is inherently less robust than a full Abstract Syntax Tree (AST) parser. It may struggle with complex, non-standard, or slightly malformed Vue SFC syntax, leading to incomplete extractions or parsing errors that a dedicated VueJS parser would handle.
fix
For critical applications requiring highly robust Vue SFC parsing, consider `vuejs-sfc-parser` or Node.js-based tools. Ensure your Vue SFCs strictly adhere to standard syntax when using `vbuild`.
affects: All versions
gotchavbuild only extracts the raw HTML, JavaScript, and CSS content from a Vue SFC; it does not perform any JavaScript transpilation (e.g., converting ESNext to ES5) or Vue-specific compilation beyond basic extraction. The `script` content provided by `vbuild.script` is raw and may require further processing by external tools if it contains modern JavaScript features or complex Vue logic.
fix
Be aware that the extracted `script` content is raw. If you need full JavaScript transpilation or Vue component compilation, you will need to integrate additional tools (e.g., Babel, TypeScript, or a simple `esbuild` subprocess call) into your workflow.
affects: All versions
Upgrade
Version history
0.8.2latest on PyPI · released Aug 3, 2023
Audit
Dependencies
pythonrequiredSupports Python 2.7 and Python 3.6+ (explicitly excludes 3.0-3.5).
Agent activity
2 hits · last 30 days
node
2
Resources
vbuild — pip install vbuild · libregistry