An experimental Full-Stack Framework for Python
Project description
An Experimental Full-Stack Framework For Python. (Still in Development)
📝 Table of Contents
🧐 About
A full-stack framework built with python. The library is shipped with Bootstrap 5 for your styling needs.
Docs: https://sas2k.github.io/Lemon
Discord Server: https://discord.gg/wg239Cpf
Features:
- UI Library (Development)
- A full Back-end Capabilities [routing, post and get, class based route-handling, cookies and etc...]
- An ORM and migrations feature (check-out -> examples/Lemon-App) (ORM supports strings only for now.)
- React like syntax
- middleware api
- a terminal app to create app [create-lemon-app < app-name >]
- Component Generator [https://github.com/Sas2k/Lemon-CLI]
- Reactivity (See
examples/reactivity-example)
If you want to have live reloading try uvicorn: https://www.uvicorn.org/
If you don't think this isn't capable to handle anything check this out! -> https://portfolio-sas2k.vercel.app/ | https://github.com/Sas2k/portfolio
🗒 To-Do
Legend:
[x] - checked [*] - doing [ ] - Not Done
- Form Data Handling
- complex front-end stuff
- Models (Databases)
- API
- Docs
- Get to V1.0.0 (woop woop 🎉)
🏁 Getting Started
Docs Are still in Development Try heading over to /examples for some idea.
Here is an example below
from Lemon import Component
from Lemon.server import Server
app = Server(static_dir=None) #set the static_dir to none if there is no .css or .js files =The Default Folder for static is public=
Root = Component("Home Page", None, None) #Root component: The component where your other components are rendered: The name inside is the name displayed on the tab, the 2 nones are for css and js file locations
class Home(Component):
"Home Page Component"
name = "Home" # Name of the component : REQUIRED
def item(props: dict): #item function where the renderer calls to get your html and other code
return """
<h1>Hello World!</h1>
"""
Root.add([Home]) #Add the Home component to the Root component
@app.route("/") #Route decorator
def index(request, response):
home_page = Root.render("<Home/>") #Note: always use components in Root.render never HTML
response.text = home_page
app.run() #runs the app
Folder Structure for apps
Here is the folder structure I recommend. (you can create your own structure based on your needs)
App/
- src/
- Components/
- __init__.py
- components.py
- Models/
- __init__.py
- models.py
- Public/
- css/
- style.css
- js/
- script.js
- app.py
- base.py
- README.md
Installing
To install with,
pip: pip install Lemon-Library
⛏️ Built Using
✍️ Authors
- @Sas2k - Idea & Initial work
See also the list of contributors who participated in this project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Lemon-Library-1.2.6.tar.gz.
File metadata
- Download URL: Lemon-Library-1.2.6.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d118d5f7d64a86f016de26f4addfd9f57d76e07776ce2f1145e827bd8ea9133
|
|
| MD5 |
170ff10d057024ee7d8e979e42034f3f
|
|
| BLAKE2b-256 |
6b3e2609b5ccf35891286adb2dcc10d5367e3b82852b2636b533f7186b616068
|