Coder Social home page Coder Social logo

justpy-org / justpy Goto Github PK

View Code? Open in Web Editor NEW
1.2K 29.0 94.0 13.28 MB

An object oriented high-level Python Web Framework that requires no frontend programming

Home Page: https://justpy.io

License: Apache License 2.0

Python 4.09% HTML 0.21% JavaScript 95.33% CSS 0.25% Shell 0.11% Dockerfile 0.01% Procfile 0.01%
python web-framework highcharts ag-grid asgi asynchronous quasar-framework starlette nicegui

justpy's Introduction

JustPy

pypi Github Actions Build PyPI Status Downloads GitHub issues GitHub closed issues License

Introduction

JustPy was an object-oriented, component based, high-level Python Web Framework that required no front-end programming. With a few lines of only Python code, you could create interactive websites without any JavaScript programming. JustPy could also be used to create graphic user interfaces for Python programs.

Sunsetting justpy

See discussions-685 about the sunset of justpy. Version 14.0 is the sunset version. All issues have been closed as "won't fix". Pull Requests are still welcome and will be worked on in a "best effort" manner. You might want to migrate to nicegui (see below).

Docs and Tutorials

JustPy Docs and Tutorials

Live Demos

nicegui

justpy demos

Examples

clickdemo.py

clickdemo

dogs.py

dogs_animated

blackjack.py

blackjack_animated

If you have Questions, Suggestions or would like to get in touch

If you have a question about JustPy you are welcome to check stackoverflow questions tagged justpy and Especially questions which involve details of upstream frameworks such as ag-grid, Highcharts, Pandas, Plotly, Quasar, Tailwind and others are best ask involving the larger stackoverflow community and tagging your question with both "justpy" and the tag of the specific library your are asking a question for such as "ag-grid", "highcharts","quasar", "pandas" and others.

If you'd like to specifically address the JustPy contributors the github dicussions are place to ask questions, propose ideas and generally get in touch with the contributors.

New features are only possible via your own contribution.

Our github dicussions are categorized. Please use the Category "Ideas" for feature requests.

Issues for fixable bugs and Pull Requests are also welcome. Please make sure that you follow the stackoverflow style guidelines when posting issues. A good way to do this is to state the problem as a stackoverflow question first. This way a larger audience is able to discuss solutions and work arounds and find out which part of the technology stack you are using is actually involved in the issue you'd like to get resolved.

If your followed the procedure you are welcome to open an issue in the JustPy Github repository

Trying out with docker

git clone https://github.com/justpy-org/justpy
scripts/rundocker -h
scripts/rundocker test
scripts/rundocker example examples/dogs.py
scripts/rundocker dev
scripts/rundocker example examples/demo_browser.py

Introduction - with more Details

JustPy is an object-oriented, component based, high-level Python Web Framework that requires no front-end programming. With a few lines of only Python code, you can create interactive websites without any JavaScript programming. JustPy can also be used to create graphic user interfaces for Python programs.

Unlike other web frameworks, JustPy has no front-end/back-end distinction. All programming is done on the back-end allowing a simpler, more productive, and more Pythonic web development experience. JustPy removes the front-end/back-end distinction by intercepting the relevant events on the front-end and sending them to the back-end to be processed.

In JustPy, elements on the web page are instances of component classes. A component in JustPy is a Python class that allows you to instantiate reusable custom elements whose functionality and design is encapsulated away from the rest of your code.

Custom components can be created using other components as building blocks. Out of the box, JustPy comes with support for HTML and SVG components as well as more complex components such as charts and grids. It also supports most of the components and the functionality of the Quasar library of Material Design 2.0 components.

JustPy encourages creating your own components and reusing them in different projects (and, if applicable, sharing these components with others).

JustPy supports visualization using matplotlib and Highcharts.

JustPy integrates nicely with pandas and simplifies building web sites based on pandas analysis. JustPy comes with a pandas extension that makes it simple to create interactive charts and grids from pandas data structures.

For updates and news please follow the JustPy Twitter account

Hello World!

import justpy as jp

def hello_world():
    wp = jp.WebPage()
    d = jp.Div(text='Hello world!')
    wp.add(d)
    return wp

jp.justpy(hello_world)

The program above activates a web server that returns a web page with 'Hello world!' for any request. Locally, you would direct your browser to http://127.0.0.1:8000 or http://localhost:8000/ or to see the result.

Here is a slightly modified version in which 'Hello world!' changes to 'I was clicked!' when it is clicked.

import justpy as jp

def my_click(self, msg):
    self.text = 'I was clicked!'

def hello_world():
    wp = jp.WebPage()
    d = jp.Div(text='Hello world!')
    d.on('click', my_click)
    wp.add(d)
    return wp

jp.justpy(hello_world)

Many other examples can be found in the tutorial

Under the Hood

JustPy's backend is built using:

JustPy's frontend (which is transparent to JustPy developers) is built using:

  • Vue.js - "The Progressive JavaScript Framework"

The way JustPy removes the frontend/backend distinction is by intercepting the relevant events on the frontend and sending them to the backend to be processed.

License

Apache License, Version 2.0

Copyright (c) 2019-2024, Eliezer Mintz and justpy contributors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.