# Exporting and Importing Models

WaterStrategy isn't required to run a Pywr model; it is there to help make it easier to use Pywr models. If you have a Pywr model input file (they are called 'JSON' files), and you have the required Python and Pywr libraries installed on your computer, you can run your Pywr model without WaterStrategy (Note: Python skills are required). Equally, if you have an existing Pywr model (a JSON file), you can import it into WaterStrategy.

This page shows how to export models from WaterStrategy into a Pywr JSON files and how to import existing Pywr models (JSON files) into WaterStrategy

{% embed url="https://www.youtube.com/watch?v=g85GWm-qPOA" %}
Video showing how to export and import Pywr JSON files into Water Strategy
{% endembed %}

## Exporting and Importing Models

### Export Pywr files

This section uses the 'demo one network' provided when you create an account.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FuLvZ6RofPisBSOOiBwGT%2Fimage.png?alt=media&#x26;token=c749c126-80f8-49f1-ba0d-0a356847b4f3" alt=""><figcaption><p>Demo one network</p></figcaption></figure>

First click the download button.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2Fe0O2OO1iIDEtiy3ZR8B3%2Fimage.png?alt=media&#x26;token=a2877f4a-58d3-4110-bf26-0c3553d1488f" alt="" width="213"><figcaption><p>Click the download button</p></figcaption></figure>

Then, we are going to choose our format.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FZu6kjIfdqKIpX21KpAdb%2Fimage.png?alt=media&#x26;token=5b3f6455-b438-4a0f-be57-3daffab36337" alt="" width="266"><figcaption><p>Choose the Hydra JSON format</p></figcaption></figure>

Choose the Hydra JSON  format first. If you want to enable line breaks that makes your code or text easier to read. If it's a large file you can zip it.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FlobH6nlzSiSvUD1htKXI%2Fimage.png?alt=media&#x26;token=2199bc69-fdc1-4d24-9cc6-e9e363ae2898" alt="" width="375"><figcaption><p>Select these functions according to your needs</p></figcaption></figure>

Submit it.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2F5tHtpkIj999lfk3DHfMh%2Fimage.png?alt=media&#x26;token=9b434456-783c-4199-8fc1-db22f639fda4" alt="" width="375"><figcaption><p>Click to submit</p></figcaption></figure>

Next, download the Pywr JSON format.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FtyWZLWwI6RmWG5jqA5YF%2Fimage.png?alt=media&#x26;token=faf0edb6-e81f-4c20-934a-4e0d0daf03ca" alt="" width="264"><figcaption><p>Download the Pywr JSON</p></figcaption></figure>

Then, you can find the two files in the folder you chose to save them in.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FENg7zTg1l9GjYpIcppMW%2Fimage.png?alt=media&#x26;token=ef05498a-ef3e-4db0-a603-7eed69387161" alt="" width="375"><figcaption><p>Pywr files in the folder</p></figcaption></figure>

### Import Pywr files

Let's see how to import Pywr files.

First, click the 'Create Project' to create a project folder in your Water Strategy account.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FWhXrFbVj16orGzhH6oh1%2Fimage.png?alt=media&#x26;token=37a1a101-e6a4-4e02-a00a-c8c268894810" alt=""><figcaption><p>Create a project</p></figcaption></figure>

Name the project and click 'Add'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FxOMfct1CCyc6Xl64NlOF%2Fimage.png?alt=media&#x26;token=4c53514d-2101-4337-a184-8ae49c8d1229" alt=""><figcaption><p>Name the project and click 'Add'</p></figcaption></figure>

Click the created project.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2F7OgT1PaMTO5rXYZu4Zy1%2Fimage.png?alt=media&#x26;token=99403167-c556-436c-881a-18290da4a7e3" alt=""><figcaption><p>Click the created project</p></figcaption></figure>

Click 'Create Network'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2Fo1syAC5u5pPu0IvfSZWd%2Fimage.png?alt=media&#x26;token=6a6ff224-5416-4936-a7a6-9290806e7ea2" alt=""><figcaption><p>Click 'Create Network'</p></figcaption></figure>

Select 'Hydra JSON'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FbTRtLOzjOALhF6RwHNDD%2Fimage.png?alt=media&#x26;token=81b68f65-7d62-443f-b522-c3d664048666" alt="" width="375"><figcaption><p>Select 'Hydra JSON'</p></figcaption></figure>

Click 'Choose File'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FzBuPustpghlCuUy5iMDz%2Fimage.png?alt=media&#x26;token=96149bb1-2ae2-4d4b-a7a3-a58ba9a793da" alt="" width="375"><figcaption><p>Click 'Choose File'</p></figcaption></figure>

Choose the Hydra JSON file.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2Fkuc6Pm4qWNZAMUFCq3fS%2Fimage.png?alt=media&#x26;token=249179d4-e2f8-4c9e-aacb-620276cea709" alt=""><figcaption><p>Choose the Hydra JSON file</p></figcaption></figure>

Select the template.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2F8Ls96KYjGWcVu5yZSwER%2Fimage.png?alt=media&#x26;token=1a14c005-c10e-4cc3-9063-e163c292c6ed" alt="" width="375"><figcaption><p>Select the template</p></figcaption></figure>

Click 'Submit'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FYY48rDSUHHWX9fOE0pxe%2Fimage.png?alt=media&#x26;token=2aaa6652-79e1-447a-a57c-54e3c4648dd1" alt="" width="375"><figcaption><p>Click 'Submit'</p></figcaption></figure>

Then, you can find the network is imported.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FmNGSNtHyV9o5xg8ylins%2Fimage.png?alt=media&#x26;token=25626f92-14d4-4c29-8f85-048cc7479b52" alt="" width="375"><figcaption><p>Network has been imported</p></figcaption></figure>

To import the Pywr JSON file, you can follow these steps.

Click 'Create Network' again.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FcpdIqwvSGxJLwj4yqfRF%2Fimage.png?alt=media&#x26;token=e586c6e4-001c-4c42-b9d4-3df3276ecf6e" alt=""><figcaption><p>Click 'Create Network'</p></figcaption></figure>

Choose the 'Pywr JSON'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FcEHJwCYy47yFPjEDcdJY%2Fimage.png?alt=media&#x26;token=ee11dbb5-2de7-464c-9d89-0b8530794412" alt="" width="370"><figcaption><p>Choose the 'Pywr JSON'</p></figcaption></figure>

Click 'Choose File'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FeXqfyPeZNWdOSoCVDwIq%2Fimage.png?alt=media&#x26;token=2e456c30-068f-4c1d-9fa6-1c1e4188a110" alt="" width="375"><figcaption><p>Click 'Choose File'</p></figcaption></figure>

Choose the Pywr JSON file.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FlRqo1bBgNNzfMVpAuQI6%2Fimage.png?alt=media&#x26;token=638376ba-3f5b-4b66-b110-39b9d4b455d4" alt=""><figcaption><p>Choose the Pywr JSON file</p></figcaption></figure>

Choose the template.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FeWz8FtxbfSsD3YcGBF6I%2Fimage.png?alt=media&#x26;token=e62d4c42-038b-4a9b-a7fb-fedc2c141b27" alt="" width="369"><figcaption><p>Choose the template</p></figcaption></figure>

For projection, you can choose 'None', 'UK', or 'World'. In this case, we will choose the 'World'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FyEfwyXCGIYV1jOo30iZc%2Fimage.png?alt=media&#x26;token=5e149edd-a2a8-418c-92af-6cbb6837610e" alt="" width="375"><figcaption><p>Choose the projection</p></figcaption></figure>

Click 'Submit'.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FRG3cMW0qbuQPazs9667a%2Fimage.png?alt=media&#x26;token=7498fb07-2681-43cd-b2d2-2204d7ad61eb" alt="" width="375"><figcaption><p>Click 'Submit'</p></figcaption></figure>

Finally, you can the imported network here.

<figure><img src="https://2363830371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODCd8VK2OOl9jOdp5KFf%2Fuploads%2FqlC62ThfXcDAOuHRq0HH%2Fimage.png?alt=media&#x26;token=fe1c1466-d82f-4e1a-8e96-62405eaedc97" alt=""><figcaption><p>The imported network</p></figcaption></figure>
