Skip to main content

Framework web da linha Singular

Project description

Singular

Singular é um Framework Desenvolvido para facilidar o desenvolvimento de aplicativo Web usando apenas python com Interfaces reativas sistema de rontas com base em Diretorios

Instalação

Instalar o singular e simples Sem muito segredo basta Rodar o comando no Terminal e já esta.

pip

pip install singular

Linha de Comando

Iniciar um Projeto Singular Ficou mais simples

singular init

Esse Comando vai criar uma estrutura no modelo MVC: Model, View e Cntroller Nota Esse padrão pode ser mudado o singular da essa liberdade

Rodar o projeto

singular start

Esse comando iniciara um servidor Flask de Desenvolvimento

Exempo de Usuo

Isso Inicia um aplicativo È basicamento um Objeto Flask ex: app = Flask(...)

from singular import Singular


app = Singular(__name__)

criar uma pagina

from singular import (
    View,
    Text,
    Button,
    Link,
    Render,
    Component,
    Style,
    Link,
    Img
)


class Contador(Component):
    def __init__(self):
        super().__init__()
        self.state = {'count': 0}
    
    def increment(self):
        self.state['count'] += 1
        self.set_state(self.state)
    
    def render(self):
        return View(
            Text("Um Contador simples feito em Singular"),
            
            Button(
                f"Contador: {self.state['count']}", 
                on_click=self.increment,
                style=Style(
                    padding=".8rem",
                    font_size=".8rem",
                    background_color="blue",
                    color="#FFF",
                    border="none",
                    border_radius="0.5rem",
                    cursor="pointer",
                    font_weight="bold",
                )
            ),
            Link(
                "Ir Para o Lista de tarefa",
                href="/"
            ),
            style=Style(
                display="flex",
                flex_direction="column",
                gap="20px",
                padding="20px",
                width="100%",
                height="100dvh",
                align_items="center",
                justify_content="center",
                background_color="#111827",
                color="#FFF",
            )
            
        )



Render(
    Contador(),
)

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

singular_framework-1.0.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

singular_framework-1.0.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file singular_framework-1.0.0.tar.gz.

File metadata

  • Download URL: singular_framework-1.0.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for singular_framework-1.0.0.tar.gz
Algorithm Hash digest
SHA256 57bd992784e6dc42cfa663180c29676e2f887bb59a2f48287f7d10924113cb6f
MD5 a194efdd546f3f630c7161cc184df58d
BLAKE2b-256 ad4efe6d3f6005aea5849358ec6c937aeb9a83ccb0d897aceba7b567efab25c0

See more details on using hashes here.

File details

Details for the file singular_framework-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for singular_framework-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d682a55b3e6ca255018d1510590bccb14a62a76465a374b7342bba58b654abf
MD5 86085d7a7ea7b885bf9fc8b4031d86f7
BLAKE2b-256 7d9f82827d5ccb40b9d50d23c6153846ff425c4fbd9346ab954572a719154d6f

See more details on using hashes here.

Supported by

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