Skip to content

Commit c8e2d7e

Browse files
mvp
Remove cruft unrelated to flet. Add counter.py
1 parent 13fa779 commit c8e2d7e

68 files changed

Lines changed: 159 additions & 12680 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
python 3.10.7
2-
poetry 1.2.0
1+
python 3.10.8
2+
poetry 1.2.2

CONTRIBUTING.md

Lines changed: 0 additions & 103 deletions
This file was deleted.

LICENSE.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,31 @@
1-
# python_template
1+
# flet_demo
22

3-
!["It's dangerous to go alone! Take this."](img/zelda.jpg)
4-
<!-- <img src="https://user-images.githubusercontent.com/4097471/144654508-823c6e31-5e10-404c-9f9f-0d6b9d6ce617.jpg" width="300"> -->
53

64
## Summary
7-
Oftentimes the initial setup of a Python repo can take a few minutes to a couple hours.
8-
By laying the foundation to rapidly implement an idea, can focus on the good bits instead of
9-
DevOps drudgery.
105

11-
### Caveat Emptor
12-
Very little of this gets tested on Windows hosts. Windows Subsystem for Linux (WSL) is used where necessary with the default Ubuntu LTS install. Moved bulk of document to the [markdown](markdown/) directory to opt-in vs. opt-out of documentation.
13-
14-
Be the change et al if Windows is your main and you wanna [raise a PR](CONTRIBUTING.md) with broad instructions on getting tooling working under Windows (e.g., docker, poetry, playwright.)
156

167
**Table of Contents**
17-
* [python_template](#python_template)
8+
* [flet_demo](#flet_demo)
189
* [Summary](#summary)
19-
* [Caveat Emptor](#caveat-emptor)
2010
* [Setup](#setup)
2111
* [Usage](#usage)
22-
* [Mac and Linux users](#mac-and-linux-users)
23-
* [Pushing to Docker Hub with CI](#pushing-to-docker-hub-with-ci)
2412
* [TODO](#todo)
13+
* [Further Reading](#further-reading)
2514

2615
## Setup
2716
* Install
2817
* [editorconfig](https://editorconfig.org/)
29-
* [wsl](https://docs.microsoft.com/en-us/windows/wsl/setup/environment)
3018
* [asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf)
3119
* [poetry](https://python-poetry.org/docs/)
3220
* [docker-compose](https://docs.docker.com/compose/install/)
33-
* [playwright](https://playwright.dev/python/docs/intro#installation)
34-
* [Kubernetes (k8s)](markdown/kubernetes.md)
3521
* [justfile](https://just.systems/man/en/)
3622

3723
## Usage
38-
### Mac and Linux users
39-
Development environments and tooling are first-class citizens on macOS and *nix. For Windows faithfuls, please setup [WSL](markdown/wsl.md).
40-
41-
## Pushing to Docker Hub with CI
42-
Docker Hub is a cloud-based repository in which Docker users and partners create, test, store and distribute container images. Docker images are pushed to Docker Hub through the docker push command. A single Docker Hub repository can hold many Docker images (stored as tags).
43-
44-
Automated CI is implemented via GitHub Actions to build and push this repository's image to Docker Hub in `/.github/workflows/push.yml`.
4524

46-
### What you need to modify in this file
4725

48-
* Look for `images: your-username/your-image-name` and change to your respective Docker Hub username and image name.
49-
* Add repository secrets for `DOCKERHUB_TOKEN` and `DOCKERHUB_USERNAME` on this repository on GitHub.
50-
* Here are the [instructions to create a token](https://docs.docker.com/docker-hub/access-tokens/#create-an-access-token).
26+
## TODO
27+
* [Open Issues](https://github.com/pythoninthegrass/flet_demo/issues)
5128

52-
Here are the [instructions to disable this action](https://docs.github.com/en/actions/managing-workflow-runs/disabling-and-enabling-a-workflow) if you don't want this feature.
5329

54-
## TODO
55-
* [Open Issues](https://github.com/pythoninthegrass/python_template/issues)
56-
* Markdown automation
57-
* Look for an extension similar to [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) that updates file/directory links when they move
58-
* Webdev
59-
* Django
60-
* Merge with [docker_python](https://github.com/pythoninthegrass/docker_python) and put the latter on an ice float
61-
* [Django Ninja](https://realpython.com/courses/rest-apis-with-django-ninja/)
62-
* Flask
63-
* Bonus points for [Svelte](https://svelte.dev/blog/the-easiest-way-to-get-started) front-end ❤️
64-
* FastAPI
65-
* [SQL](https://realpython.com/python-sql-libraries/)
66-
* MySQL
67-
* PostgreSQL
68-
* SQLite
69-
* NoSQL
70-
* MongoDB
71-
* Switch to `docker-compose`
72-
* Fix unique index deleting too many keys
73-
* [Redis](https://realpython.com/python-redis/)
74-
* DevOps
75-
* [Cloud Native](https://www.cncf.io/about/faq/#what-is-cloud-native)
76-
* AWS
77-
* Azure
78-
* GCP
79-
* [k8s](markdown/kubernetes.md)
80-
* `~/.kubeconfig`
81-
* Kompose
82-
* Helm
83-
* minikube
84-
* Expand usage and syntax
85-
* [Argo](https://argoproj.github.io/)
86-
* [Flux](https://fluxcd.io/)
87-
* [DevSpace](https://www.devspace.sh/)
88-
* [Ansible](https://realpython.com/automating-django-deployments-with-fabric-and-ansible/)
89-
* [Heroku](https://realpython.com/courses/deploying-a-flask-application-using-heroku/)
90-
* [justfile](https://just.systems/man/en/)
91-
* [Windows Subsystem for Linux (WSL)](markdown/wsl.md)
92-
* VSCode
93-
* Remote WSL install and usage
94-
* Or at least further reading nods
95-
* Debugging
96-
* Dependencies
97-
* script itself via [icecream](https://github.com/gruns/icecream)
30+
## Further Reading
31+
[Introduction | Flet](https://flet.dev/docs/)

api/graphql/.gitkeep

Whitespace-only changes.

api/rest/.gitkeep

Whitespace-only changes.

counter.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env python3
2+
3+
import flet
4+
from flet import IconButton, Page, Row, TextField, icons
5+
6+
7+
def main(page: Page):
8+
"""Main function"""
9+
page.title = "Flet counter example"
10+
page.vertical_alignment = "center"
11+
12+
txt_number = TextField(value="0", text_align="right", width=100)
13+
14+
def minus_click(e):
15+
txt_number.value = int(txt_number.value) - 1
16+
page.update()
17+
18+
def plus_click(e):
19+
txt_number.value = int(txt_number.value) + 1
20+
page.update()
21+
22+
page.add(
23+
Row(
24+
[
25+
IconButton(icons.REMOVE, on_click=minus_click),
26+
txt_number,
27+
IconButton(icons.ADD, on_click=plus_click),
28+
],
29+
alignment="center",
30+
)
31+
)
32+
33+
34+
# flet.app(target=main) # desktop app
35+
flet.app(target=main, view=flet.WEB_BROWSER) # web app

data_science/.gitkeep

Whitespace-only changes.

devops/.gitkeep

Whitespace-only changes.

django/Dockerfile

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)