https://github.com/upsonic/run
https://github.com/upsonic/run
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/upsonic/run
- Owner: Upsonic
- License: mit
- Created: 2023-10-16T17:54:09.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-16T18:06:42.000Z (almost 2 years ago)
- Last Synced: 2025-01-05T10:20:54.019Z (9 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Upsonic Run
The cloud python function runner with docker and Upsonic Cloud.
[Website](https://upsonic.co/upsonic-run) | [Discord](https://discord.gg/) | [Twitter](https://twitter.com/upsonic)
## Installation
You can install Upsonic by pip3:```console
pip3 install upsonic_run
```## Implementing
In this point you can use any [Upsonic Cloud](https://docs.upsonic.co/upsonic_cloud.html).We will use the Free cloud for these examples and for free `YOUR_CLOUD_KEY`:
```console
Upsonic cloud_key
```
>YOUR_CLOUD_KEY = "cloud-***"Also you can set any string for `YOUR_GLOBAL_ENCRYPTION_KEY` example:
> YOUR_GLOBAL_ENCRYPTION_KEY = "Thisismypass"### Basic
```python
from upsonic_run import Upsonic_Run
from upsonic import Upsonic_CloudYOUR_CLOUD_KEY = ""
YOUR_GLOBAL_ENCRYPTION_KEY = ""
INTERVAL = 15cloud = Upsonic_Cloud(YOUR_CLOUD_KEY)
run = Upsonic_Run(cloud, YOUR_GLOBAL_ENCRYPTION_KEY, interval=INTERVAL)# ------- REGISTER_FUNCTIONS -------
@cloud.active(encryption_key=YOUR_GLOBAL_ENCRYPTION_KEY)
def add(a, b, c=5):
return a + b + c# ------- RUN -------
print(run.run("add", args_for_func=(15, 5), kwargs_for_func={"c": 25}))
``````console
$ 45
```### Functions
```
run.add_task("add", endless=False, thread=True, args_for_func=(15, 5), kwargs_for_func={"c": 25})run.delete_task("add")
```## Contributing
Contributions to Upsonic Run are welcome! If you have any suggestions or find a bug, please open an issue on the GitHub repository. If you want to contribute code, please fork the repository and create a pull request.## License
Upsonic Run is released under the MIT License.
Contributors
Thank you for your contribution!