Skip to main content

A simple module to extract html/script/style from a vuejs '.vue' file (can minimize/es2015 compliant js) ... just py2 or py3, NO nodejs !

Project description

vbuild

"Compile" your VueJS components (*.vue) to standalone html/js/css ... python only, no need of nodejs. And you can use python components with vbuild, in your vue/sfc files !!!

It's just an utility to generate HTML(template), SCRIPT and STYLE from a VUE/SFC component (*.vue). It won't replace webpack/nodejs/vue-cli, it fills the "Sometimes you have to work with the tools you have, not the ones you want." gap.

DEMO

Available on pypi

Changelog

Features

import vbuild

c=vbuild.render("mycompo.vue")
#c=vbuild.render("vues/*.vue")
#c=vbuild.render( "c1.vue", "c2.vue" )
#c=vbuild.render( "c1.vue", "vues/*.vue" )

print( c.html )
print( c.script )
print( c.style )

#or 

print( c ) # all stuff in html tags

Main Goal

Its main purpose is to let you use components (.vue files) in your vuejs app, without a full nodejs stack. It's up to you to create your generator, to extract the things, and create your "index.html" file. It's a 4 lines of python code; example:

import vbuild
buf=readYourTemplate("index.tpl") # should contains a tag "<!-- HERE -->" that would be substituted
buf=buf.replace("<!-- HERE -->",str( vbuild.render( "vues/*.vue" ) ) )
writeYourTemplate("index.html",buf)

(a real example of rendering vue/sfc components, using vbuild and the marvelous wuy)

Vue/sfc component compatibility

All classical JS vue/sfc components are compatibles. But now, you can use python component too.

Here is, side by side, the same component (in js, and in python):

To use the full features of vbuild

If you want to use the full features, you'll need to install the optionnal's libs.

sudo pip install pyscss lesscpy closure

All theses libs works with py2 and/or py3, and you could use the css-pre-processors SASS and LESS, and closure to minify js.

TODO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vbuild-0.8.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

vbuild-0.8.2-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file vbuild-0.8.2.tar.gz.

File metadata

  • Download URL: vbuild-0.8.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1041-azure

File hashes

Hashes for vbuild-0.8.2.tar.gz
Algorithm Hash digest
SHA256 270cd9078349d907dfae6c0e6364a5a5e74cb86183bb5093613f12a18b435fa9
MD5 d7797345d0741ab8b88d68a874b88ba8
BLAKE2b-256 22bef0c6204a36440bbcc086bfa25964d009b7391c5a3c74d6e73188efd47adb

See more details on using hashes here.

File details

Details for the file vbuild-0.8.2-py2.py3-none-any.whl.

File metadata

  • Download URL: vbuild-0.8.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.2 Linux/5.15.0-1041-azure

File hashes

Hashes for vbuild-0.8.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d76bcc976a1c53b6a5776ac947606f9e7786c25df33a587ebe33ed09dd8a1076
MD5 efe6e500ea4fa92463e47d0a4bb94d05
BLAKE2b-256 a63d7b22abbdb059d551507275a2815bc2b1974e3b9f6a13781c1eac9e858965

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page