# 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="/files/Fmd85ye7b8niVgqSSv78" alt=""><figcaption><p>Demo one network</p></figcaption></figure>

First click the download button.

<figure><img src="/files/NiySs27ywPA5s0VzJZWW" alt="" width="213"><figcaption><p>Click the download button</p></figcaption></figure>

Then, we are going to choose our format.

<figure><img src="/files/Y276a6X0CzpljVwUMJ8J" 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="/files/vlzd2Nb6XMYgJ6PXZ0Xh" alt="" width="375"><figcaption><p>Select these functions according to your needs</p></figcaption></figure>

Submit it.

<figure><img src="/files/B7pUEHj8slwGkG6XG1JI" alt="" width="375"><figcaption><p>Click to submit</p></figcaption></figure>

Next, download the Pywr JSON format.

<figure><img src="/files/8Seefp9jJ8xaQaM70y4j" 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="/files/zyJZxfEiQVHZlhswUIom" 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="/files/CpxtO8TfpJl7dgbFiZ0Z" alt=""><figcaption><p>Create a project</p></figcaption></figure>

Name the project and click 'Add'.

<figure><img src="/files/dSGiDG0GOdJVT8vhk5xc" alt=""><figcaption><p>Name the project and click 'Add'</p></figcaption></figure>

Click the created project.

<figure><img src="/files/mak10puM4oRJOfrclOrF" alt=""><figcaption><p>Click the created project</p></figcaption></figure>

Click 'Create Network'.

<figure><img src="/files/jIboXUChoiojD741JYsO" alt=""><figcaption><p>Click 'Create Network'</p></figcaption></figure>

Select 'Hydra JSON'.

<figure><img src="/files/U3tQAYkUSedDDVNEvPYT" alt="" width="375"><figcaption><p>Select 'Hydra JSON'</p></figcaption></figure>

Click 'Choose File'.

<figure><img src="/files/eBCHdLGN8RNANcOGBlxH" alt="" width="375"><figcaption><p>Click 'Choose File'</p></figcaption></figure>

Choose the Hydra JSON file.

<figure><img src="/files/8xdC96hDWTjY1UFHhDBl" alt=""><figcaption><p>Choose the Hydra JSON file</p></figcaption></figure>

Select the template.

<figure><img src="/files/b6YTcbkMecQ91ILOir2V" alt="" width="375"><figcaption><p>Select the template</p></figcaption></figure>

Click 'Submit'.

<figure><img src="/files/2329ajFPFdGbfJHVY2cb" alt="" width="375"><figcaption><p>Click 'Submit'</p></figcaption></figure>

Then, you can find the network is imported.

<figure><img src="/files/XMtKAjpTDPTkm74FnZYG" 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="/files/ksMgxzNRVwlp30PZsCzX" alt=""><figcaption><p>Click 'Create Network'</p></figcaption></figure>

Choose the 'Pywr JSON'.

<figure><img src="/files/5XMKcFjSyotoU5y8NrFa" alt="" width="370"><figcaption><p>Choose the 'Pywr JSON'</p></figcaption></figure>

Click 'Choose File'.

<figure><img src="/files/ODUk7hxXC8Qt9bIcB3YW" alt="" width="375"><figcaption><p>Click 'Choose File'</p></figcaption></figure>

Choose the Pywr JSON file.

<figure><img src="/files/2y3WE9OLELE9p3sr8WIG" alt=""><figcaption><p>Choose the Pywr JSON file</p></figcaption></figure>

Choose the template.

<figure><img src="/files/Lz7MAxgMMGtRXxc65Pwm" 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="/files/KFlQAxr0tCSU2bxSefOq" alt="" width="375"><figcaption><p>Choose the projection</p></figcaption></figure>

Click 'Submit'.

<figure><img src="/files/nV5EYk1HTE5pW4Bm1AEm" alt="" width="375"><figcaption><p>Click 'Submit'</p></figcaption></figure>

Finally, you can the imported network here.

<figure><img src="/files/Frso3zpWIGCpfh3YUUrC" alt=""><figcaption><p>The imported network</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://water-strategy.gitbook.io/waterstrategy/getting-started/exporting-and-importing-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
