Metadata-Version: 2.1
Name: simulate365py
Version: 1.0.0
Summary: Client for Simulate 365 Dispatcher
Home-page: UNKNOWN
Author: CGC Capital-Gain Consultants GmbH
License: CGC EULA
Platform: UNKNOWN
Description-Content-Type: text/markdown

*Simulate365Py* is a web-based library designed to access and calculate DWSIM flowsheets from the browser. 

* **Website:** https://simulate365.com/
* **Documentation:** https://simulate365.com/docs/simulate365py/
* **Support:** https://support.capital-gain.eu/

## Installation

Install package by running `pip install simulate365py`

## Quick Start

In order to use this library with a DWSIM flowsheet, you need access to the Simulate 365 Dashboard.
1. Sign up via https://simulate365.com/registration/ and activate your account 
2. Access the Simulate 365 Dashboard on https://dashboard.simulate365.com/
3.	 Upload your DWSIM flowsheet and follow the documentation on https://simulate365.com/docs/simulate365py/ 
4. Run the flowsheet calculation in your Python script

# Example

```
import time
from simulate365py import DispatcherClient, NewJobFromFilterPostModel, JobProcessingStatus

client = DispatcherClient("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")                    
filter_unique_id = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

post_model = NewJobFromFilterPostModel(
    filter_unique_id,
    {
        "N_stages": 25, # Number of stages
        "RD": 3 # Reflux ratio
    }
)

job_id = client.submit_job_from_filter(post_model)
print("Submitted job with ID: " + str(job_id))

while True: # Prints the status of the submitted job
    result = client.get_job_results(job_id)    

    if (result.processing_status != JobProcessingStatus.NotCalculated):
        if (result.processing_status == JobProcessingStatus.Failed):
            print("Job calculation failed. Error message is: \r\n" +  result.error)            
        else:
            print("Received result for job #" + str(job_id))
            for p in result.output_parameters:
                print(p.alias + " = " + str(p.value) + " " + p.unit)
        break

```

