From 72d6e82d4d86c017db4085b3f82ec295ea650b46 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 23 Oct 2017 21:42:54 -0700 Subject: [PATCH] Docs --- templates/doc.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/doc.md b/templates/doc.md index e303e23..07fbf7a 100644 --- a/templates/doc.md +++ b/templates/doc.md @@ -15,25 +15,25 @@ Arbitrary 3D structures can be constructed by rotating the grid. The URL contains a unique ID such as `oranges-arkansas-mexico-fish`. You can share this URL with other people to share your screen and edit collaboratively. ## Python package -The underlying graph state simulator is based on Anders' and Briegel's method. Full docs for the Python package are [here](https://peteshadbolt.co.uk/static/abp/). +The underlying graph state simulator is based on Anders' and Briegel's method. Full docs for the Python package are [here](https://peteshadbolt.co.uk/static/abp/). You can install it like this: + + :::bash + pip install abp + ## API Here's a complete example of sending a state from Python to the server: :::python - import requests, json, abp + import abp - # Make a new graph and position the nodes + # Make a new graph and automatically position the nodes g = abp.NXGraphState(range(10)) g.layout() - # Serialize - data = json.dumps(test_graph().to_json()) - # Post to the server - URL = "https://abv.peteshadbolt.co.uk/oranges-arkansas-mexico-fish" - requests.post("{}/graph".format(URL), data=data) + g.push() ### Endpoints