All Projects → nuxt-community → Python Module

nuxt-community / Python Module

Licence: mit
Write Nuxt.js applications using Python! [Experimental]

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Module

Nuxt Chat App
Frontend of real-time chat application built using nuxtjs, socket.io. Check the backend at https://github.com/binbytes/chat-app-server.
Stars: ✭ 77 (-57.46%)
Mutual labels:  nuxt, nuxtjs, frontend
Vue State Store
📮 VSS (Vue State Store) - Vue State Management (with Publish & Subscribe pattern)
Stars: ✭ 128 (-29.28%)
Mutual labels:  nuxt, nuxtjs
Nuxt Beginners Guide
Japan's first book that corresponds to Nuxt.js v2 and focuses on deep content.
Stars: ✭ 127 (-29.83%)
Mutual labels:  nuxt, nuxtjs
Surmon.me
🆒 My personal website and blog, powered by @vuejs (3)
Stars: ✭ 1,767 (+876.24%)
Mutual labels:  nuxt, nuxtjs
Wp Nuxt
The module adds WP-API to your nuxt application.
Stars: ✭ 179 (-1.1%)
Mutual labels:  nuxt, frontend
Contenta vue nuxt
Start in minutes a Drupal 8 with JSON API and Vue.js : a Nuxt.js ( Vue.js SSR ) consumer for Contenta CMS
Stars: ✭ 125 (-30.94%)
Mutual labels:  nuxt, nuxtjs
Blog Module
Build your blog with @nuxt
Stars: ✭ 130 (-28.18%)
Mutual labels:  nuxt, nuxtjs
Infoboard
Infoboard showing time, weather, calendar events, photos from local folder or online sources as background and Transport for London status updates. Intended for Raspberry Pi, but should work on any machine with NodeJS available.
Stars: ✭ 111 (-38.67%)
Mutual labels:  nuxt, nuxtjs
Nuxpress
A Nuxt-based blogging engine and boilerplate
Stars: ✭ 135 (-25.41%)
Mutual labels:  nuxt, nuxtjs
Nuxt Payload Extractor
Nuxt.js module that makes `nuxt generate` command to store html and payload separately.
Stars: ✭ 140 (-22.65%)
Mutual labels:  nuxt, nuxtjs
Vue Soundcloud
🎧 A SoundCloud client built with Vue and Nuxt
Stars: ✭ 141 (-22.1%)
Mutual labels:  nuxt, nuxtjs
Nuxt Client Init Module
Provide client version of nuxtServerInit
Stars: ✭ 176 (-2.76%)
Mutual labels:  nuxt, nuxtjs
Nuxt Dev To Clone
Build DEV.TO clone with Nuxt.js and new `fetch` hook
Stars: ✭ 118 (-34.81%)
Mutual labels:  nuxt, nuxtjs
Nuxt Helmet
👷 Helmet for Nuxt
Stars: ✭ 126 (-30.39%)
Mutual labels:  nuxt, nuxtjs
Bitwave
Front end for [bitwave.tv] - an open platform live video streaming service
Stars: ✭ 113 (-37.57%)
Mutual labels:  nuxt, nuxtjs
Jellyfin Vue
A modern web client for Jellyfin based on Vue.
Stars: ✭ 129 (-28.73%)
Mutual labels:  nuxt, nuxtjs
Nuxt Imagemin
Nuxt module to minify your images. Works with: png, jpeg, gif, and svg
Stars: ✭ 170 (-6.08%)
Mutual labels:  nuxt, nuxtjs
Bulmaswatch
Themes for Bulma
Stars: ✭ 1,525 (+742.54%)
Mutual labels:  frontend, website
Dayjs Module
Official Day.js module for your Nuxt.js project.
Stars: ✭ 111 (-38.67%)
Mutual labels:  nuxt, nuxtjs
Webapp.rs
A web application completely written in Rust. 🌍
Stars: ✭ 1,888 (+943.09%)
Mutual labels:  frontend, website

@nuxtjs/python

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

Write Nuxt.js Apps in Python

📖 Release Notes

Features

  • Write Nuxt.js applications using Python!
  • Currently only supports custom Javascripthon but in the future other compilers will also be expected to work.

Try the example

  1. Clone this repository and change directory into it
  2. Install dependencies:
    npm install                         # or use yarn
    
    pip install -r requirements.txt
    
  3. Run example: npm run dev

Setup in your own project

  • Add @nuxtjs/python dependency using yarn or npm to your project
  • Add @nuxtjs/python to modules section of nuxt.config.js
    {
      modules: [
        '@nuxtjs/python'
      ],
      python: {
        compiler: 'pj'   // default
      }
    }
    
  • In Vue files, Mark your script tags like this: <script lang="py">.
  • You may pass options to py-loader (currently it supports compiler parameter)

Choice of Python to Javascript compiler

Compiler default and recommended is Javascripthon but it is possible to use other compilers (see below).

  • Install the Javascripthon Python transpiler. For now you'll need the master branch e.g:

    pip install -e git+https://gitlab.com/metapensiero/metapensiero.pj#egg=javascripthon
    
  • Note that Javascripthon requires that you have Python 3.5 (or better).

  • Javascripthon supports converting Python import statements to ES6 imports as used in Nuxt. Please note syntax conversions.

  • You can pass a compiler option to py-loader by using module options or in a python section in your nuxt.config.js file.

  • Transcrypt has its own module system so in order to use it, you can use the CommonJS module standard (require to import and module.exports) and it should work. See the py-loader Vuejs example.

Usage

Using .vue files

TIP If you use Vim you can get syntax highlighting for HTML, CSS and Python by installing vim-vue plugin and applying this patch.

hello.vue:

<template>
  <div>
      Nuxt {{ best_lang }}
  </div>
</template>

<script lang="py">
class Component:
  def __init__(self):
      self['data'] = lambda: { 'best_lang': 'Python' }

__default__ = Component()
</script>

Using .py files for other nuxt files

store/index.py

from vuex import Store

def increment(state):
    state.counter = state.counter + 1

def createStore():
    return Store(
      state={'counter': 0},
      mutations={'increment': increment}
    )

__default__ = createStore

pages/counter.vue

<template>
  <h2>{{ $store.state.counter }}</h2>
  <button @click="$store.commit('increment')">+1</button>
</template>

👉 For a working example, see here.

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Start development server using npm run dev

License

MIT License

Copyright (c) Sebastian Silva [email protected]

This module was started from the module-template by Pooya Parsa and relies heavily on python-webpack-loader by Martim Nascimento and Javascripthon by Alberto Berti.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].