diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d59a85c..f98bb50 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -63,9 +63,14 @@ jobs: docker network create my-network - # Start Neo4j if we are testing chapter 10 + # Start Neo4j and JanusGraph if we are testing chapter 10 if [ "${{ matrix.chapter.name }}" == "chap10" ]; then + docker run --rm --detach --name janusgraph \ + --publish=8182:8182 \ + janusgraph/janusgraph:1.1.0 + docker network connect my-network janusgraph + docker run --rm --detach --name neo4j \ --publish=7474:7474 --publish=7687:7687 \ --user="$(id -u):$(id -g)" \ @@ -83,10 +88,16 @@ jobs: --env KAGGLE_USERNAME=${KAGGLE_USERNAME} \ --env KAGGLE_KEY=${KAGGLE_TOKEN} \ --env NEO4J_HOST=neo4j \ + --env JANUSGRAPH_HOST=janusgraph \ graph-machine-learning:latest docker network connect my-network graph-machine-learning-box # Run tests cd docker - ./tests.sh ${{ matrix.chapter.folder }} \ No newline at end of file + ./tests.sh ${{ matrix.chapter.folder }} + + - name: tmate session if tests fail + if: failure() && github.event_name == 'workflow_dispatch' + uses: mxschmitt/action-tmate@v3 + \ No newline at end of file diff --git a/Chapter10/00_Data_Conversion.ipynb b/Chapter10/00_Data_Conversion.ipynb new file mode 100644 index 0000000..b1db067 --- /dev/null +++ b/Chapter10/00_Data_Conversion.ipynb @@ -0,0 +1,305 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "750472d1-ddd0-4a69-914c-77ac2ee9025c", + "metadata": {}, + "source": [ + "# Data conversion" + ] + }, + { + "cell_type": "markdown", + "id": "551da007-54e2-43b4-aad4-1ee33330510e", + "metadata": {}, + "source": [ + "This script allows the data conversion of the Cypher query to import the Movie dataset into Neo4j into two dataframes (nodes, and edges) that are imported in JanusGraph." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "2afbf7aa-8903-4f0a-b622-2ed8ff947dfa", + "metadata": {}, + "outputs": [], + "source": [ + "with open(\"movieCreationQuery.txt\", \"r\") as fid:\n", + " lines = fid.readlines()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "b7e2b1d6-260b-4c51-aa50-8ce7573b7563", + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "\n", + "is_edge_regex = re.compile(\"\\[.*\\]\")\n", + "\n", + "def is_edge(line):\n", + " if is_edge_regex.search(line):\n", + " return True\n", + " return False\n", + "\n", + "is_valid_regex = re.compile(\"\\(.*\\)\")\n", + "\n", + "def is_valid(line):\n", + " if is_valid_regex.search(line):\n", + " return True\n", + " return False " + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "e2eb2bcc-ca2a-4204-95a0-55073ac6148d", + "metadata": {}, + "outputs": [], + "source": [ + "import json \n", + "\n", + "def dict_serializer(input_dict):\n", + " return {\n", + " k: json.dumps(v) if isinstance(v, dict) or isinstance(v, list) else v\n", + " for k, v in input_dict.items()\n", + " }\n", + "\n", + "single_quote_parser = lambda props: dict_serializer(json.loads(re.sub(\"(\\w+):\", r\"'\\1':\", props).replace(\"'\",\"\\\"\")))\n", + "double_quote_parser = lambda props: dict_serializer(json.loads(re.sub(\"(\\w+):\", r'\"\\1\":', props)))" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "12620971-08dd-4eb2-98f9-a351e44e412d", + "metadata": {}, + "outputs": [], + "source": [ + "from dataclasses import dataclass\n", + "\n", + "@dataclass\n", + "class Node:\n", + " id: str\n", + " label: str\n", + " props: dict\n", + "\n", + "@dataclass\n", + "class Edge:\n", + " id: tuple[str, str]\n", + " label: str\n", + " props: dict\n", + "\n", + "node_regex = re.compile(r'.*\\((\\w*):(\\w*).*({.*})\\).*')\n", + "\n", + "def parse_node_line(line):\n", + "\n", + " name, label, props = node_regex.match(line).groups()\n", + "\n", + " parser = double_quote_parser if '\"' in props else single_quote_parser\n", + "\n", + " return Node(name, label, parser(props))\n", + "\n", + "edge_regex = re.compile(r'^[a-zA-Z\\s]*\\((\\w+)\\)-\\[:(\\w+) ({.*})\\]->\\((\\w+)\\).*')\n", + "edge_regex_noprop = re.compile(r'^[a-zA-Z\\s]*\\((\\w+)\\)-\\[:(\\w+)]->\\((\\w+)\\).*')\n", + "\n", + "def parse_edge_line(line):\n", + "\n", + " try:\n", + " source, rel_type, props, target = edge_regex.match(line).groups()\n", + " except:\n", + " source, rel_type, target = edge_regex_noprop.match(line).groups()\n", + " props=\"{}\"\n", + "\n", + " parser = double_quote_parser if '\"' in props else single_quote_parser\n", + "\n", + " return Edge((source, target), rel_type, parser(props))\n", + "\n", + "\n", + "def parse_line(line: str):\n", + " if not is_valid(line):\n", + " return None\n", + " \n", + " if is_edge(line):\n", + " return parse_edge_line(line)\n", + " return parse_node_line(line)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "bedf909d-1132-4be6-a4fc-ce8897e3bbae", + "metadata": {}, + "outputs": [], + "source": [ + "line=lines[18]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "2d0b79ff-d34b-43db-9e3f-ba7dcbabd85f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Edge(id=('Emil', 'TheMatrix'), label='ACTED_IN', props={'roles': '[\"Emil\"]'})" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "parse_line(line)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "f7b03500-8d09-4d41-9b3c-f07f91ce8f22", + "metadata": {}, + "outputs": [], + "source": [ + "parsed_outout = [parse_line(line) for line in lines]" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "147efe7d-6044-4711-be5c-caf4c5d65bda", + "metadata": {}, + "outputs": [], + "source": [ + "nodes = [item for item in parsed_outout if isinstance(item, Node)]\n", + "edges = [item for item in parsed_outout if isinstance(item, Edge)]" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "6bd3f299-569d-4661-a085-0b9a03dd9ede", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "171" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(nodes)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "e6190a56-e7f5-4682-b773-ca8fdb3fa46d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "254" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(edges)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "58b8e97a-a774-4d77-a261-aeea4a112bb8", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "368f624d-1f3a-42a8-b747-80d39ec71cae", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Node(id='TheMatrix', label='Movie', props={'title': 'The Matrix', 'released': 1999, 'tagline': 'Welcome to the Real World'}),\n", + " Node(id='Keanu', label='Person', props={'name': 'Keanu Reeves', 'born': 1964}),\n", + " Node(id='Carrie', label='Person', props={'name': 'Carrie-Anne Moss', 'born': 1967}),\n", + " Node(id='Laurence', label='Person', props={'name': 'Laurence Fishburne', 'born': 1961}),\n", + " Node(id='Hugo', label='Person', props={'name': 'Hugo Weaving', 'born': 1960}),\n", + " Node(id='LillyW', label='Person', props={'name': 'Lilly Wachowski', 'born': 1967}),\n", + " Node(id='LanaW', label='Person', props={'name': 'Lana Wachowski', 'born': 1965}),\n", + " Node(id='JoelS', label='Person', props={'name': 'Joel Silver', 'born': 1952}),\n", + " Node(id='Emil', label='Person', props={'name': 'Emil Eifrem', 'born': 1978}),\n", + " Node(id='TheMatrixReloaded', label='Movie', props={'title': 'The Matrix Reloaded', 'released': 2003, 'tagline': 'Free your mind'})]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nodes[:10]" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "ab66884a-5174-437c-91a2-d822366ba16b", + "metadata": {}, + "outputs": [], + "source": [ + "pd.DataFrame.from_records([{\"id\": node.id, \"label\": node.label, \"props\": node.props} for node in nodes]).set_index(\"id\").to_pickle(\"nodes.pkl\")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "188e259e-b56f-4c81-9a5a-a23f63ba1146", + "metadata": {}, + "outputs": [], + "source": [ + "pd.DataFrame.from_records([{\"id\": edge.id, \"label\": edge.label, \"props\": edge.props} for edge in edges]).set_index(\"id\").to_pickle(\"edges.pkl\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "chap10", + "language": "python", + "name": "chap10" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Chapter10/01_Neo4j_bindings.ipynb b/Chapter10/01_Neo4j_bindings.ipynb index 70cd536..ad3cd94 100644 --- a/Chapter10/01_Neo4j_bindings.ipynb +++ b/Chapter10/01_Neo4j_bindings.ipynb @@ -20,17 +20,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ - "with open(\"movieCreationQuery.txt\", \"rb\") as fid:\n", + "with open(\"./movieCreationQuery.txt\", \"rb\") as fid:\n", " lines = fid.readlines()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -39,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -61,7 +61,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -71,9 +71,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_1298248/469611421.py:2: DeprecationWarning: write_transaction has been renamed to execute_write\n", + " session.write_transaction(run_query, query)\n" + ] + } + ], "source": [ "with driver.session() as session:\n", " session.write_transaction(run_query, query)" @@ -88,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -97,9 +106,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_1298248/3167206639.py:2: DeprecationWarning: read_transaction has been renamed to execute_read\n", + " result = session.read_transaction(run_query, query)\n" + ] + }, + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "with driver.session() as session:\n", " result = session.read_transaction(run_query, query)\n", @@ -110,14 +138,585 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Delete" + "### Using `graphdatascience`" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/deusebio/.pyenv/versions/graph-machine-learning-310/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", + " from .autonotebook import tqdm as notebook_tqdm\n" + ] + } + ], + "source": [ + "import graphdatascience" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "from graphdatascience import GraphDataScience\n", + "\n", + "import os\n", + "host = os.environ.get(\"NEO4J_HOST\", \"localhost\")\n", + "\n", + "uri = f\"bolt://{host}:7687\"\n", + "gds = GraphDataScience(uri, auth=(\"neo4j\", \"neo5j\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
count(*)
0171
\n", + "
" + ], + "text/plain": [ + " count(*)\n", + "0 171" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gds.run_cypher(\"MATCH (n) RETURN count(*);\") " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Using the analytics capabilities of `graphdatascience`" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, "outputs": [], + "source": [ + "G = gds.graph.load_cora()" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
degreeDistributiongraphNamedatabasedatabaseLocationmemoryUsagesizeInBytesnodeCountrelationshipCountconfigurationdensitycreationTimemodificationTimeschemaschemaWithOrientation
0{'min': 0, 'max': 166, 'p90': 5, 'p999': 74, '...coraneo4jlocal34 MiB3568507827085429{'readConcurrency': 4, 'undirectedRelationship...0.0007412025-02-23T17:46:21.127305017+00:002025-02-23T17:46:21.127305017+00:00{'graphProperties': {}, 'nodes': {'Paper': {'s...{'graphProperties': {}, 'nodes': {'Paper': {'s...
\n", + "
" + ], + "text/plain": [ + " degreeDistribution graphName database \\\n", + "0 {'min': 0, 'max': 166, 'p90': 5, 'p999': 74, '... cora neo4j \n", + "\n", + " databaseLocation memoryUsage sizeInBytes nodeCount relationshipCount \\\n", + "0 local 34 MiB 35685078 2708 5429 \n", + "\n", + " configuration density \\\n", + "0 {'readConcurrency': 4, 'undirectedRelationship... 0.000741 \n", + "\n", + " creationTime modificationTime \\\n", + "0 2025-02-23T17:46:21.127305017+00:00 2025-02-23T17:46:21.127305017+00:00 \n", + "\n", + " schema \\\n", + "0 {'graphProperties': {}, 'nodes': {'Paper': {'s... \n", + "\n", + " schemaWithOrientation \n", + "0 {'graphProperties': {}, 'nodes': {'Paper': {'s... " + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gds.graph.list()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "G=gds.graph.get(\"cora\")" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Paper [subject, features]\n", + "dtype: object" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "G.node_properties()" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
nodeIdpropertyValuenodeLabels
0313360[]
110611271[]
211064062[]
3131952[]
4378793[]
............
270311289755[]
270411289775[]
270511289785[]
27061173286[]
2707240430[]
\n", + "

2708 rows × 3 columns

\n", + "
" + ], + "text/plain": [ + " nodeId propertyValue nodeLabels\n", + "0 31336 0 []\n", + "1 1061127 1 []\n", + "2 1106406 2 []\n", + "3 13195 2 []\n", + "4 37879 3 []\n", + "... ... ... ...\n", + "2703 1128975 5 []\n", + "2704 1128977 5 []\n", + "2705 1128978 5 []\n", + "2706 117328 6 []\n", + "2707 24043 0 []\n", + "\n", + "[2708 rows x 3 columns]" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gds.graph.nodeProperty.stream(gds.graph.get(\"cora\"), node_property=\"subject\")" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "pr_result = gds.pageRank.mutate(G, mutateProperty=\"pagerank\")" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Compute millis: 23\n", + "Node properties written: 2708\n", + "Centrality distribution: {'min': 0.14999961853027344, 'max': 3.5378417968749996, 'p90': 0.4555196762084961, 'p999': 2.6002798080444336, 'p99': 1.5071401596069336, 'p50': 0.21511173248291016, 'p75': 0.3093576431274414, 'p95': 0.6003026962280273, 'mean': 0.2869838661069884}\n" + ] + } + ], + "source": [ + "print(f\"Compute millis: {pr_result['computeMillis']}\")\n", + "print(f\"Node properties written: {pr_result['nodePropertiesWritten']}\")\n", + "print(f\"Centrality distribution: {pr_result['centralityDistribution']}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Paper [pagerank, subject, features]\n", + "dtype: object" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "G.node_properties()" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
nodeIdpagerank
0350.203022
1400.168341
21140.150000
31170.150000
41280.184487
.........
270311545000.161591
270411545200.168214
270511545240.307409
270611545250.248215
270711550730.601702
\n", + "

2708 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " nodeId pagerank\n", + "0 35 0.203022\n", + "1 40 0.168341\n", + "2 114 0.150000\n", + "3 117 0.150000\n", + "4 128 0.184487\n", + "... ... ...\n", + "2703 1154500 0.161591\n", + "2704 1154520 0.168214\n", + "2705 1154524 0.307409\n", + "2706 1154525 0.248215\n", + "2707 1155073 0.601702\n", + "\n", + "[2708 rows x 2 columns]" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gds.graph.nodeProperties.stream(G, [\"pagerank\"], separate_property_columns=True)\n", + "# gds.graph.nodeProperties.write(G, [\"pagerank\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Delete datasets" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "graphName cora\n", + "database neo4j\n", + "databaseLocation local\n", + "memoryUsage \n", + "sizeInBytes -1\n", + "nodeCount 2708\n", + "relationshipCount 5429\n", + "configuration {'readConcurrency': 4, 'undirectedRelationship...\n", + "density 0.000741\n", + "creationTime 2025-02-23T17:46:21.127305017+00:00\n", + "modificationTime 2025-02-23T17:46:21.352154457+00:00\n", + "schema {'graphProperties': {}, 'nodes': {'Paper': {'p...\n", + "schemaWithOrientation {'graphProperties': {}, 'nodes': {'Paper': {'p...\n", + "Name: 0, dtype: object" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gds.graph.drop(\"cora\")" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_1298248/1407641033.py:2: DeprecationWarning: write_transaction has been renamed to execute_write\n", + " result = session.write_transaction(run_query, \"MATCH (n)-[e]-() DELETE n, e\")\n" + ] + } + ], "source": [ "with driver.session() as session:\n", " result = session.write_transaction(run_query, \"MATCH (n)-[e]-() DELETE n, e\")" diff --git a/Chapter10/02_JanusGraph_Gremlin.ipynb b/Chapter10/02_JanusGraph_Gremlin.ipynb new file mode 100644 index 0000000..6b4e3bc --- /dev/null +++ b/Chapter10/02_JanusGraph_Gremlin.ipynb @@ -0,0 +1,1081 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "418dbae3-2817-4b04-b99d-50b1c67968fa", + "metadata": {}, + "source": [ + "# JanusGraph and Gremlin queries" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "4e2325c8-72ce-43f6-bcd0-e6bb681ee386", + "metadata": {}, + "outputs": [], + "source": [ + "from gremlin_python import statics\n", + "from gremlin_python.structure.graph import Graph\n", + "from gremlin_python.process.graph_traversal import __\n", + "from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection\n", + "from gremlin_python.driver.serializer import GraphSONSerializersV3d0" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "caa8be3b-c448-4918-a531-6072a23e1c14", + "metadata": {}, + "outputs": [], + "source": [ + "import nest_asyncio\n", + "nest_asyncio.apply()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "ed4de73d-e4bc-45e5-bf9a-7abfc090c7e1", + "metadata": {}, + "outputs": [], + "source": [ + "from gremlin_python.process.anonymous_traversal import traversal\n", + "\n", + "import os\n", + "host = os.environ.get(\"JANUSGRAPH_HOST\", \"localhost\")\n", + "\n", + "connection = DriverRemoteConnection(f\"ws://{host}:8182/gremlin\", \"g\", message_serializer=GraphSONSerializersV3d0())" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "1b6aeb8c-6a8e-4866-b49c-1ed6cdc373be", + "metadata": {}, + "outputs": [], + "source": [ + "graph = Graph()\n", + "g = graph.traversal().withRemote(connection)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "d1e5e05a-b09a-444e-ad7e-3de685ea10be", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "v[8272]" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.addV('student').property('name', 'Jeffery').property('GPA', 4.0).next()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "db401998-d513-4097-8c8a-2d74c4eeddc9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "v[4304]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.addV('student').property('name', 'Robert').property('GPA', 3.0).next()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "d4e5e347-0298-46a6-9d13-971b66bd7211", + "metadata": {}, + "outputs": [], + "source": [ + "v1, v2 = g.V().to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "cedea689-8e8e-424b-b935-c2422f2037e9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "v[8272]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v1" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "e3fdf108-b8f1-48d7-84aa-4f6f333ceedf", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "v[4304]" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v2" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "345de3a5-59d2-4710-aaf7-f8923d25531c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "e[{'@type': 'janusgraph:RelationIdentifier', '@value': {'relationId': '3yi-6ds-36d-3bk'}}][8272-FRIEND_OF->4304]" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.addE(\"FRIEND_OF\").from_(v1).to(v2).property(\"since\", \"2014\").next()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "4aebd7dc-da82-42d3-ba52-877c258cfa65", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['addV', 'student'], ['property', 'name', 'Claire'], ['property', 'GPA', 3.9], ['as', 'n1'], ['addV', 'student'], ['property', 'name', 'Lisa'], ['property', 'GPA', 3.6], ['as', 'n2'], ['addE', 'FRIEND_OF'], ['from', 'n1'], ['to', 'n2'], ['property', 'since', '2014'], ['none'], ['values', '_ipython_canary_method_should_not_exist_'], ['values', '_ipython_canary_method_should_not_exist_']]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g\\\n", + " .addV('student').property('name', 'Claire').property('GPA', 3.9).as_(\"n1\")\\\n", + " .addV('student').property('name', 'Lisa').property('GPA', 3.6).as_(\"n2\")\\\n", + " .addE(\"FRIEND_OF\").from_(\"n1\").to(\"n2\").property(\"since\", \"2014\")\\\n", + " .iterate()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "6f454c96-9775-4469-b0ea-596dde823e0c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[v[8272], v[4304], v[8400], v[8416]]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "607a9c7c-4f9f-4921-baeb-aada093976c6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[e[{'@type': 'janusgraph:RelationIdentifier', '@value': {'relationId': '3yi-6ds-36d-3bk'}}][8272-FRIEND_OF->4304],\n", + " e[{'@type': 'janusgraph:RelationIdentifier', '@value': {'relationId': '3kq-6hc-36d-6hs'}}][8400-FRIEND_OF->8416]]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.E().to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "49fc830c-c265-4643-8ed2-6c83b4a64af9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().drop().to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "b0f36ccb-5c18-4045-903a-3ee0b90b5d1a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.E().drop().to_list()" + ] + }, + { + "cell_type": "markdown", + "id": "2d054308-1549-4642-a7f5-012f19bc27f3", + "metadata": {}, + "source": [ + "### Import Karate Club Graph " + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "deeb8022-6d3f-4724-8420-621282b6aa87", + "metadata": {}, + "outputs": [], + "source": [ + "import networkx" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "bad6ce27-f43d-45bf-932a-3cdf93b2bf53", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "f6388ad9-0952-444e-92f2-2ddc9560140f", + "metadata": {}, + "outputs": [], + "source": [ + "nodes = networkx.karate_club_graph().nodes\n", + "nodes = pd.DataFrame.from_records([{\"id\": node} | nodes[node] for node in nodes]).set_index(\"id\")" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "61d75876-548e-4c5c-9561-ee948b620442", + "metadata": {}, + "outputs": [], + "source": [ + "edges = networkx.karate_club_graph().edges\n", + "edges = pd.DataFrame.from_records([{\"id\": edge} | edges[edge] for edge in edges]).set_index(\"id\")" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "bd84322d-76d1-4fa1-845b-c04987df595e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
club
id
0Mr. Hi
1Mr. Hi
2Mr. Hi
3Mr. Hi
4Mr. Hi
\n", + "
" + ], + "text/plain": [ + " club\n", + "id \n", + "0 Mr. Hi\n", + "1 Mr. Hi\n", + "2 Mr. Hi\n", + "3 Mr. Hi\n", + "4 Mr. Hi" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nodes.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "04f5f159-3796-4e35-9960-8452fad83a2f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
weight
id
(0, 1)4
(0, 2)5
(0, 3)3
(0, 4)3
(0, 5)3
\n", + "
" + ], + "text/plain": [ + " weight\n", + "id \n", + "(0, 1) 4\n", + "(0, 2) 5\n", + "(0, 3) 3\n", + "(0, 4) 3\n", + "(0, 5) 3" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "edges.head()" + ] + }, + { + "cell_type": "markdown", + "id": "64ed31a0-8938-45ab-8f53-6a37271e5788", + "metadata": {}, + "source": [ + "Graph Generation " + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "478cd590-89e9-4cf3-b82d-ac4d1d743856", + "metadata": {}, + "outputs": [], + "source": [ + "from gremlin_python.process.graph_traversal import GraphTraversalSource" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "1f6351f5-91fc-40d5-bc30-177796e36a91", + "metadata": {}, + "outputs": [], + "source": [ + "from functools import reduce\n", + "\n", + "def build_node_query(agg: GraphTraversalSource, id: str, label: str, properties:dict):\n", + " id_str = str(id)\n", + " agg = agg.add_v(label).property(\"id\", id_str)\n", + " for k, v in properties.items():\n", + " agg.property(k, v)\n", + " return agg.as_(f\"n_{id_str}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "e3ebf002-2965-4049-bc22-4b326bd10b5f", + "metadata": {}, + "outputs": [], + "source": [ + "def build_edge_query(agg: GraphTraversalSource, id: tuple[str,str], label: str, properties:dict):\n", + " source_str = str(id[0])\n", + " target_str = str(id[1])\n", + " edge = agg\\\n", + " .V().has(\"id\", str(source_str)).as_(\"source\")\\\n", + " .V().has(\"id\", str(target_str)).as_(\"target\")\\\n", + " .addE(label).from_(\"source\").to(\"target\")\n", + " for k, v in properties.items():\n", + " edge.property(k, v)\n", + " return edge.as_(f\"edge_{source_str}_{target_str}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "676a24c7-139b-4622-9316-4c531cbfb73c", + "metadata": {}, + "outputs": [], + "source": [ + "_ = reduce(lambda g, node: build_node_query(g, node[0], \"Person\", node[1].to_dict()), nodes.iterrows(), g).iterate()" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "9b9367df-bbab-4d44-b9d5-e504751e21bf", + "metadata": {}, + "outputs": [], + "source": [ + "_ = reduce(lambda g, edge: build_edge_query(g, edge[0], \"FRIEND_OF\", edge[1].to_dict()), edges.iterrows(), g).iterate()" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "6395d565-a5df-4c77-a68b-c8c5e7b26203", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "11" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().has(\"club\", \"Mr. Hi\").out(\"FRIEND_OF\").has(\"club\", 'Officer').count().next()" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "21d5c7bd-dfaa-4dbf-a1b0-25b957c32f11", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['30', '30', '33', '33', '33', '31', '9', '27', '28', '32', '32']" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().has(\"club\", \"Mr. Hi\").out(\"FRIEND_OF\").has(\"club\", 'Officer').values(\"id\").to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "220ef136-3740-4101-b9f4-ca698343a9de", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['2', '2', '2', '2', '8', '8', '8', '0', '1', '13', '19']" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().has(\"club\", \"Officer\").in_(\"FRIEND_OF\").has(\"club\", 'Mr. Hi').values(\"id\").to_list()" + ] + }, + { + "cell_type": "markdown", + "id": "cac322ee-de5f-47da-8c24-1b27c3fc89c8", + "metadata": {}, + "source": [ + "### Drop databases" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "021e1a57-abe0-4db0-a8b8-a3cfc033e448", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().drop().to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "ffc6f2bf-ff3b-4bee-a2e6-65cb2df61fdb", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.E().drop().to_list()" + ] + }, + { + "cell_type": "markdown", + "id": "7b3deb6d-6893-4bd5-8be3-87d3c2e49d27", + "metadata": {}, + "source": [ + "### Import Movie Graph" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "25a310ff-10cb-4eaa-9677-4aa91f96d0c2", + "metadata": {}, + "outputs": [], + "source": [ + "nodes = pd.read_pickle(\"nodes.pkl\")" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "f3c0e8d7-d837-4e1a-8369-81aebc0924f4", + "metadata": {}, + "outputs": [], + "source": [ + "edges = pd.read_pickle(\"edges.pkl\")" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "28289b7d-b281-493b-a231-557c012edbc3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
labelprops
id
TheMatrixMovie{'title': 'The Matrix', 'released': 1999, 'tag...
KeanuPerson{'name': 'Keanu Reeves', 'born': 1964}
CarriePerson{'name': 'Carrie-Anne Moss', 'born': 1967}
LaurencePerson{'name': 'Laurence Fishburne', 'born': 1961}
HugoPerson{'name': 'Hugo Weaving', 'born': 1960}
\n", + "
" + ], + "text/plain": [ + " label props\n", + "id \n", + "TheMatrix Movie {'title': 'The Matrix', 'released': 1999, 'tag...\n", + "Keanu Person {'name': 'Keanu Reeves', 'born': 1964}\n", + "Carrie Person {'name': 'Carrie-Anne Moss', 'born': 1967}\n", + "Laurence Person {'name': 'Laurence Fishburne', 'born': 1961}\n", + "Hugo Person {'name': 'Hugo Weaving', 'born': 1960}" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nodes.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "68cf9037-8b98-4ed7-94de-bb14c8b678f0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
labelprops
id
(Keanu, TheMatrix)ACTED_IN{'roles': '[\"Neo\"]'}
(Carrie, TheMatrix)ACTED_IN{'roles': '[\"Trinity\"]'}
(Laurence, TheMatrix)ACTED_IN{'roles': '[\"Morpheus\"]'}
(Hugo, TheMatrix)ACTED_IN{'roles': '[\"Agent Smith\"]'}
(LillyW, TheMatrix)DIRECTED{}
\n", + "
" + ], + "text/plain": [ + " label props\n", + "id \n", + "(Keanu, TheMatrix) ACTED_IN {'roles': '[\"Neo\"]'}\n", + "(Carrie, TheMatrix) ACTED_IN {'roles': '[\"Trinity\"]'}\n", + "(Laurence, TheMatrix) ACTED_IN {'roles': '[\"Morpheus\"]'}\n", + "(Hugo, TheMatrix) ACTED_IN {'roles': '[\"Agent Smith\"]'}\n", + "(LillyW, TheMatrix) DIRECTED {}" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "edges.head()" + ] + }, + { + "cell_type": "markdown", + "id": "78e8d550-e049-4de6-842f-39872e4d6f98", + "metadata": {}, + "source": [ + "Creation of edges and nodes batch by batch" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "a80cc0ee-c6af-44f3-9f73-f43a8f538ffc", + "metadata": {}, + "outputs": [], + "source": [ + "from itertools import islice\n", + "\n", + "def batched(iterable, n):\n", + " \"Batch data into lists of length n. The last batch may be shorter.\"\n", + " # batched('ABCDEFG', 3) --> ABC DEF G\n", + " it = iter(iterable)\n", + " while True:\n", + " batch = list(islice(it, n))\n", + " if not batch:\n", + " return\n", + " yield batch" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "651314fa-efea-4fb7-9a7f-6487fcde6a9d", + "metadata": {}, + "outputs": [], + "source": [ + "def create_from_batch(builder, iterable, batch_size):\n", + " for batch in batched(iterable, batch_size):\n", + " _ = reduce(lambda g, item: builder(g, item[0], item[1][\"label\"], item[1][\"props\"]), batch, g).iterate()" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "id": "c331abcb-63b2-4902-bf75-9c0845f2219b", + "metadata": {}, + "outputs": [], + "source": [ + "create_from_batch(build_node_query, nodes.iterrows(), 10)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "id": "224412d2-c0f7-46b3-861f-6ead80084ded", + "metadata": {}, + "outputs": [], + "source": [ + "create_from_batch(build_edge_query, edges.iterrows(), 10)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "id": "43844ee1-c300-4ed7-a0cc-5e7922db222d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "171" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().count().next()" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "a9bc20b4-d8f7-414b-985d-4f85ecc16de2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "253" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.E().count().next()" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "7675a693-2c69-4e01-91ff-6fccf3d050d7", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['Emil Eifrem',\n", + " 'Carrie-Anne Moss',\n", + " 'Laurence Fishburne',\n", + " 'Keanu Reeves',\n", + " 'Hugo Weaving',\n", + " 'Charlize Theron',\n", + " 'Al Pacino',\n", + " 'Gene Hackman',\n", + " 'Brooke Langton',\n", + " 'Orlando Jones',\n", + " 'Takeshi Kitano',\n", + " 'Dina Meyer',\n", + " 'Ice-T',\n", + " 'Jack Nicholson',\n", + " 'Diane Keaton']" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().has('Person', 'name', 'Keanu Reeves').out(\"ACTED_IN\").in_(\"ACTED_IN\").values(\"name\").dedup().to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "fed4e739-f3c9-4b2b-9884-e185f8d390d2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.V().drop().to_list()" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "77079085-b277-4bf7-9c59-fa1928caf560", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "g.E().drop().to_list()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "chap10", + "language": "python", + "name": "chap10" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Chapter10/movieCreationQuery.txt b/Chapter10/movieCreationQuery.txt index 9617449..d27dd47 100644 --- a/Chapter10/movieCreationQuery.txt +++ b/Chapter10/movieCreationQuery.txt @@ -38,7 +38,7 @@ CREATE (LanaW)-[:DIRECTED]->(TheMatrixRevolutions), (JoelS)-[:PRODUCED]->(TheMatrixRevolutions) -CREATE (TheDevilsAdvocate:Movie {title:"The Devil's Advocate", released:1997, tagline:'Evil has its winning ways'}) +CREATE (TheDevilsAdvocate:Movie {title:"The Devil's Advocate", released:1997, tagline:"Evil has its winning ways"}) CREATE (Charlize:Person {name:'Charlize Theron', born:1975}) CREATE (Al:Person {name:'Al Pacino', born:1940}) CREATE (Taylor:Person {name:'Taylor Hackford', born:1944}) @@ -78,7 +78,7 @@ CREATE (RobR)-[:DIRECTED]->(AFewGoodMen), (AaronS)-[:WROTE]->(AFewGoodMen) -CREATE (TopGun:Movie {title:"Top Gun", released:1986, tagline:'I feel the need, the need for speed.'}) +CREATE (TopGun:Movie {title:"Top Gun", released:1986, tagline:"I feel the need, the need for speed."}) CREATE (KellyM:Person {name:'Kelly McGillis', born:1957}) CREATE (ValK:Person {name:'Val Kilmer', born:1959}) CREATE (AnthonyE:Person {name:'Anthony Edwards', born:1962}) @@ -172,7 +172,7 @@ CREATE (JamesC)-[:ACTED_IN {roles:['Judge Fielding']}]->(SnowFallingonCedars), (ScottH)-[:DIRECTED]->(SnowFallingonCedars) -CREATE (YouveGotMail:Movie {title:"You've Got Mail", released:1998, tagline:'At odds in life... in love on-line.'}) +CREATE (YouveGotMail:Movie {title:"You've Got Mail", released:1998, tagline:"At odds in life... in love on-line."}) CREATE (ParkerP:Person {name:'Parker Posey', born:1968}) CREATE (DaveC:Person {name:'Dave Chappelle', born:1973}) CREATE (SteveZ:Person {name:'Steve Zahn', born:1967}) @@ -244,7 +244,7 @@ CREATE (Orlando)-[:ACTED_IN {roles:['Clifford Franklin']}]->(TheReplacements), (Howard)-[:DIRECTED]->(TheReplacements) -CREATE (RescueDawn:Movie {title:'RescueDawn', released:2006, tagline:"Based on the extraordinary true story of one man's fight for freedom"}) +CREATE (RescueDawn:Movie {title:"RescueDawn", released:2006, tagline:"Based on the extraordinary true story of one man's fight for freedom"}) CREATE (ChristianB:Person {name:'Christian Bale', born:1974}) CREATE (ZachG:Person {name:'Zach Grenier', born:1954}) CREATE @@ -262,7 +262,7 @@ CREATE (Gene)-[:ACTED_IN {roles:['Sen. Kevin Keeley']}]->(TheBirdcage), (MikeN)-[:DIRECTED]->(TheBirdcage) -CREATE (Unforgiven:Movie {title:'Unforgiven', released:1992, tagline:"It's a hell of a thing, killing a man"}) +CREATE (Unforgiven:Movie {title:"Unforgiven", released:1992, tagline:"It's a hell of a thing, killing a man"}) CREATE (RichardH:Person {name:'Richard Harris', born:1930}) CREATE (ClintE:Person {name:'Clint Eastwood', born:1930}) CREATE @@ -363,7 +363,7 @@ CREATE (LanaW)-[:PRODUCED]->(NinjaAssassin), (JoelS)-[:PRODUCED]->(NinjaAssassin) -CREATE (TheGreenMile:Movie {title:'The Green Mile', released:1999, tagline:"Walk a mile you'll never forget."}) +CREATE (TheGreenMile:Movie {title:"The Green Mile", released:1999, tagline:"Walk a mile you'll never forget."}) CREATE (MichaelD:Person {name:'Michael Clarke Duncan', born:1957}) CREATE (DavidM:Person {name:'David Morse', born:1953}) CREATE (SamR:Person {name:'Sam Rockwell', born:1968}) @@ -373,10 +373,10 @@ CREATE (FrankD:Person {name:'Frank Darabont', born:1959}) CREATE (TomH)-[:ACTED_IN {roles:['Paul Edgecomb']}]->(TheGreenMile), (MichaelD)-[:ACTED_IN {roles:['John Coffey']}]->(TheGreenMile), -(DavidM)-[:ACTED_IN {roles:['Brutus "Brutal" Howell']}]->(TheGreenMile), +(DavidM)-[:ACTED_IN {roles:["Brutus 'Brutal' Howell"]}]->(TheGreenMile), (BonnieH)-[:ACTED_IN {roles:['Jan Edgecomb']}]->(TheGreenMile), (JamesC)-[:ACTED_IN {roles:['Warden Hal Moores']}]->(TheGreenMile), -(SamR)-[:ACTED_IN {roles:['"Wild Bill" Wharton']}]->(TheGreenMile), +(SamR)-[:ACTED_IN {roles:["'Wild Bill' Wharton"]}]->(TheGreenMile), (GaryS)-[:ACTED_IN {roles:['Burt Hammersmith']}]->(TheGreenMile), (PatriciaC)-[:ACTED_IN {roles:['Melinda Moores']}]->(TheGreenMile), (FrankD)-[:DIRECTED]->(TheGreenMile) @@ -393,14 +393,14 @@ CREATE (SamR)-[:ACTED_IN {roles:['James Reston, Jr.']}]->(FrostNixon), (RonH)-[:DIRECTED]->(FrostNixon) -CREATE (Hoffa:Movie {title:'Hoffa', released:1992, tagline:"He didn't want law. He wanted justice."}) +CREATE (Hoffa:Movie {title:"Hoffa", released:1992, tagline:"He didn't want law. He wanted justice."}) CREATE (DannyD:Person {name:'Danny DeVito', born:1944}) CREATE (JohnR:Person {name:'John C. Reilly', born:1965}) CREATE (JackN)-[:ACTED_IN {roles:['Hoffa']}]->(Hoffa), -(DannyD)-[:ACTED_IN {roles:['Robert "Bobby" Ciaro']}]->(Hoffa), +(DannyD)-[:ACTED_IN {roles:["Robert 'Bobby' Ciaro"]}]->(Hoffa), (JTW)-[:ACTED_IN {roles:['Frank Fitzsimmons']}]->(Hoffa), -(JohnR)-[:ACTED_IN {roles:['Peter "Pete" Connelly']}]->(Hoffa), +(JohnR)-[:ACTED_IN {roles:["Peter 'Pete' Connelly"]}]->(Hoffa), (DannyD)-[:DIRECTED]->(Hoffa) CREATE (Apollo13:Movie {title:'Apollo 13', released:1995, tagline:'Houston, we have a problem.'}) @@ -414,14 +414,14 @@ CREATE (GaryS)-[:ACTED_IN {roles:['Ken Mattingly']}]->(Apollo13), (RonH)-[:DIRECTED]->(Apollo13) -CREATE (Twister:Movie {title:'Twister', released:1996, tagline:"Don't Breathe. Don't Look Back."}) +CREATE (Twister:Movie {title:"Twister", released:1996, tagline:"Don't Breathe. Don't Look Back."}) CREATE (PhilipH:Person {name:'Philip Seymour Hoffman', born:1967}) CREATE (JanB:Person {name:'Jan de Bont', born:1943}) CREATE (BillPax)-[:ACTED_IN {roles:['Bill Harding']}]->(Twister), (HelenH)-[:ACTED_IN {roles:['Dr. Jo Harding']}]->(Twister), (ZachG)-[:ACTED_IN {roles:['Eddie']}]->(Twister), -(PhilipH)-[:ACTED_IN {roles:['Dustin "Dusty" Davis']}]->(Twister), +(PhilipH)-[:ACTED_IN {roles:["Dustin 'Dusty' Davis"]}]->(Twister), (JanB)-[:DIRECTED]->(Twister) CREATE (CastAway:Movie {title:'Cast Away', released:2000, tagline:'At the edge of the world, his journey begins.'}) @@ -449,7 +449,7 @@ CREATE (NancyM)-[:PRODUCED]->(SomethingsGottaGive), (NancyM)-[:WROTE]->(SomethingsGottaGive) -CREATE (BicentennialMan:Movie {title:'Bicentennial Man', released:1999, tagline:"One robot's 200 year journey to become an ordinary man."}) +CREATE (BicentennialMan:Movie {title:"Bicentennial Man", released:1999, tagline:"One robot's 200 year journey to become an ordinary man."}) CREATE (ChrisC:Person {name:'Chris Columbus', born:1958}) CREATE (Robin)-[:ACTED_IN {roles:['Andrew Marin']}]->(BicentennialMan), @@ -479,7 +479,7 @@ CREATE (GeenaD)-[:ACTED_IN {roles:['Dottie Hinson']}]->(ALeagueofTheirOwn), (LoriP)-[:ACTED_IN {roles:['Kit Keller']}]->(ALeagueofTheirOwn), (RosieO)-[:ACTED_IN {roles:['Doris Murphy']}]->(ALeagueofTheirOwn), -(Madonna)-[:ACTED_IN {roles:['"All the Way" Mae Mordabito']}]->(ALeagueofTheirOwn), +(Madonna)-[:ACTED_IN {roles:["'All the Way' Mae Mordabito"]}]->(ALeagueofTheirOwn), (BillPax)-[:ACTED_IN {roles:['Bob Hinson']}]->(ALeagueofTheirOwn), (PennyM)-[:DIRECTED]->(ALeagueofTheirOwn) diff --git a/Chapter10/poetry.lock b/Chapter10/poetry.lock index cb9b50b..f405153 100644 --- a/Chapter10/poetry.lock +++ b/Chapter10/poetry.lock @@ -191,6 +191,17 @@ docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphi tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] +[[package]] +name = "certifi" +version = "2025.1.31" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, + {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, +] + [[package]] name = "cffi" version = "1.17.1" @@ -270,6 +281,107 @@ files = [ [package.dependencies] pycparser = "*" +[[package]] +name = "charset-normalizer" +version = "3.4.1" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7" +files = [ + {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f"}, + {file = "charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b"}, + {file = "charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35"}, + {file = "charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407"}, + {file = "charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win32.whl", hash = "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487"}, + {file = "charset_normalizer-3.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win32.whl", hash = "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e"}, + {file = "charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5"}, + {file = "charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765"}, + {file = "charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85"}, + {file = "charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3"}, +] + [[package]] name = "colorama" version = "0.4.6" @@ -473,6 +585,34 @@ files = [ {file = "frozenlist-1.5.0.tar.gz", hash = "sha256:81d5af29e61b9c8348e876d442253723928dce6433e0e76cd925cd83f1b4b817"}, ] +[[package]] +name = "graphdatascience" +version = "1.14" +description = "A Python client for the Neo4j Graph Data Science (GDS) library" +optional = false +python-versions = ">=3.9" +files = [ + {file = "graphdatascience-1.14-py3-none-any.whl", hash = "sha256:6fd0ab6f04354a1e9b322c18fa79925af238803406d4bb23e151e1683d1be2b8"}, + {file = "graphdatascience-1.14.tar.gz", hash = "sha256:6f83e18f2e6d32d7c92ce4a762b11736a281c9cc001b3d85d95fcf9e8344f584"}, +] + +[package.dependencies] +multimethod = ">=1.0,<3.0" +neo4j = ">=4.4.12,<6.0" +numpy = "<2.3" +pandas = ">=1.0,<3.0" +pyarrow = ">=16.0,<20.0" +requests = "*" +tenacity = ">=9.0" +textdistance = ">=4.0,<5.0" +tqdm = ">=4.0,<5.0" +typing-extensions = ">=4.0,<5.0" + +[package.extras] +networkx = ["networkx (>=2.0,<4.0)"] +ogb = ["ogb (>=1.0,<2.0)"] +rust-ext = ["neo4j-rust-ext (>=4.4.12,<6.0)"] + [[package]] name = "gremlinpython" version = "3.7.3" @@ -770,6 +910,17 @@ files = [ [package.dependencies] typing-extensions = {version = ">=4.1.0", markers = "python_version < \"3.11\""} +[[package]] +name = "multimethod" +version = "2.0" +description = "Multiple argument dispatching." +optional = false +python-versions = ">=3.9" +files = [ + {file = "multimethod-2.0-py3-none-any.whl", hash = "sha256:45aa231dc9dbb7f980c0f2ad8179e2c2b72a8cd5c7d7534337be66dde29d35be"}, + {file = "multimethod-2.0.tar.gz", hash = "sha256:c628b6d2e7d61fbe58484dd884d990901e8314faf58af062e72b65e3423cb109"}, +] + [[package]] name = "neo4j" version = "5.27.0" @@ -819,6 +970,70 @@ example = ["cairocffi (>=1.7)", "contextily (>=1.6)", "igraph (>=0.11)", "momepy extra = ["lxml (>=4.6)", "pydot (>=3.0.1)", "pygraphviz (>=1.14)", "sympy (>=1.10)"] test = ["pytest (>=7.2)", "pytest-cov (>=4.0)"] +[[package]] +name = "numpy" +version = "2.2.3" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.10" +files = [ + {file = "numpy-2.2.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:cbc6472e01952d3d1b2772b720428f8b90e2deea8344e854df22b0618e9cce71"}, + {file = "numpy-2.2.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdfe0c22692a30cd830c0755746473ae66c4a8f2e7bd508b35fb3b6a0813d787"}, + {file = "numpy-2.2.3-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:e37242f5324ffd9f7ba5acf96d774f9276aa62a966c0bad8dae692deebec7716"}, + {file = "numpy-2.2.3-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:95172a21038c9b423e68be78fd0be6e1b97674cde269b76fe269a5dfa6fadf0b"}, + {file = "numpy-2.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5b47c440210c5d1d67e1cf434124e0b5c395eee1f5806fdd89b553ed1acd0a3"}, + {file = "numpy-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0391ea3622f5c51a2e29708877d56e3d276827ac5447d7f45e9bc4ade8923c52"}, + {file = "numpy-2.2.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f6b3dfc7661f8842babd8ea07e9897fe3d9b69a1d7e5fbb743e4160f9387833b"}, + {file = "numpy-2.2.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1ad78ce7f18ce4e7df1b2ea4019b5817a2f6a8a16e34ff2775f646adce0a5027"}, + {file = "numpy-2.2.3-cp310-cp310-win32.whl", hash = "sha256:5ebeb7ef54a7be11044c33a17b2624abe4307a75893c001a4800857956b41094"}, + {file = "numpy-2.2.3-cp310-cp310-win_amd64.whl", hash = "sha256:596140185c7fa113563c67c2e894eabe0daea18cf8e33851738c19f70ce86aeb"}, + {file = "numpy-2.2.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:16372619ee728ed67a2a606a614f56d3eabc5b86f8b615c79d01957062826ca8"}, + {file = "numpy-2.2.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5521a06a3148686d9269c53b09f7d399a5725c47bbb5b35747e1cb76326b714b"}, + {file = "numpy-2.2.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:7c8dde0ca2f77828815fd1aedfdf52e59071a5bae30dac3b4da2a335c672149a"}, + {file = "numpy-2.2.3-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:77974aba6c1bc26e3c205c2214f0d5b4305bdc719268b93e768ddb17e3fdd636"}, + {file = "numpy-2.2.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d42f9c36d06440e34226e8bd65ff065ca0963aeecada587b937011efa02cdc9d"}, + {file = "numpy-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2712c5179f40af9ddc8f6727f2bd910ea0eb50206daea75f58ddd9fa3f715bb"}, + {file = "numpy-2.2.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c8b0451d2ec95010d1db8ca733afc41f659f425b7f608af569711097fd6014e2"}, + {file = "numpy-2.2.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d9b4a8148c57ecac25a16b0e11798cbe88edf5237b0df99973687dd866f05e1b"}, + {file = "numpy-2.2.3-cp311-cp311-win32.whl", hash = "sha256:1f45315b2dc58d8a3e7754fe4e38b6fce132dab284a92851e41b2b344f6441c5"}, + {file = "numpy-2.2.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f48ba6f6c13e5e49f3d3efb1b51c8193215c42ac82610a04624906a9270be6f"}, + {file = "numpy-2.2.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:12c045f43b1d2915eca6b880a7f4a256f59d62df4f044788c8ba67709412128d"}, + {file = "numpy-2.2.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:87eed225fd415bbae787f93a457af7f5990b92a334e346f72070bf569b9c9c95"}, + {file = "numpy-2.2.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:712a64103d97c404e87d4d7c47fb0c7ff9acccc625ca2002848e0d53288b90ea"}, + {file = "numpy-2.2.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:a5ae282abe60a2db0fd407072aff4599c279bcd6e9a2475500fc35b00a57c532"}, + {file = "numpy-2.2.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5266de33d4c3420973cf9ae3b98b54a2a6d53a559310e3236c4b2b06b9c07d4e"}, + {file = "numpy-2.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b787adbf04b0db1967798dba8da1af07e387908ed1553a0d6e74c084d1ceafe"}, + {file = "numpy-2.2.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:34c1b7e83f94f3b564b35f480f5652a47007dd91f7c839f404d03279cc8dd021"}, + {file = "numpy-2.2.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4d8335b5f1b6e2bce120d55fb17064b0262ff29b459e8493d1785c18ae2553b8"}, + {file = "numpy-2.2.3-cp312-cp312-win32.whl", hash = "sha256:4d9828d25fb246bedd31e04c9e75714a4087211ac348cb39c8c5f99dbb6683fe"}, + {file = "numpy-2.2.3-cp312-cp312-win_amd64.whl", hash = "sha256:83807d445817326b4bcdaaaf8e8e9f1753da04341eceec705c001ff342002e5d"}, + {file = "numpy-2.2.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7bfdb06b395385ea9b91bf55c1adf1b297c9fdb531552845ff1d3ea6e40d5aba"}, + {file = "numpy-2.2.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:23c9f4edbf4c065fddb10a4f6e8b6a244342d95966a48820c614891e5059bb50"}, + {file = "numpy-2.2.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:a0c03b6be48aaf92525cccf393265e02773be8fd9551a2f9adbe7db1fa2b60f1"}, + {file = "numpy-2.2.3-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:2376e317111daa0a6739e50f7ee2a6353f768489102308b0d98fcf4a04f7f3b5"}, + {file = "numpy-2.2.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8fb62fe3d206d72fe1cfe31c4a1106ad2b136fcc1606093aeab314f02930fdf2"}, + {file = "numpy-2.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:52659ad2534427dffcc36aac76bebdd02b67e3b7a619ac67543bc9bfe6b7cdb1"}, + {file = "numpy-2.2.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:1b416af7d0ed3271cad0f0a0d0bee0911ed7eba23e66f8424d9f3dfcdcae1304"}, + {file = "numpy-2.2.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1402da8e0f435991983d0a9708b779f95a8c98c6b18a171b9f1be09005e64d9d"}, + {file = "numpy-2.2.3-cp313-cp313-win32.whl", hash = "sha256:136553f123ee2951bfcfbc264acd34a2fc2f29d7cdf610ce7daf672b6fbaa693"}, + {file = "numpy-2.2.3-cp313-cp313-win_amd64.whl", hash = "sha256:5b732c8beef1d7bc2d9e476dbba20aaff6167bf205ad9aa8d30913859e82884b"}, + {file = "numpy-2.2.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:435e7a933b9fda8126130b046975a968cc2d833b505475e588339e09f7672890"}, + {file = "numpy-2.2.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:7678556eeb0152cbd1522b684dcd215250885993dd00adb93679ec3c0e6e091c"}, + {file = "numpy-2.2.3-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:2e8da03bd561504d9b20e7a12340870dfc206c64ea59b4cfee9fceb95070ee94"}, + {file = "numpy-2.2.3-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:c9aa4496fd0e17e3843399f533d62857cef5900facf93e735ef65aa4bbc90ef0"}, + {file = "numpy-2.2.3-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f4ca91d61a4bf61b0f2228f24bbfa6a9facd5f8af03759fe2a655c50ae2c6610"}, + {file = "numpy-2.2.3-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:deaa09cd492e24fd9b15296844c0ad1b3c976da7907e1c1ed3a0ad21dded6f76"}, + {file = "numpy-2.2.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:246535e2f7496b7ac85deffe932896a3577be7af8fb7eebe7146444680297e9a"}, + {file = "numpy-2.2.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:daf43a3d1ea699402c5a850e5313680ac355b4adc9770cd5cfc2940e7861f1bf"}, + {file = "numpy-2.2.3-cp313-cp313t-win32.whl", hash = "sha256:cf802eef1f0134afb81fef94020351be4fe1d6681aadf9c5e862af6602af64ef"}, + {file = "numpy-2.2.3-cp313-cp313t-win_amd64.whl", hash = "sha256:aee2512827ceb6d7f517c8b85aa5d3923afe8fc7a57d028cffcd522f1c6fd082"}, + {file = "numpy-2.2.3-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:3c2ec8a0f51d60f1e9c0c5ab116b7fc104b165ada3f6c58abf881cb2eb16044d"}, + {file = "numpy-2.2.3-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:ed2cf9ed4e8ebc3b754d398cba12f24359f018b416c380f577bbae112ca52fc9"}, + {file = "numpy-2.2.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39261798d208c3095ae4f7bc8eaeb3481ea8c6e03dc48028057d3cbdbdb8937e"}, + {file = "numpy-2.2.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:783145835458e60fa97afac25d511d00a1eca94d4a8f3ace9fe2043003c678e4"}, + {file = "numpy-2.2.3.tar.gz", hash = "sha256:dbdc15f0c81611925f382dfa97b3bd0bc2c1ce19d4fe50482cb0ddc12ba30020"}, +] + [[package]] name = "packaging" version = "24.2" @@ -830,6 +1045,88 @@ files = [ {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, ] +[[package]] +name = "pandas" +version = "2.2.3" +description = "Powerful data structures for data analysis, time series, and statistics" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pandas-2.2.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1948ddde24197a0f7add2bdc4ca83bf2b1ef84a1bc8ccffd95eda17fd836ecb5"}, + {file = "pandas-2.2.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:381175499d3802cde0eabbaf6324cce0c4f5d52ca6f8c377c29ad442f50f6348"}, + {file = "pandas-2.2.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d9c45366def9a3dd85a6454c0e7908f2b3b8e9c138f5dc38fed7ce720d8453ed"}, + {file = "pandas-2.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:86976a1c5b25ae3f8ccae3a5306e443569ee3c3faf444dfd0f41cda24667ad57"}, + {file = "pandas-2.2.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b8661b0238a69d7aafe156b7fa86c44b881387509653fdf857bebc5e4008ad42"}, + {file = "pandas-2.2.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:37e0aced3e8f539eccf2e099f65cdb9c8aa85109b0be6e93e2baff94264bdc6f"}, + {file = "pandas-2.2.3-cp310-cp310-win_amd64.whl", hash = "sha256:56534ce0746a58afaf7942ba4863e0ef81c9c50d3f0ae93e9497d6a41a057645"}, + {file = "pandas-2.2.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:66108071e1b935240e74525006034333f98bcdb87ea116de573a6a0dccb6c039"}, + {file = "pandas-2.2.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7c2875855b0ff77b2a64a0365e24455d9990730d6431b9e0ee18ad8acee13dbd"}, + {file = "pandas-2.2.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd8d0c3be0515c12fed0bdbae072551c8b54b7192c7b1fda0ba56059a0179698"}, + {file = "pandas-2.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c124333816c3a9b03fbeef3a9f230ba9a737e9e5bb4060aa2107a86cc0a497fc"}, + {file = "pandas-2.2.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:63cc132e40a2e084cf01adf0775b15ac515ba905d7dcca47e9a251819c575ef3"}, + {file = "pandas-2.2.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:29401dbfa9ad77319367d36940cd8a0b3a11aba16063e39632d98b0e931ddf32"}, + {file = "pandas-2.2.3-cp311-cp311-win_amd64.whl", hash = "sha256:3fc6873a41186404dad67245896a6e440baacc92f5b716ccd1bc9ed2995ab2c5"}, + {file = "pandas-2.2.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b1d432e8d08679a40e2a6d8b2f9770a5c21793a6f9f47fdd52c5ce1948a5a8a9"}, + {file = "pandas-2.2.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a5a1595fe639f5988ba6a8e5bc9649af3baf26df3998a0abe56c02609392e0a4"}, + {file = "pandas-2.2.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5de54125a92bb4d1c051c0659e6fcb75256bf799a732a87184e5ea503965bce3"}, + {file = "pandas-2.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fffb8ae78d8af97f849404f21411c95062db1496aeb3e56f146f0355c9989319"}, + {file = "pandas-2.2.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6dfcb5ee8d4d50c06a51c2fffa6cff6272098ad6540aed1a76d15fb9318194d8"}, + {file = "pandas-2.2.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:062309c1b9ea12a50e8ce661145c6aab431b1e99530d3cd60640e255778bd43a"}, + {file = "pandas-2.2.3-cp312-cp312-win_amd64.whl", hash = "sha256:59ef3764d0fe818125a5097d2ae867ca3fa64df032331b7e0917cf5d7bf66b13"}, + {file = "pandas-2.2.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f00d1345d84d8c86a63e476bb4955e46458b304b9575dcf71102b5c705320015"}, + {file = "pandas-2.2.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3508d914817e153ad359d7e069d752cdd736a247c322d932eb89e6bc84217f28"}, + {file = "pandas-2.2.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22a9d949bfc9a502d320aa04e5d02feab689d61da4e7764b62c30b991c42c5f0"}, + {file = "pandas-2.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3a255b2c19987fbbe62a9dfd6cff7ff2aa9ccab3fc75218fd4b7530f01efa24"}, + {file = "pandas-2.2.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:800250ecdadb6d9c78eae4990da62743b857b470883fa27f652db8bdde7f6659"}, + {file = "pandas-2.2.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6374c452ff3ec675a8f46fd9ab25c4ad0ba590b71cf0656f8b6daa5202bca3fb"}, + {file = "pandas-2.2.3-cp313-cp313-win_amd64.whl", hash = "sha256:61c5ad4043f791b61dd4752191d9f07f0ae412515d59ba8f005832a532f8736d"}, + {file = "pandas-2.2.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:3b71f27954685ee685317063bf13c7709a7ba74fc996b84fc6821c59b0f06468"}, + {file = "pandas-2.2.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:38cf8125c40dae9d5acc10fa66af8ea6fdf760b2714ee482ca691fc66e6fcb18"}, + {file = "pandas-2.2.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ba96630bc17c875161df3818780af30e43be9b166ce51c9a18c1feae342906c2"}, + {file = "pandas-2.2.3-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1db71525a1538b30142094edb9adc10be3f3e176748cd7acc2240c2f2e5aa3a4"}, + {file = "pandas-2.2.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:15c0e1e02e93116177d29ff83e8b1619c93ddc9c49083f237d4312337a61165d"}, + {file = "pandas-2.2.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:ad5b65698ab28ed8d7f18790a0dc58005c7629f227be9ecc1072aa74c0c1d43a"}, + {file = "pandas-2.2.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bc6b93f9b966093cb0fd62ff1a7e4c09e6d546ad7c1de191767baffc57628f39"}, + {file = "pandas-2.2.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5dbca4c1acd72e8eeef4753eeca07de9b1db4f398669d5994086f788a5d7cc30"}, + {file = "pandas-2.2.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8cd6d7cc958a3910f934ea8dbdf17b2364827bb4dafc38ce6eef6bb3d65ff09c"}, + {file = "pandas-2.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99df71520d25fade9db7c1076ac94eb994f4d2673ef2aa2e86ee039b6746d20c"}, + {file = "pandas-2.2.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:31d0ced62d4ea3e231a9f228366919a5ea0b07440d9d4dac345376fd8e1477ea"}, + {file = "pandas-2.2.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7eee9e7cea6adf3e3d24e304ac6b8300646e2a5d1cd3a3c2abed9101b0846761"}, + {file = "pandas-2.2.3-cp39-cp39-win_amd64.whl", hash = "sha256:4850ba03528b6dd51d6c5d273c46f183f39a9baf3f0143e566b89450965b105e"}, + {file = "pandas-2.2.3.tar.gz", hash = "sha256:4f18ba62b61d7e192368b84517265a99b4d7ee8912f8708660fb4a366cc82667"}, +] + +[package.dependencies] +numpy = {version = ">=1.22.4", markers = "python_version < \"3.11\""} +python-dateutil = ">=2.8.2" +pytz = ">=2020.1" +tzdata = ">=2022.7" + +[package.extras] +all = ["PyQt5 (>=5.15.9)", "SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "adbc-driver-sqlite (>=0.8.0)", "beautifulsoup4 (>=4.11.2)", "bottleneck (>=1.3.6)", "dataframe-api-compat (>=0.1.7)", "fastparquet (>=2022.12.0)", "fsspec (>=2022.11.0)", "gcsfs (>=2022.11.0)", "html5lib (>=1.1)", "hypothesis (>=6.46.1)", "jinja2 (>=3.1.2)", "lxml (>=4.9.2)", "matplotlib (>=3.6.3)", "numba (>=0.56.4)", "numexpr (>=2.8.4)", "odfpy (>=1.4.1)", "openpyxl (>=3.1.0)", "pandas-gbq (>=0.19.0)", "psycopg2 (>=2.9.6)", "pyarrow (>=10.0.1)", "pymysql (>=1.0.2)", "pyreadstat (>=1.2.0)", "pytest (>=7.3.2)", "pytest-xdist (>=2.2.0)", "python-calamine (>=0.1.7)", "pyxlsb (>=1.0.10)", "qtpy (>=2.3.0)", "s3fs (>=2022.11.0)", "scipy (>=1.10.0)", "tables (>=3.8.0)", "tabulate (>=0.9.0)", "xarray (>=2022.12.0)", "xlrd (>=2.0.1)", "xlsxwriter (>=3.0.5)", "zstandard (>=0.19.0)"] +aws = ["s3fs (>=2022.11.0)"] +clipboard = ["PyQt5 (>=5.15.9)", "qtpy (>=2.3.0)"] +compression = ["zstandard (>=0.19.0)"] +computation = ["scipy (>=1.10.0)", "xarray (>=2022.12.0)"] +consortium-standard = ["dataframe-api-compat (>=0.1.7)"] +excel = ["odfpy (>=1.4.1)", "openpyxl (>=3.1.0)", "python-calamine (>=0.1.7)", "pyxlsb (>=1.0.10)", "xlrd (>=2.0.1)", "xlsxwriter (>=3.0.5)"] +feather = ["pyarrow (>=10.0.1)"] +fss = ["fsspec (>=2022.11.0)"] +gcp = ["gcsfs (>=2022.11.0)", "pandas-gbq (>=0.19.0)"] +hdf5 = ["tables (>=3.8.0)"] +html = ["beautifulsoup4 (>=4.11.2)", "html5lib (>=1.1)", "lxml (>=4.9.2)"] +mysql = ["SQLAlchemy (>=2.0.0)", "pymysql (>=1.0.2)"] +output-formatting = ["jinja2 (>=3.1.2)", "tabulate (>=0.9.0)"] +parquet = ["pyarrow (>=10.0.1)"] +performance = ["bottleneck (>=1.3.6)", "numba (>=0.56.4)", "numexpr (>=2.8.4)"] +plot = ["matplotlib (>=3.6.3)"] +postgresql = ["SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "psycopg2 (>=2.9.6)"] +pyarrow = ["pyarrow (>=10.0.1)"] +spss = ["pyreadstat (>=1.2.0)"] +sql-other = ["SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "adbc-driver-sqlite (>=0.8.0)"] +test = ["hypothesis (>=6.46.1)", "pytest (>=7.3.2)", "pytest-xdist (>=2.2.0)"] +xml = ["lxml (>=4.9.2)"] + [[package]] name = "parso" version = "0.8.4" @@ -1035,6 +1332,60 @@ files = [ [package.extras] tests = ["pytest"] +[[package]] +name = "pyarrow" +version = "19.0.1" +description = "Python library for Apache Arrow" +optional = false +python-versions = ">=3.9" +files = [ + {file = "pyarrow-19.0.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:fc28912a2dc924dddc2087679cc8b7263accc71b9ff025a1362b004711661a69"}, + {file = "pyarrow-19.0.1-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:fca15aabbe9b8355800d923cc2e82c8ef514af321e18b437c3d782aa884eaeec"}, + {file = "pyarrow-19.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad76aef7f5f7e4a757fddcdcf010a8290958f09e3470ea458c80d26f4316ae89"}, + {file = "pyarrow-19.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d03c9d6f2a3dffbd62671ca070f13fc527bb1867b4ec2b98c7eeed381d4f389a"}, + {file = "pyarrow-19.0.1-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:65cf9feebab489b19cdfcfe4aa82f62147218558d8d3f0fc1e9dea0ab8e7905a"}, + {file = "pyarrow-19.0.1-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:41f9706fbe505e0abc10e84bf3a906a1338905cbbcf1177b71486b03e6ea6608"}, + {file = "pyarrow-19.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:c6cb2335a411b713fdf1e82a752162f72d4a7b5dbc588e32aa18383318b05866"}, + {file = "pyarrow-19.0.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:cc55d71898ea30dc95900297d191377caba257612f384207fe9f8293b5850f90"}, + {file = "pyarrow-19.0.1-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:7a544ec12de66769612b2d6988c36adc96fb9767ecc8ee0a4d270b10b1c51e00"}, + {file = "pyarrow-19.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0148bb4fc158bfbc3d6dfe5001d93ebeed253793fff4435167f6ce1dc4bddeae"}, + {file = "pyarrow-19.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f24faab6ed18f216a37870d8c5623f9c044566d75ec586ef884e13a02a9d62c5"}, + {file = "pyarrow-19.0.1-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:4982f8e2b7afd6dae8608d70ba5bd91699077323f812a0448d8b7abdff6cb5d3"}, + {file = "pyarrow-19.0.1-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:49a3aecb62c1be1d822f8bf629226d4a96418228a42f5b40835c1f10d42e4db6"}, + {file = "pyarrow-19.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:008a4009efdb4ea3d2e18f05cd31f9d43c388aad29c636112c2966605ba33466"}, + {file = "pyarrow-19.0.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:80b2ad2b193e7d19e81008a96e313fbd53157945c7be9ac65f44f8937a55427b"}, + {file = "pyarrow-19.0.1-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:ee8dec072569f43835932a3b10c55973593abc00936c202707a4ad06af7cb294"}, + {file = "pyarrow-19.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4d5d1ec7ec5324b98887bdc006f4d2ce534e10e60f7ad995e7875ffa0ff9cb14"}, + {file = "pyarrow-19.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3ad4c0eb4e2a9aeb990af6c09e6fa0b195c8c0e7b272ecc8d4d2b6574809d34"}, + {file = "pyarrow-19.0.1-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:d383591f3dcbe545f6cc62daaef9c7cdfe0dff0fb9e1c8121101cabe9098cfa6"}, + {file = "pyarrow-19.0.1-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:b4c4156a625f1e35d6c0b2132635a237708944eb41df5fbe7d50f20d20c17832"}, + {file = "pyarrow-19.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:5bd1618ae5e5476b7654c7b55a6364ae87686d4724538c24185bbb2952679960"}, + {file = "pyarrow-19.0.1-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:e45274b20e524ae5c39d7fc1ca2aa923aab494776d2d4b316b49ec7572ca324c"}, + {file = "pyarrow-19.0.1-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:d9dedeaf19097a143ed6da37f04f4051aba353c95ef507764d344229b2b740ae"}, + {file = "pyarrow-19.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ebfb5171bb5f4a52319344ebbbecc731af3f021e49318c74f33d520d31ae0c4"}, + {file = "pyarrow-19.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2a21d39fbdb948857f67eacb5bbaaf36802de044ec36fbef7a1c8f0dd3a4ab2"}, + {file = "pyarrow-19.0.1-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:99bc1bec6d234359743b01e70d4310d0ab240c3d6b0da7e2a93663b0158616f6"}, + {file = "pyarrow-19.0.1-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:1b93ef2c93e77c442c979b0d596af45e4665d8b96da598db145b0fec014b9136"}, + {file = "pyarrow-19.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:d9d46e06846a41ba906ab25302cf0fd522f81aa2a85a71021826f34639ad31ef"}, + {file = "pyarrow-19.0.1-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:c0fe3dbbf054a00d1f162fda94ce236a899ca01123a798c561ba307ca38af5f0"}, + {file = "pyarrow-19.0.1-cp313-cp313t-macosx_12_0_x86_64.whl", hash = "sha256:96606c3ba57944d128e8a8399da4812f56c7f61de8c647e3470b417f795d0ef9"}, + {file = "pyarrow-19.0.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f04d49a6b64cf24719c080b3c2029a3a5b16417fd5fd7c4041f94233af732f3"}, + {file = "pyarrow-19.0.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a9137cf7e1640dce4c190551ee69d478f7121b5c6f323553b319cac936395f6"}, + {file = "pyarrow-19.0.1-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:7c1bca1897c28013db5e4c83944a2ab53231f541b9e0c3f4791206d0c0de389a"}, + {file = "pyarrow-19.0.1-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:58d9397b2e273ef76264b45531e9d552d8ec8a6688b7390b5be44c02a37aade8"}, + {file = "pyarrow-19.0.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:b9766a47a9cb56fefe95cb27f535038b5a195707a08bf61b180e642324963b46"}, + {file = "pyarrow-19.0.1-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:6c5941c1aac89a6c2f2b16cd64fe76bcdb94b2b1e99ca6459de4e6f07638d755"}, + {file = "pyarrow-19.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd44d66093a239358d07c42a91eebf5015aa54fccba959db899f932218ac9cc8"}, + {file = "pyarrow-19.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:335d170e050bcc7da867a1ed8ffb8b44c57aaa6e0843b156a501298657b1e972"}, + {file = "pyarrow-19.0.1-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:1c7556165bd38cf0cd992df2636f8bcdd2d4b26916c6b7e646101aff3c16f76f"}, + {file = "pyarrow-19.0.1-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:699799f9c80bebcf1da0983ba86d7f289c5a2a5c04b945e2f2bcf7e874a91911"}, + {file = "pyarrow-19.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:8464c9fbe6d94a7fe1599e7e8965f350fd233532868232ab2596a71586c5a429"}, + {file = "pyarrow-19.0.1.tar.gz", hash = "sha256:3bf266b485df66a400f282ac0b6d1b500b9d2ae73314a153dbe97d6d5cc8a99e"}, +] + +[package.extras] +test = ["cffi", "hypothesis", "pandas", "pytest", "pytz"] + [[package]] name = "pycparser" version = "2.22" @@ -1233,6 +1584,27 @@ files = [ [package.dependencies] cffi = {version = "*", markers = "implementation_name == \"pypy\""} +[[package]] +name = "requests" +version = "2.32.3" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.8" +files = [ + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + [[package]] name = "six" version = "1.17.0" @@ -1263,6 +1635,47 @@ pure-eval = "*" [package.extras] tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] +[[package]] +name = "tenacity" +version = "9.0.0" +description = "Retry code until it succeeds" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tenacity-9.0.0-py3-none-any.whl", hash = "sha256:93de0c98785b27fcf659856aa9f54bfbd399e29969b0621bc7f762bd441b4539"}, + {file = "tenacity-9.0.0.tar.gz", hash = "sha256:807f37ca97d62aa361264d497b0e31e92b8027044942bfa756160d908320d73b"}, +] + +[package.extras] +doc = ["reno", "sphinx"] +test = ["pytest", "tornado (>=4.5)", "typeguard"] + +[[package]] +name = "textdistance" +version = "4.6.3" +description = "Compute distance between the two texts." +optional = false +python-versions = ">=3.5" +files = [ + {file = "textdistance-4.6.3-py3-none-any.whl", hash = "sha256:0cb1b2cc8e3339ddc3e0f8c870e49fb49de6ecc42a718917308b3c971f34aa56"}, + {file = "textdistance-4.6.3.tar.gz", hash = "sha256:d6dabc50b4ea832cdcf0e1e6021bd0c7fcd9ade155888d79bb6a3c31fce2dc6f"}, +] + +[package.extras] +all = ["Levenshtein", "distance", "jellyfish", "numpy", "py-stringmatching", "pylev", "pyxDamerauLevenshtein", "rapidfuzz (>=2.6.0)", "tabulate"] +benchmark = ["Levenshtein", "distance", "jellyfish", "numpy", "py-stringmatching", "pylev", "pyxDamerauLevenshtein", "rapidfuzz (>=2.6.0)", "tabulate"] +benchmarks = ["Levenshtein", "distance", "jellyfish", "numpy", "py-stringmatching", "pylev", "pyxDamerauLevenshtein", "rapidfuzz (>=2.6.0)", "tabulate"] +common = ["Levenshtein", "jellyfish", "numpy", "pyxDamerauLevenshtein", "rapidfuzz (>=2.6.0)"] +dameraulevenshtein = ["jellyfish", "pyxDamerauLevenshtein", "rapidfuzz (>=2.6.0)"] +extra = ["Levenshtein", "jellyfish", "numpy", "pyxDamerauLevenshtein", "rapidfuzz (>=2.6.0)"] +extras = ["Levenshtein", "jellyfish", "numpy", "pyxDamerauLevenshtein", "rapidfuzz (>=2.6.0)"] +hamming = ["Levenshtein", "distance", "jellyfish", "rapidfuzz (>=2.6.0)"] +jaro = ["Levenshtein", "rapidfuzz (>=2.6.0)"] +jarowinkler = ["jellyfish", "rapidfuzz (>=2.6.0)"] +levenshtein = ["Levenshtein", "rapidfuzz (>=2.6.0)"] +lint = ["flake8", "flake8-blind-except", "flake8-bugbear", "flake8-commas", "flake8-logging-format", "flake8-mutable", "flake8-pep3101", "flake8-quotes", "flake8-string-format", "flake8-tidy-imports", "isort", "mypy", "pep8-naming", "twine", "types-tabulate"] +test = ["hypothesis", "isort", "numpy", "pytest"] + [[package]] name = "tornado" version = "6.4.2" @@ -1283,6 +1696,27 @@ files = [ {file = "tornado-6.4.2.tar.gz", hash = "sha256:92bad5b4746e9879fd7bf1eb21dce4e3fc5128d71601f80005afa39237ad620b"}, ] +[[package]] +name = "tqdm" +version = "4.67.1" +description = "Fast, Extensible Progress Meter" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2"}, + {file = "tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +dev = ["nbval", "pytest (>=6)", "pytest-asyncio (>=0.24)", "pytest-cov", "pytest-timeout"] +discord = ["requests"] +notebook = ["ipywidgets (>=6)"] +slack = ["slack-sdk"] +telegram = ["requests"] + [[package]] name = "traitlets" version = "5.14.3" @@ -1309,6 +1743,34 @@ files = [ {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] +[[package]] +name = "tzdata" +version = "2025.1" +description = "Provider of IANA time zone data" +optional = false +python-versions = ">=2" +files = [ + {file = "tzdata-2025.1-py2.py3-none-any.whl", hash = "sha256:7e127113816800496f027041c570f50bcd464a020098a3b6b199517772303639"}, + {file = "tzdata-2025.1.tar.gz", hash = "sha256:24894909e88cdb28bd1636c6887801df64cb485bd593f2fd83ef29075a81d694"}, +] + +[[package]] +name = "urllib3" +version = "2.3.0" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.9" +files = [ + {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, + {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + [[package]] name = "wcwidth" version = "0.2.13" @@ -1419,4 +1881,4 @@ propcache = ">=0.2.0" [metadata] lock-version = "2.0" python-versions = "~3.10" -content-hash = "480e9e936e17d5ad8ba3d0cb6daf3cd55bb9477d6813fbf138c1c9283e3cd8cd" +content-hash = "b294cb00887149f4bba19e09a290c509535ce8375c270266e7bf385e594d5594" diff --git a/Chapter10/pyproject.toml b/Chapter10/pyproject.toml index 07cd04d..cc1ce66 100644 --- a/Chapter10/pyproject.toml +++ b/Chapter10/pyproject.toml @@ -12,6 +12,8 @@ ipykernel = ">=6.0.0" networkx = ">=3.2.0" neo4j = ">=4.2.0" gremlinpython = ">=3.4.6" +graphdatascience = "^1.14" +pandas = "^2.2.3" [build-system] requires = ["poetry-core"] diff --git a/Chapter10/requirements.txt b/Chapter10/requirements.txt index 71e8f7a..3b99f44 100644 --- a/Chapter10/requirements.txt +++ b/Chapter10/requirements.txt @@ -1,51 +1,64 @@ -aenum==3.1.15 ; python_version >= "3.10" and python_version < "3.11" -aiohappyeyeballs==2.4.4 ; python_version >= "3.10" and python_version < "3.11" -aiohttp==3.11.11 ; python_version >= "3.10" and python_version < "3.11" -aiosignal==1.3.2 ; python_version >= "3.10" and python_version < "3.11" -appnope==0.1.4 ; python_version >= "3.10" and python_version < "3.11" and platform_system == "Darwin" -asttokens==3.0.0 ; python_version >= "3.10" and python_version < "3.11" -async-timeout==4.0.3 ; python_version >= "3.10" and python_version < "3.11" -attrs==24.3.0 ; python_version >= "3.10" and python_version < "3.11" -cffi==1.17.1 ; python_version >= "3.10" and python_version < "3.11" and implementation_name == "pypy" -colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.11" and sys_platform == "win32" -comm==0.2.2 ; python_version >= "3.10" and python_version < "3.11" -debugpy==1.8.11 ; python_version >= "3.10" and python_version < "3.11" -decorator==5.1.1 ; python_version >= "3.10" and python_version < "3.11" -exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11" -executing==2.1.0 ; python_version >= "3.10" and python_version < "3.11" -frozenlist==1.5.0 ; python_version >= "3.10" and python_version < "3.11" -gremlinpython==3.7.3 ; python_version >= "3.10" and python_version < "3.11" -idna==3.10 ; python_version >= "3.10" and python_version < "3.11" -ipykernel==6.29.5 ; python_version >= "3.10" and python_version < "3.11" -ipython==8.31.0 ; python_version >= "3.10" and python_version < "3.11" -isodate==0.7.2 ; python_version >= "3.10" and python_version < "3.11" -jedi==0.19.2 ; python_version >= "3.10" and python_version < "3.11" -jupyter-client==8.6.3 ; python_version >= "3.10" and python_version < "3.11" -jupyter-core==5.7.2 ; python_version >= "3.10" and python_version < "3.11" -matplotlib-inline==0.1.7 ; python_version >= "3.10" and python_version < "3.11" -multidict==6.1.0 ; python_version >= "3.10" and python_version < "3.11" -neo4j==5.27.0 ; python_version >= "3.10" and python_version < "3.11" -nest-asyncio==1.6.0 ; python_version >= "3.10" and python_version < "3.11" -networkx==3.4.2 ; python_version >= "3.10" and python_version < "3.11" -packaging==24.2 ; python_version >= "3.10" and python_version < "3.11" -parso==0.8.4 ; python_version >= "3.10" and python_version < "3.11" -pexpect==4.9.0 ; python_version >= "3.10" and python_version < "3.11" and (sys_platform != "win32" and sys_platform != "emscripten") -platformdirs==4.3.6 ; python_version >= "3.10" and python_version < "3.11" -prompt-toolkit==3.0.48 ; python_version >= "3.10" and python_version < "3.11" -propcache==0.2.1 ; python_version >= "3.10" and python_version < "3.11" -psutil==6.1.1 ; python_version >= "3.10" and python_version < "3.11" -ptyprocess==0.7.0 ; python_version >= "3.10" and python_version < "3.11" and (sys_platform != "win32" and sys_platform != "emscripten") -pure-eval==0.2.3 ; python_version >= "3.10" and python_version < "3.11" -pycparser==2.22 ; python_version >= "3.10" and python_version < "3.11" and implementation_name == "pypy" -pygments==2.19.0 ; python_version >= "3.10" and python_version < "3.11" -python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "3.11" -pytz==2024.2 ; python_version >= "3.10" and python_version < "3.11" -pywin32==308 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.10" and python_version < "3.11" -pyzmq==26.2.0 ; python_version >= "3.10" and python_version < "3.11" -six==1.17.0 ; python_version >= "3.10" and python_version < "3.11" -stack-data==0.6.3 ; python_version >= "3.10" and python_version < "3.11" -tornado==6.4.2 ; python_version >= "3.10" and python_version < "3.11" -traitlets==5.14.3 ; python_version >= "3.10" and python_version < "3.11" -typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "3.11" -wcwidth==0.2.13 ; python_version >= "3.10" and python_version < "3.11" -yarl==1.18.3 ; python_version >= "3.10" and python_version < "3.11" +aenum==3.1.15 ; python_version == "3.10" +aiohappyeyeballs==2.4.4 ; python_version == "3.10" +aiohttp==3.11.11 ; python_version == "3.10" +aiosignal==1.3.2 ; python_version == "3.10" +appnope==0.1.4 ; platform_system == "Darwin" and python_version == "3.10" +asttokens==3.0.0 ; python_version == "3.10" +async-timeout==4.0.3 ; python_version == "3.10" +attrs==24.3.0 ; python_version == "3.10" +certifi==2025.1.31 ; python_version == "3.10" +cffi==1.17.1 ; implementation_name == "pypy" and python_version == "3.10" +charset-normalizer==3.4.1 ; python_version == "3.10" +colorama==0.4.6 ; python_version == "3.10" and (sys_platform == "win32" or platform_system == "Windows") +comm==0.2.2 ; python_version == "3.10" +debugpy==1.8.11 ; python_version == "3.10" +decorator==5.1.1 ; python_version == "3.10" +exceptiongroup==1.2.2 ; python_version == "3.10" +executing==2.1.0 ; python_version == "3.10" +frozenlist==1.5.0 ; python_version == "3.10" +graphdatascience==1.14 ; python_version == "3.10" +gremlinpython==3.7.3 ; python_version == "3.10" +idna==3.10 ; python_version == "3.10" +ipykernel==6.29.5 ; python_version == "3.10" +ipython==8.31.0 ; python_version == "3.10" +isodate==0.7.2 ; python_version == "3.10" +jedi==0.19.2 ; python_version == "3.10" +jupyter-client==8.6.3 ; python_version == "3.10" +jupyter-core==5.7.2 ; python_version == "3.10" +matplotlib-inline==0.1.7 ; python_version == "3.10" +multidict==6.1.0 ; python_version == "3.10" +multimethod==2.0 ; python_version == "3.10" +neo4j==5.27.0 ; python_version == "3.10" +nest-asyncio==1.6.0 ; python_version == "3.10" +networkx==3.4.2 ; python_version == "3.10" +numpy==2.2.3 ; python_version == "3.10" +packaging==24.2 ; python_version == "3.10" +pandas==2.2.3 ; python_version == "3.10" +parso==0.8.4 ; python_version == "3.10" +pexpect==4.9.0 ; sys_platform != "win32" and sys_platform != "emscripten" and python_version == "3.10" +platformdirs==4.3.6 ; python_version == "3.10" +prompt-toolkit==3.0.48 ; python_version == "3.10" +propcache==0.2.1 ; python_version == "3.10" +psutil==6.1.1 ; python_version == "3.10" +ptyprocess==0.7.0 ; sys_platform != "win32" and sys_platform != "emscripten" and python_version == "3.10" +pure-eval==0.2.3 ; python_version == "3.10" +pyarrow==19.0.1 ; python_version == "3.10" +pycparser==2.22 ; implementation_name == "pypy" and python_version == "3.10" +pygments==2.19.0 ; python_version == "3.10" +python-dateutil==2.9.0.post0 ; python_version == "3.10" +pytz==2024.2 ; python_version == "3.10" +pywin32==308 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version == "3.10" +pyzmq==26.2.0 ; python_version == "3.10" +requests==2.32.3 ; python_version == "3.10" +six==1.17.0 ; python_version == "3.10" +stack-data==0.6.3 ; python_version == "3.10" +tenacity==9.0.0 ; python_version == "3.10" +textdistance==4.6.3 ; python_version == "3.10" +tornado==6.4.2 ; python_version == "3.10" +tqdm==4.67.1 ; python_version == "3.10" +traitlets==5.14.3 ; python_version == "3.10" +typing-extensions==4.12.2 ; python_version == "3.10" +tzdata==2025.1 ; python_version == "3.10" +urllib3==2.3.0 ; python_version == "3.10" +wcwidth==0.2.13 ; python_version == "3.10" +yarl==1.18.3 ; python_version == "3.10"