From 6f1ab52aa5a465837151f9a3487bd3c1402f07dc Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Fri, 3 Nov 2017 14:22:15 -0400 Subject: [PATCH] Update Jupyter Notebook documentation --- docs/guide/custom.ipynb | 111 ++++++------------------------------ docs/guide/ts_support.ipynb | 13 ++++- 2 files changed, 29 insertions(+), 95 deletions(-) diff --git a/docs/guide/custom.ipynb b/docs/guide/custom.ipynb index 2254fa8..48b9ffe 100644 --- a/docs/guide/custom.ipynb +++ b/docs/guide/custom.ipynb @@ -99,101 +99,28 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { - "data": { - "text/html": [ - "
{\n",
-       "    "x_foo": "bar",\n",
-       "    "type": "identity",\n",
-       "    "id": "identity--8d7f0697-e589-4e3b-aa57-cae798d2d138",\n",
-       "    "created": "2017-09-26T21:02:19.465Z",\n",
-       "    "modified": "2017-09-26T21:02:19.465Z",\n",
-       "    "name": "John Smith",\n",
-       "    "identity_class": "individual"\n",
-       "}\n",
-       "
\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n", + " \"type\": \"identity\",\n", + " \"id\": \"identity--10761df2-93f6-4eb4-9d02-4fccfe5dc91d\",\n", + " \"created\": \"2017-11-03T18:20:48.145Z\",\n", + " \"modified\": \"2017-11-03T18:20:48.145Z\",\n", + " \"name\": \"John Smith\",\n", + " \"identity_class\": \"individual\",\n", + " \"x_foo\": \"bar\"\n", + "}\n" + ] } ], "source": [ + "from stix2 import Identity\n", + "\n", "identity = Identity(name=\"John Smith\",\n", " identity_class=\"individual\",\n", " custom_properties={\n", @@ -923,14 +850,14 @@ "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.12" + "pygments_lexer": "ipython3", + "version": "3.5.2" } }, "nbformat": 4, diff --git a/docs/guide/ts_support.ipynb b/docs/guide/ts_support.ipynb index f98d7b5..0c03548 100644 --- a/docs/guide/ts_support.ipynb +++ b/docs/guide/ts_support.ipynb @@ -114,7 +114,6 @@ "import stix2\n", "\n", "stix2.v20.Indicator()\n", - "\n", "stix2.v21.Indicator()" ] }, @@ -169,9 +168,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n \"type\": \"indicator\",\n \"id\": \"indicator--dbcbd659-c927-4f9a-994f-0a2632274394\",\n \"created\": \"2017-09-26T23:33:39.829Z\",\n \"modified\": \"2017-09-26T23:33:39.829Z\",\n \"name\": \"File hash for malware variant\",\n \"pattern\": \"[file:hashes.md5 = 'd41d8cd98f00b204e9800998ecf8427e']\",\n \"valid_from\": \"2017-09-26T23:33:39.829952Z\",\n \"labels\": [\n \"malicious-activity\"\n ]\n}\n" + ] + } + ], "source": [ "from stix2 import parse\n", "\n",