diff --git a/Tutorial 3 - Virtual Offices.ipynb b/Tutorial 3 - Virtual Offices.ipynb
new file mode 100644
index 0000000..80a1021
--- /dev/null
+++ b/Tutorial 3 - Virtual Offices.ipynb
@@ -0,0 +1,1218 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "b2110da7",
+ "metadata": {},
+ "source": [
+ "*In this tutorial we will investigate addresses with a large number of companies registered via the API and Companies House Data Product download.*"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "25528662",
+ "metadata": {},
+ "source": [
+ "### Busy Addresses and API Limits"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "ab9e8ee0",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from sugartrail import base, api, mapview\n",
+ "import pandas as pd\n",
+ "api.basic_auth.username = \"\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "00c6a5be",
+ "metadata": {},
+ "source": [
+ "When navigating Companies House there are times that we will run into some very popular addresses. For example lets say build a network from [this officer](https://find-and-update.company-information.service.gov.uk/officers/Nd2URspq4bvLy-hwzDZ0_p7FGJw/appointments):"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "723f234a",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hop number: 2\n",
+ "Processed 12/12 addresses.\n",
+ "Processed 30/30 companies.\n"
+ ]
+ }
+ ],
+ "source": [
+ "officer_id = \"Nd2URspq4bvLy-hwzDZ0_p7FGJw\"\n",
+ "network = base.Network(officer_id=officer_id)\n",
+ "network.perform_hop(2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "edad561e",
+ "metadata": {},
+ "source": [
+ "Within 2 hops we've got over 60 addresses (although many of them look like duplicate entries):"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "eea32631",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " address | \n",
+ " n | \n",
+ " link_type | \n",
+ " node_type | \n",
+ " node | \n",
+ " lat | \n",
+ " lon | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 3rd Floor 13 Charles Ii Street London SW1Y 4QU... | \n",
+ " 1 | \n",
+ " Appointment Address | \n",
+ " Person | \n",
+ " Nd2URspq4bvLy-hwzDZ0_p7FGJw | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 13 Charles Ii Street 3rd Floor London SW1Y 4QU... | \n",
+ " 1 | \n",
+ " Appointment Address | \n",
+ " Person | \n",
+ " Nd2URspq4bvLy-hwzDZ0_p7FGJw | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 8 Segedunum Business Centre Station Road Walls... | \n",
+ " 1 | \n",
+ " Appointment Address | \n",
+ " Person | \n",
+ " Nd2URspq4bvLy-hwzDZ0_p7FGJw | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 220 Wards Road Ilford IG2 7DY England | \n",
+ " 1 | \n",
+ " Appointment Address | \n",
+ " Person | \n",
+ " Nd2URspq4bvLy-hwzDZ0_p7FGJw | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 8 Segedunum Business Centre Station Road Walls... | \n",
+ " 1 | \n",
+ " Appointment Address | \n",
+ " Person | \n",
+ " Nd2URspq4bvLy-hwzDZ0_p7FGJw | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " | 175 | \n",
+ " 7 Segedunum Business Centre Station Road Walls... | \n",
+ " 2 | \n",
+ " Historic Address | \n",
+ " Company | \n",
+ " 08785140 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 176 | \n",
+ " 31a Station Road Whitley Bay Tyne and Wear NE2... | \n",
+ " 2 | \n",
+ " Historic Address | \n",
+ " Company | \n",
+ " 08785140 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 177 | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH | \n",
+ " 2 | \n",
+ " Historic Address | \n",
+ " Company | \n",
+ " 08785140 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 178 | \n",
+ " Overseas House 66-68 High Road Bushey Heath Bu... | \n",
+ " 2 | \n",
+ " Historic Address | \n",
+ " Company | \n",
+ " 08785140 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " | 179 | \n",
+ " Conveyit House 28 Coity Road Bridgend Mid Gla... | \n",
+ " 2 | \n",
+ " Historic Address | \n",
+ " Company | \n",
+ " 08785140 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
180 rows × 7 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " address n \\\n",
+ "0 3rd Floor 13 Charles Ii Street London SW1Y 4QU... 1 \n",
+ "1 13 Charles Ii Street 3rd Floor London SW1Y 4QU... 1 \n",
+ "2 8 Segedunum Business Centre Station Road Walls... 1 \n",
+ "3 220 Wards Road Ilford IG2 7DY England 1 \n",
+ "4 8 Segedunum Business Centre Station Road Walls... 1 \n",
+ ".. ... .. \n",
+ "175 7 Segedunum Business Centre Station Road Walls... 2 \n",
+ "176 31a Station Road Whitley Bay Tyne and Wear NE2... 2 \n",
+ "177 3rd Floor, 207 Regent Street London W1B 3HH 2 \n",
+ "178 Overseas House 66-68 High Road Bushey Heath Bu... 2 \n",
+ "179 Conveyit House 28 Coity Road Bridgend Mid Gla... 2 \n",
+ "\n",
+ " link_type node_type node lat lon \n",
+ "0 Appointment Address Person Nd2URspq4bvLy-hwzDZ0_p7FGJw NaN NaN \n",
+ "1 Appointment Address Person Nd2URspq4bvLy-hwzDZ0_p7FGJw NaN NaN \n",
+ "2 Appointment Address Person Nd2URspq4bvLy-hwzDZ0_p7FGJw NaN NaN \n",
+ "3 Appointment Address Person Nd2URspq4bvLy-hwzDZ0_p7FGJw NaN NaN \n",
+ "4 Appointment Address Person Nd2URspq4bvLy-hwzDZ0_p7FGJw NaN NaN \n",
+ ".. ... ... ... ... ... \n",
+ "175 Historic Address Company 08785140 NaN NaN \n",
+ "176 Historic Address Company 08785140 NaN NaN \n",
+ "177 Historic Address Company 08785140 NaN NaN \n",
+ "178 Historic Address Company 08785140 NaN NaN \n",
+ "179 Historic Address Company 08785140 NaN NaN \n",
+ "\n",
+ "[180 rows x 7 columns]"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "network.addresses"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "7ce897c0",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array(['3rd Floor 13 Charles Ii Street London SW1Y 4QU England',\n",
+ " '13 Charles Ii Street 3rd Floor London SW1Y 4QU England',\n",
+ " '8 Segedunum Business Centre Station Road Wallsend NE28 6HQ United Kingdom',\n",
+ " '220 Wards Road Ilford IG2 7DY England',\n",
+ " '8 Segedunum Business Centre Station Road Wallsend NE28 6HQ England',\n",
+ " 'Burnards Accountants 8 Segedunum Business Centre Wallsend NE28 6HQ England',\n",
+ " '220 Consultancy House Ilford IG2 7DY England',\n",
+ " '220 Consultancy House Ilford IG2 7DY United Kingdom',\n",
+ " 'Burnard Accountants, 8 Bankside Building Segedunum Business Centre Wallsend NE28 6HQ United Kingdom',\n",
+ " '8 Bankside Bldg Segedunum Business Centre Station Road Wallsend NE28 6HQ England',\n",
+ " '3rd Floor, 207 Regent Street London W1B 3HH England',\n",
+ " '73 Ingelow Road London SW8 3PE England',\n",
+ " 'Burnard Accountants 8 Bankside Building Segedunum Business Centre Wallsend NE28 6HQ United Kingdom',\n",
+ " '220 Consultancy House Wards Road Ilford IG2 7DY',\n",
+ " 'Burnard Accountants 8 Bankside Building Segedunum Business Centre Station Road Wallsend Tyne & Wear NE28 6HQ United Kingdom',\n",
+ " '220 Consultancy House Ilford IG2 7DY',\n",
+ " 'Lower Ground Floor One George Yard London EC3V 9DF United Kingdom',\n",
+ " '41 Chalton Street London NW1 1JD United Kingdom',\n",
+ " '220 Consultancy House Wards Road Ilford Essex IG2 7DY United Kingdom',\n",
+ " 'Burnards Accountant 8a Segedunum Way Wallsend Tyne and Wear NE28 8JN United Kingdom',\n",
+ " '41 Chalton Street London NW1 1JD',\n",
+ " '8 Bankside Building Segedunum Business Centre Station Road Wallsend NE28 6HQ United Kingdom',\n",
+ " '220 Consultancy House Wards Road Ilford Essex IG2 7DY England',\n",
+ " 'Burnards Accountant 8 Segedunum Way Wallsend Tyne and Wear NE28 8JN United Kingdom',\n",
+ " '8 Bankside Bulding Segedunum Business Centre Wallsend NE28 6HQ United Kingdom',\n",
+ " 'Lower Ground Floor One George Yard London EC3V 9DF',\n",
+ " '8 Segedunum Business Centre Station Rd, Wallsend NE28 6HQ United Kingdom',\n",
+ " '8a Segedunum Way Wallsend Tyne and Wear NE28 8JN United Kingdom',\n",
+ " '31a Station Road Whitley Bay NE26 2QZ England',\n",
+ " '25 Dulverton Court Adderstone Crescent Newcastle upon Tyne NE2 2HS United Kingdom',\n",
+ " '3rd Floor 207 Regent Street London W1B 3HH United Kingdom',\n",
+ " 'Universal Company Incorporations Ltd Office 3, Second Floor North Merrion Avenue HA7 4RY United Kingdom',\n",
+ " '8 Bankside Buildng Segedunum Business Centre Station Road Wallsend NE28 6HQ United Kingdom',\n",
+ " '207 Regent Street London W1B 3HH United Kingdom',\n",
+ " 'Consultancy House Ilford IG2 7DY United Kingdom',\n",
+ " 'Burnards Accountants 8 Segedunum Business Centre Station Road Wallsend NE28 6HQ England',\n",
+ " '8 Segedunum Business Centre Burnards Accountants Station Road Wallsend NE28 6HQ England',\n",
+ " 'Overseas House 66-68 Bushey WD23 1GG England',\n",
+ " 'Peine House Hind Hill Street Heywood OL10 1JZ England',\n",
+ " 'Conveyit House 28 Coity Road Bridgend CF31 1LR',\n",
+ " '3 rd Floor 207 Regent Street London W1B 3HH',\n",
+ " '3 Rd Floor 207 Regent Street London W1B 3HH England',\n",
+ " 'Overseas House 66-68 High Road Bushey Heath Bushey WD23 1GG',\n",
+ " ' Conveyit House 28 Coity Road Bridgend Mid Glamorgan CF31 1LR',\n",
+ " ' 10-12 Dunraven Place Bridgend Mid Glamorgan CF31 1JD United Kingdom',\n",
+ " '3 rd Floor 207 Regent Street London W1B 3HH England',\n",
+ " ' Conveyit House 28 Coity Road Bridgend Mid Glamorgan CF31 1LR United Kingdom',\n",
+ " 'Conveyit House 28 Coity Road Bridgend CF31 1LR United Kingdom',\n",
+ " ' Conveyit House 28 Coity Road Bridgend Mid Glamorgan CF31 1LR Wales',\n",
+ " '8 Segendunum Business Centre Station Road Wallsend NE28 6HQ United Kingdom',\n",
+ " 'Burnard Accountants, 8 Bankside Building Segedunum Business Centre Station Road Wallsend Tyne & Wear NE28 6HQ United Kingdom',\n",
+ " '8 Bankside Bldg Segedunum Business Centre C/O Burnard Accountants Wallsend NE28 6HQ England',\n",
+ " '207 Regent Street London W1B 3HH Great Britain',\n",
+ " '8 Bankside Bldg Segedunum Business Centre C/O Burnard Accountants Station Road Wallsend Tyne & Wear NE28 6HQ England',\n",
+ " '7 Segedunum Business Centre Station Road Wallsend NE28 6HQ United Kingdom',\n",
+ " '31a Station Road Whitley Bay Tyne and Wear NE26 2QZ',\n",
+ " 'Third Floor 207 Regent Street London W1B 3HH United Kingdom',\n",
+ " '5 Temple Square Temple Street Liverpool L2 5RH',\n",
+ " 'Conveyit House 28 Bridgend CF31 1LR United Kingdom',\n",
+ " 'C/O BDO LLP Liverpool L2 5RH',\n",
+ " 'C/O Bdo Llp 2nd Floor 2 City Place Beehive Ring Road Gatwick RH6 0PA',\n",
+ " '31a Station Road Whitley Bay Tyne and Wear NE26 2QZ England',\n",
+ " '3rd Floor, 207 Regent Street London W1B 3HH',\n",
+ " '73 High Street High Street Kingston Upon Thames KT1 4DA England',\n",
+ " '8 Segedunum Business Centre Wallsend NE28 6HQ England',\n",
+ " '2nd Floor, 2 City Place Beehive Ring Road Gatwick RH6 0PA'],\n",
+ " dtype=object)"
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "network.addresses['address'].unique()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8c17fff5",
+ "metadata": {},
+ "source": [
+ "If we check out the `maxsize_entities` property of our Network class, we will see a dataframe containing all of the addresses and officers that have exceeded the maxsize limits imposed in the Hop class. In this case, we can see one of the addresses in the network has over 4800 companies based there."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "8b8d3c20",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " node | \n",
+ " type | \n",
+ " maxsize_type | \n",
+ " size | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ " Address | \n",
+ " Companies | \n",
+ " 4814 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " node type maxsize_type \\\n",
+ "0 3rd Floor, 207 Regent Street London W1B 3HH En... Address Companies \n",
+ "\n",
+ " size \n",
+ "0 4814 "
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "network.maxsize_entities"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5ad7b443",
+ "metadata": {},
+ "source": [
+ "Because we set a limit of 500 companies on the maxsize of companies returned via `companies_at_address_maxsize`, these companies will not be added to `companies_id`."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "4f94f731",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "500"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "network.hop.companies_at_address_maxsize"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2d4edaf0",
+ "metadata": {},
+ "source": [
+ "If we check `companies_id` we'll notice it hasn't had 4800 companies added to it:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "e3ef12fe",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "314"
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "len(network.company_ids['company_id'].unique())"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d177f1b5",
+ "metadata": {},
+ "source": [
+ "Including limits is useful to avoid our databases getting clogged up with random companies. \n",
+ "Although lets pause to briefly explore what address would have thousands of companies registered there?"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "8bb8bdf1",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "'3rd Floor, 207 Regent Street London W1B 3HH England'"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "network.maxsize_entities['node'][0]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e8644d6b",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "40354a28",
+ "metadata": {},
+ "source": [
+ "\"3rd Floor, 207, Regent Street\" is a \"virtual office\" run by a company called [Hold Everything](https://www.hold-everything.com/). Businesses can use this address for correspondance/registration for £24 a month:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "11b08c79",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2c9e85ed",
+ "metadata": {},
+ "source": [
+ "However the large number of companies registered at a single address can lead to many instances of mistaken identity. Just because a company is registered at a virtual office does not mean it has any connection with other companies registered there.:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "be5e4352",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "282ba8ea",
+ "metadata": {},
+ "source": [
+ "Numerous media outlets have reported on fraudulent companies that use virtual offices and incorporation services: \n",
+ "- Kemp House, 162 City Road | Capital Officer: [Mystery group took millions in furlough funds - Financial Times](https://www.ft.com/content/b3c70369-5170-47ca-b779-fc0898fd29e6)\n",
+ "- 20-22 Wenlock Road | Made Simple: [Court shuts down companies behind £9m truffle scam - Gov.uk](https://www.gov.uk/government/news/court-shuts-down-companies-behind-9m-truffle-scam)\n",
+ "- 2 Woodberry Down | A1 Company Services [How A Suburban North London House Is Connected To The Paul Manafort Indictment - Huffington Post](https://www.huffingtonpost.co.uk/entry/manfort-london-connection_uk_59f72f50e4b07fdc5fbf92c7)\n",
+ "- 29 Harley Street | Formations House [Offshore in central London: the curious case of 29 Harley Street - The Guardian](https://www.theguardian.com/business/2016/apr/19/offshore-central-london-curious-case-29-harley-street)\n",
+ "- 63-66 Hatton Garden | Valemont Properties Ltd [The Global Laundromat: how did it work and who benefited? - The Guardian](https://www.theguardian.com/world/2017/mar/20/the-global-laundromat-how-did-it-work-and-who-benefited)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a85fdcfa",
+ "metadata": {},
+ "source": [
+ "If we wanted to get all companies listed at 207 Regent Street we can adjust our maxsize limits to `None` and attempt to perform a hop again:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "eb0c02d0",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hop number: 1\n",
+ "Processed 1/1 addresses.\n"
+ ]
+ }
+ ],
+ "source": [
+ "regent_street_network = base.Network(address='3rd Floor, 207 Regent Street London W1B 3HH England')\n",
+ "regent_street_network.hop.companies_at_address_maxsize = None\n",
+ "regent_street_network.hop.officers_at_address_maxsize = None\n",
+ "regent_street_network.perform_hop(1)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "3dc0f165",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " company_id | \n",
+ " n | \n",
+ " link_type | \n",
+ " node_type | \n",
+ " node | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 07865698 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 05986906 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 07928516 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 07957453 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 07976984 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " | 4809 | \n",
+ " 11119773 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 4810 | \n",
+ " 11277628 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 4811 | \n",
+ " 12614345 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 4812 | \n",
+ " 14527928 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ " | 4813 | \n",
+ " 06926076 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 3rd Floor, 207 Regent Street London W1B 3HH En... | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
4814 rows × 5 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " company_id n link_type node_type \\\n",
+ "0 07865698 1 Company at Address Address \n",
+ "1 05986906 1 Company at Address Address \n",
+ "2 07928516 1 Company at Address Address \n",
+ "3 07957453 1 Company at Address Address \n",
+ "4 07976984 1 Company at Address Address \n",
+ "... ... .. ... ... \n",
+ "4809 11119773 1 Company at Address Address \n",
+ "4810 11277628 1 Company at Address Address \n",
+ "4811 12614345 1 Company at Address Address \n",
+ "4812 14527928 1 Company at Address Address \n",
+ "4813 06926076 1 Company at Address Address \n",
+ "\n",
+ " node \n",
+ "0 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "1 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "2 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "3 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "4 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "... ... \n",
+ "4809 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "4810 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "4811 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "4812 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "4813 3rd Floor, 207 Regent Street London W1B 3HH En... \n",
+ "\n",
+ "[4814 rows x 5 columns]"
+ ]
+ },
+ "execution_count": 11,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "regent_street_network.company_ids"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cff1061e",
+ "metadata": {},
+ "source": [
+ "Such large networks can still be interesting to analyse. For instance if we perform another hop this will get all the officers for every company at the address. This will take several hours to build as we have lots of companies to analyse, however if we want to save time we could just uncomment and load a pre-made network below: "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "ef262359",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hop number: 1\n",
+ "Processed 0/0 addresses.\n",
+ "Processed 4814/4814 companies.\n",
+ "Processed 12/12 officers.\n"
+ ]
+ }
+ ],
+ "source": [
+ "regent_street_network.perform_hop(1)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "38937142",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# import pickle\n",
+ "# with open('assets/networks/regent_street_network.pickle', 'rb') as handle:\n",
+ "# regent_street_network = pickle.load(handle)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d6e330ee",
+ "metadata": {},
+ "source": [
+ "Analysing the most frequently occuring officers running businesses from 207 Regent Street returns some very busy officers and incorporation agents:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "4e97fa3b",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "SECRETARIES LIMITED CT 177\n",
+ "Stuart Ralph POPPLETON 61\n",
+ "SECRETARIES LTD. CT 45\n",
+ "Stuart POPPLETON 42\n",
+ "TCS LIMITED HELVE 35\n",
+ " ... \n",
+ "Slawomir Zbigniew GROCHULSKI 1\n",
+ "Adam Kapitan BERGMAN 1\n",
+ "Colum Michael MAKIN 1\n",
+ "Peter Adam ROSE 1\n",
+ "Kamel HAMACHE 1\n",
+ "Name: name, Length: 6636, dtype: int64"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "regent_street_network.officer_ids['name'].value_counts()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d6a22e40",
+ "metadata": {},
+ "source": [
+ "A quick news lookup on two of the officers in the top 5, J. Beardsley of Helve TCS Limited and S. Poppleton reveal these names to be connected to several known instances of fraud:\n",
+ "- [Fraudster duo jailed for their part in defrauding millions of pounds from over 100 victims - Crown Prosecution Service](https://www.cps.gov.uk/cps/news/fraudster-duo-jailed-their-part-defrauding-millions-pounds-over-100-victims)\n",
+ "- [Print farming companies struck off - Printweek](https://www.printweek.com/news/article/print-farming-companies-struck-off)\n",
+ "- [Rogue book publishers slammed shut by the courts - Gov.uk](https://www.gov.uk/government/news/rogue-book-publishers-slammed-shut-by-the-courts)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f0699a27",
+ "metadata": {},
+ "source": [
+ "### Busier Addresses and Downloaded Data"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "944525cb",
+ "metadata": {},
+ "source": [
+ "There are situations where some addresses have thousands or even tens of thousands of companies registered. Companies House provides two methods for getting company data, API and data product. We used the API to get the information above which returns all active and dissolved companies registered to the address. We get the same result when we attempt to perform an advanced company search using this address through the website:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "c307994f",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "517e6aaa",
+ "metadata": {},
+ "source": [
+ "Unfortunately the API is limited to returing 5000 result max. This is fine in our case with 207 Regent Street because we're just under the limit. However there are much bigger fish out there for instance, '75 Shelton Street':"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "1f40ee11",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hop number: 1\n",
+ "Processed 1/1 addresses.\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " node | \n",
+ " type | \n",
+ " maxsize_type | \n",
+ " size | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ " Address | \n",
+ " Companies | \n",
+ " 5000 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " node type maxsize_type \\\n",
+ "0 71-75, Shelton Street, Covent Garden, London, ... Address Companies \n",
+ "\n",
+ " size \n",
+ "0 5000 "
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "shelton_street_network = base.Network(address=\"71-75, Shelton Street, Covent Garden, London, WC2H 9JQ\")\n",
+ "shelton_street_network.perform_hop(1)\n",
+ "shelton_street_network.maxsize_entities"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6f1abb52",
+ "metadata": {},
+ "source": [
+ "We can already see its over 5000 limit for the API. If we check online we can see the number is huge: "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "03b64f03",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "f9fda7a6",
+ "metadata": {},
+ "source": [
+ "This is where the data product comes in. We can download it in one go and use it to get all of the \"active\" companies. To use the data product:\n",
+ "1. Download it from [here](http://download.companieshouse.gov.uk/en_output.html) (might take some time as its a pretty large file ~430Mb)\n",
+ "2. Move it to local directory `assets/company_data/` and unzip the file \n",
+ "3. Load into a dataframe which we can pass to our network class\n",
+ "\n",
+ "Might take a minute to load. How adjust the file string below and attempt to load it into `company_data`:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "9d9d0080",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "company_data = pd.read_csv(\"assets/company_data/BasicCompanyDataAsOneFile-2022-11-01.csv\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2273cf39",
+ "metadata": {},
+ "source": [
+ "Now lets try get every company at the very overcrowded 71-75 Shelton Street address:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "3e273ce0",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hop number: 1\n",
+ "Processed 1/1 addresses.\n"
+ ]
+ }
+ ],
+ "source": [
+ "shelton_street_network = base.Network(address=\"71-75, Shelton Street, Covent Garden, London, WC2H 9JQ\")\n",
+ "shelton_street_network.hop.companies_at_address_maxsize = None\n",
+ "shelton_street_network.hop.officers_at_address_maxsize = None\n",
+ "shelton_street_network.get_officers_at_address = False\n",
+ "shelton_street_network.perform_hop(1, company_data= company_data)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "820a908d",
+ "metadata": {},
+ "source": [
+ "If we check `company_ids` we have over 70000 companies that we could build a network from if we had lots of time on our hands:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "12acb915",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " company_id | \n",
+ " n | \n",
+ " link_type | \n",
+ " node_type | \n",
+ " node | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | 0 | \n",
+ " 02871100 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 1 | \n",
+ " 02965770 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 2 | \n",
+ " 00750593 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 3 | \n",
+ " 12539414 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 4 | \n",
+ " 13326307 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " | 74859 | \n",
+ " 05831239 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 74860 | \n",
+ " 07846404 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 74861 | \n",
+ " 11869215 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 74862 | \n",
+ " 13186788 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ " | 74863 | \n",
+ " 13640888 | \n",
+ " 1 | \n",
+ " Company at Address | \n",
+ " Address | \n",
+ " 71-75, Shelton Street, Covent Garden, London, ... | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
74864 rows × 5 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " company_id n link_type node_type \\\n",
+ "0 02871100 1 Company at Address Address \n",
+ "1 02965770 1 Company at Address Address \n",
+ "2 00750593 1 Company at Address Address \n",
+ "3 12539414 1 Company at Address Address \n",
+ "4 13326307 1 Company at Address Address \n",
+ "... ... .. ... ... \n",
+ "74859 05831239 1 Company at Address Address \n",
+ "74860 07846404 1 Company at Address Address \n",
+ "74861 11869215 1 Company at Address Address \n",
+ "74862 13186788 1 Company at Address Address \n",
+ "74863 13640888 1 Company at Address Address \n",
+ "\n",
+ " node \n",
+ "0 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "1 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "2 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "3 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "4 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "... ... \n",
+ "74859 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "74860 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "74861 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "74862 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "74863 71-75, Shelton Street, Covent Garden, London, ... \n",
+ "\n",
+ "[74864 rows x 5 columns]"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "shelton_street_network.company_ids"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
+ "name": "python3"
+ },
+ "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.9.12"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/assets/networks/regent_street_network.pickle b/assets/networks/regent_street_network.pickle
new file mode 100644
index 0000000..8773df8
Binary files /dev/null and b/assets/networks/regent_street_network.pickle differ