Skip to content

Commit 90229ab

Browse files
authored
Update README.md
1 parent 8b05d50 commit 90229ab

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ and can get called during application workflow.
1515
| Android | not yet |
1616
| iOS | not yet |
1717

18-
19-
You might use this plugin to create simple prototype applications
20-
and later re-write functions in rust to improve
21-
performance, add a specific rust library or just call some
22-
low-level code.
18+
You can use this plugin for fast prototypes or for production code.
19+
It might be possible that you want to use some python library or code that
20+
is not available for rust yet.
21+
In case that you want to ship production software packages, you just need
22+
to make sure to also ship the python code and python interpreter.
2323

2424
Android and iOS are possible in theory but I still need to figure out how to
2525
cross compile python and PyO3 for iOS and android.
@@ -64,17 +64,35 @@ console.log(await call.greet_python("input value"));
6464

6565
## Deployment
6666

67-
You either need to have python installed on the target machine or ship the shared python library with your package. You also may link the python library statically - PyO3 may do this by default if it finds a static python library. In addition, you need to copy the python files so that python files are next to the binary. The file `src-python/main.py` is required for the plugin to work correctly. You may also add additional python files or use a venv environment. The included resources can be configurable in the `tauri.conf.json` file. Check the tauri and PyO3 documentation for additional info.
67+
You either need to have python installed on the target machine or ship the shared
68+
python library with your package. You also may link the python library statically - PyO3
69+
may do this by default if it finds a static python library. In addition, you need
70+
to copy the python files so that python files are next to the binary.
71+
72+
The file `src-python/main.py` is required for the plugin to work correctly.
73+
You may also add additional python files or use a venv environment.
74+
The included resources can be configurable in the `tauri.conf.json` file.
75+
76+
Check the tauri and PyO3 documentation for additional info.
6877

6978
## Security considerations
7079
Generally, this plugin has been created by "security by default" concept. Python functions can only be called if registered from rust.
7180

7281
Keep in mind that this plugin can make it possible to run arbitrary python code.
73-
It is therefore highly recommended to **not make the user interface accessible by a network URL**.
82+
It is therefore highly recommended to **make sure the user interface is not accessible by a network URL** in production.
7483

7584
The "runPython" command is disabled by default via permissions. If enabled, it is possible to
76-
inject python code via javascript.
85+
inject python code directly via javascript.
7786
Also, the function "register" is disabled by default. If enabled, it can
7887
add control from javascript which functions can be called. This avoids to modify rust code when changing or adding python code.
7988
Both functions can be enabled during development for rapid prototyping.
8089

90+
## Alternatives
91+
If already know that you just want to develop completely in python, you might want to take a look at [pytauri](https://github.com/WSH032/pytauri).
92+
It is a different approach to have all tauri functionality completely in python.
93+
94+
This approach here with tauri-plugin-python is more lightweight and it is for you, if you
95+
- still want to write rust code
96+
- already have a tauri application and just need a specific python library
97+
- just want to simply support rare custom plugins
98+
- if you want to embed python code directly in your javascript

0 commit comments

Comments
 (0)