Metadata-Version: 2.1
Name: positron-networks
Version: 0.1.5
Summary: Run expiriments on the Positron Cloud
Author: Balint Kerdi
Author-email: bkerdi@positronnetworks.com
License: Apache License 2.0
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests<3.0.0,>=2.20.0
Requires-Dist: python-socketio<6.0.0,>=5.0.0
Requires-Dist: colorama<1.0.0,>=0.4.0
Requires-Dist: configparser<7.0.0,>=5.0.0
Requires-Dist: argparse>=1.4.0
Requires-Dist: aiohttp>=3.7.4.post0


# Positron Decorator

A Python decorator to handle deploying your code into the Positron Cloud.

## Installation

Install the package from PyPi:

```bash
pip install positron-networks
```

## Usage

### Command Line Arguments

- `-l, --local`: Run the script on your local machine. Overwrites `--positron-deploy`.
- `--positron-deploy`: Deploy your script into Positron Cloud.
- `--stream-stdout`: Stream the stdout from Positron Cloud back to your CLI.
- `--debug`: Get more detailed error messages.

### Example

1. Define your function and apply the `@positron_sync` decorator with the necessary parameters:

```python
from positron-networks import positron_sync

@positron_sync(
    funding_group='your_funding_group_id',
    image_name='your_image_name',
    environment_id='your_environment_id',
    workspace_dir='your_workspace_dir',
    entry_point='your_entry_point_script'
)
def my_function():
    print("Running my function")

if __name__ == "__main__":
    my_function()
```

2. Run your script with the desired arguments:

```bash
python your_script.py --positron-deploy --stream-stdout
```

## Configuration

Ensure you have a configuration file located at `~/.positron/config.ini` with the following structure:

```ini
[DEFAULT]
UserAuthToken=your_user_auth_token
```

## Detailed Error Messages

To enable detailed error messages, run your script with the `--debug` flag:

```bash
python your_script.py --positron-deploy --debug
```

## Handling Interruptions

The script handles `SIGINT` (Ctrl+C) gracefully, allowing for proper cleanup and exit.

## License

This project is licensed under the Apache 2 License. See the [LICENSE](LICENSE) file for details.
