mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
README update and code quality checks (#2202)
* README updates. * Ensure pre-commit black args match those in Makefile. * Ensure pre-commit and requirements versions align, and the commands run are the same in pre-commit and Makefile. * Update README files to reflect recent changes. Where possible, remove duplication and point to the official docs. * Run format and pre-commit prettifier on code. * Remove isort - it causes more trouble than is justified. * Ensure usage examples in the README.
This commit is contained in:
committed by
GitHub
parent
6fab9a1c26
commit
af06bc4826
136
README.md
136
README.md
@@ -1,97 +1,85 @@
|
||||
# PyScript
|
||||
|
||||
## What is PyScript
|
||||
## PyScrcipt is an open source platform for Python in the browser.
|
||||
|
||||
### Summary
|
||||
Using PyScript is as simple as:
|
||||
|
||||
PyScript is a framework that allows users to create rich Python applications in the browser using HTML's interface and the power of [Pyodide](https://pyodide.org/en/stable/), [MicroPython](https://micropython.org/) and [WASM](https://webassembly.org/), and modern web technologies.
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>PyScript!</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://pyscript.net/snapshots/2024.9.2/core.css"
|
||||
/>
|
||||
<script
|
||||
type="module"
|
||||
src="https://pyscript.net/snapshots/2024.9.2/core.js"
|
||||
></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Use MicroPython to evaluate some Python -->
|
||||
<script type="mpy" terminal>
|
||||
print("Hello, world!")
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
To get started see the [Beginning PyScript tutorial](https://docs.pyscript.net/latest/beginning-pyscript/).
|
||||
PyScript enables the creation of rich Python applications in the browser using
|
||||
[Pyodide](https://pyodide.org/en/stable/) (a version of
|
||||
[CPython](https://python.org/)), [MicroPython](https://micropython.org/),
|
||||
[WASM](https://webassembly.org/), and modern web technologies. It means Python
|
||||
now runs anywhere a browser runs: desktop, laptop, mobile, tablet, or any other
|
||||
browser enabled device.
|
||||
|
||||
For examples see [here](https://pyscript.com/@examples).
|
||||
To start building, read the
|
||||
[Beginning PyScript tutorial](https://docs.pyscript.net/latest/beginning-pyscript/).
|
||||
|
||||
For example applications, see [here](https://pyscript.com/@examples).
|
||||
|
||||
Other useful resources:
|
||||
|
||||
- Our [Home Page](https://pyscript.net/) as an open source project.
|
||||
- The [official technical docs](https://docs.pyscript.net/).
|
||||
- Our current [Home Page](https://pyscript.net/) on the web.
|
||||
- A free-to-use [online editor](https://pyscript.com/) for trying PyScript.
|
||||
- Our community [Discord Channel](https://discord.gg/BYB2kvyFwm), to keep in touch .
|
||||
- A [YouTube channel](https://www.youtube.com/@PyScriptTV) with helpful videos
|
||||
and community content.
|
||||
- A free-to-use [online IDE](https://pyscript.com/) for trying PyScript.
|
||||
- Our community [Discord Channel](https://discord.gg/BYB2kvyFwm), to keep in
|
||||
touch .
|
||||
|
||||
Every Tuesday at 15:30 UTC there is the _PyScript Community Call_ on zoom, where we can talk about PyScript development in the open. Most of the maintainers regularly participate in the call, and everybody is welcome to join.
|
||||
Every Tuesday at 15:30 UTC there is the _PyScript Community Call_ on zoom,
|
||||
where we can talk about PyScript development in the open. Most of the
|
||||
maintainers regularly participate in the call, and everybody is welcome to
|
||||
join. This meeting is recorded and uploaded to our YouTube channel.
|
||||
|
||||
Every other Thursday at 16:00 UTC there is the _PyScript FUN_ call: this is a call in which everybody is encouraged to show what they did with PyScript.
|
||||
Every other Thursday at 16:00 UTC there is the _PyScript FUN_ call: the focus
|
||||
of this call is to share fun projects, goofy hacks or clever uses of PyScript.
|
||||
It's a supportive, energetic and entertaining meeting. This meeting is also
|
||||
recorded and uploaded to our YouTube channel.
|
||||
|
||||
For more details on how to join the calls and up to date schedule, consult the official calendar:
|
||||
For more details on how to join the calls and up to date schedule, consult the
|
||||
official calendar:
|
||||
|
||||
- [Google calendar](https://calendar.google.com/calendar/u/0/embed?src=d3afdd81f9c132a8c8f3290f5cc5966adebdf61017fca784eef0f6be9fd519e0@group.calendar.google.com&ctz=UTC) in UTC time;
|
||||
- [iCal format](https://calendar.google.com/calendar/ical/d3afdd81f9c132a8c8f3290f5cc5966adebdf61017fca784eef0f6be9fd519e0%40group.calendar.google.com/public/basic.ics).
|
||||
|
||||
### Longer Version
|
||||
## Contribute
|
||||
|
||||
PyScript is a meta project that aims to combine multiple open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural both to web and Python developers.
|
||||
For technical details of the code, please see the [README](core/README) in the
|
||||
`core` directory.
|
||||
|
||||
## Try PyScript
|
||||
Read the [contributing guide](https://docs.pyscript.net/latest/contributing/)
|
||||
to learn about our development process, reporting bugs and improvements,
|
||||
creating issues and asking questions.
|
||||
|
||||
To try PyScript, import the appropriate pyscript files into the `<head>` tag of your html page:
|
||||
|
||||
```html
|
||||
<head>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://pyscript.net/releases/2024.8.2/core.css"
|
||||
/>
|
||||
<script
|
||||
type="module"
|
||||
src="https://pyscript.net/releases/2024.8.2/core.js"
|
||||
></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="py" terminal>
|
||||
from pyscript import display
|
||||
display("Hello World!") # this goes to the DOM
|
||||
print("Hello terminal") # this goes to the terminal
|
||||
</script>
|
||||
</body>
|
||||
```
|
||||
|
||||
You can then use PyScript components in your html page. PyScript currently offers various ways of running Python code:
|
||||
|
||||
- `<script type="py">`: can be used to define python code that is executable within the web page.
|
||||
- `<script type="py" src="hello.py">`: same as above, but the python source is fetched from the given URL.
|
||||
- `<script type="py" terminal>`: same as above, but also creates a terminal where to display stdout and stderr (e.g., the output of `print()`); `input()` does not work.
|
||||
- `<script type="py" terminal worker>`: run Python inside a web worker: the terminal is fully functional and `input()` works.
|
||||
- `<py-script>`: same as `<script type="py">`, but it is not recommended because if the code contains HTML tags, they could be parsed wrongly.
|
||||
- `<script type="mpy">`: same as above but use MicroPython instead of Python.
|
||||
|
||||
Check out the [official docs](https://docs.pyscript.net/) for more detailed documentation.
|
||||
|
||||
## How to Contribute
|
||||
|
||||
Read the [contributing guide](https://docs.pyscript.net/latest/contributing/) to learn about our development process, reporting bugs and improvements, creating issues and asking questions.
|
||||
|
||||
Check out the [developing process](https://docs.pyscript.net/latest/developers/) documentation for more information on how to setup your development environment.
|
||||
|
||||
For technical details of the code, please see the [README](pyscript.core/README) in `pyscript.core`.
|
||||
Check out the [developing process](https://docs.pyscript.net/latest/developers/)
|
||||
documentation for more information on how to setup your development environment.
|
||||
|
||||
## Governance
|
||||
|
||||
The [PyScript organization governance](https://github.com/pyscript/governance) is documented in a separate repository.
|
||||
|
||||
## Release
|
||||
|
||||
To cut a new release of PyScript simply
|
||||
[add a new release](https://github.com/pyscript/pyscript/releases) while
|
||||
remembering to write a comprehensive changelog. A [GitHub action](https://github.com/pyscript/pyscript/blob/main/.github/workflows/publish-release.yml)
|
||||
will kick in and ensure the release is described and deployed to a URL with the
|
||||
pattern: https://pyscript.net/releases/YYYY.M.v/ (year/month/version - as per
|
||||
our [CalVer](https://calver.org/) versioning scheme).
|
||||
|
||||
Then, the following three separate repositories need updating:
|
||||
|
||||
- [Documentation](https://github.com/pyscript/docs) - Change the `version.json`
|
||||
file in the root of the directory and then `node version-update.js`.
|
||||
- [Homepage](https://github.com/pyscript/pyscript.net) - Ensure the version
|
||||
referenced in `index.html` is the latest version.
|
||||
- [PSDC](https://pyscript.com) - Use discord or Anaconda Slack (if you work at
|
||||
Anaconda) to let the PSDC team know there's a new version, so they can update
|
||||
their project templates.
|
||||
The [PyScript organization governance](https://github.com/pyscript/governance)
|
||||
is documented in a separate repository.
|
||||
|
||||
Reference in New Issue
Block a user