Skip to content

Commit

Permalink
cleaner example
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainHellin committed Aug 22, 2024
1 parent 3737275 commit a425765
Showing 1 changed file with 25 additions and 130 deletions.
155 changes: 25 additions & 130 deletions example.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Example using alasco SDK"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Instantiate the client"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -9,7 +23,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"outputs/2024-08-21 already exist\n"
"outputs/2024-08-22 was created\n"
]
}
],
Expand All @@ -21,140 +35,21 @@
"_ = load_dotenv(find_dotenv(raise_error_if_not_found=True))\n",
"token = os.environ[\"token_test\"]\n",
"key = os.environ[\"key_test\"]\n",
"alasco = Alasco(token=token, key=key, verbose=True, download_path = \"standard\")"
"alasco = Alasco(token=token, key=key, verbose=False, download_path = \"standard\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Fetch property data"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Fetching all properties data.\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/properties/\n",
"\n",
"\n",
"\n",
"Fetching project data for property_ids: ['97bad92e-0fd8-4987-9f8e-aafcd4eafcd7', '6ee2f67d-6911-4085-a7b3-4dbc370f494f', 'e5da38c0-56ff-4f7d-9c9f-686ee173445f', '9a2f99ff-0b80-43c0-a37d-f706fd0058ab', '88dae6d1-58d9-4368-b89c-d8d8ba0b53d3']\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/projects/?filter[property.in]=97bad92e-0fd8-4987-9f8e-aafcd4eafcd7,6ee2f67d\n",
"\n",
"\n",
"\n",
"Fetching contract units with project ids in: ['f9911cbb-3e66-4a0e-9542-443dd47f27cb', 'fcd09ae1-d352-46b7-9948-ba86a88853b3', '3774321a-e524-4995-89b1-dad012e9b5dc'] ...\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/contract_units/?filter[project.in]=f9911cbb-3e66-4a0e-9542-443dd47f27cb,fcd\n",
"\n",
"\n",
"\n",
"Fetching contracts with contract unit ids in: ['d20f1db3-315b-45e0-95e7-08ce1772bdb6', 'd4e7c861-8678-4194-9f91-311741b7bf43', 'f05ec0ba-d9f5-4998-b1e1-6138c2f4ac43'] ...\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/contracts/?filter[contract_unit.in]=d20f1db3-315b-45e0-95e7-08ce1772bdb6,d4\n",
"\n",
"\n",
"\n",
"Fetching contractors with ids in: ['eef20372-e7a8-4304-bc0b-989a57b3aca1', 'e3eea0b2-b688-4d13-9da8-cb0278e31678', '9af63146-a53b-4f53-9fdc-ccff15c9288e'] ...\n",
"--------------------------------------------------\n",
"API call Nr. 1 from 2 to url: https://api.alasco.de/v1/contractors/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/contractors/?filter[id.in]=eef20372-e7a8-4304-bc0b-989a57b3aca1,e3eea0b2-b6\n",
"\n",
"\n",
"\n",
"API call Nr. 2 from 2 to url: https://api.alasco.de/v1/contractors/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/contractors/?filter[id.in]=6283c5ed-6e89-46b5-8404-b82d079ac3ec,85a23104-f9\n",
"\n",
"\n",
"\n",
"API call Nr. 1 from 2 to url: https://api.alasco.de/v1/contractors/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/contractors/?filter[id.in]=eef20372-e7a8-4304-bc0b-989a57b3aca1,e3eea0b2-b6\n",
"\n",
"\n",
"\n",
"API call Nr. 2 from 2 to url: https://api.alasco.de/v1/contractors/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/contractors/?filter[id.in]=6283c5ed-6e89-46b5-8404-b82d079ac3ec,85a23104-f9\n",
"\n",
"\n",
"\n",
"Fetching invoices with contract ids in: ['22fbf7eb-c00e-4d8b-a405-62f8cd580cd7', '440b8ce2-2356-45d6-b630-b422c5f515c2', '96774e3f-a22e-4efe-b5ea-bc0da9c5d93b'] ...\n",
"API call Nr. 1 from 2 to url: https://api.alasco.de/v1/invoices/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/invoices/?filter%5Bcontract.in%5D=22fbf7eb-c00e-4d8b-a405-62f8cd580cd7%2C44\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/invoices/?filter[contract.in]=22fbf7eb-c00e-4d8b-a405-62f8cd580cd7,440b8ce2\n",
"\n",
"\n",
"\n",
"API call Nr. 2 from 2 to url: https://api.alasco.de/v1/invoices/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/invoices/?filter[contract.in]=ff016194-84ea-4cee-b6a1-2a45adac20a8,efdef968\n",
"\n",
"\n",
"\n",
"Fetching change orders belonging to contract ids in: ['22fbf7eb-c00e-4d8b-a405-62f8cd580cd7', '440b8ce2-2356-45d6-b630-b422c5f515c2', '96774e3f-a22e-4efe-b5ea-bc0da9c5d93b'] ...\n",
"API call Nr. 1 from 2 to url: https://api.alasco.de/v1/change_orders/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/change_orders/?filter[contract.in]=22fbf7eb-c00e-4d8b-a405-62f8cd580cd7,440\n",
"\n",
"\n",
"\n",
"API call Nr. 2 from 2 to url: https://api.alasco.de/v1/change_orders/\n",
"\n",
"\n",
"\n",
"--------------------------------------------------\n",
"API call to url: https://api.alasco.de/v1/change_orders/?filter[contract.in]=ff016194-84ea-4cee-b6a1-2a45adac20a8,efd\n",
"\n",
"\n",
"\n"
]
},
{
"data": {
"text/html": [
Expand Down Expand Up @@ -237,7 +132,7 @@
"1 https://api.alasco.de/v1/properties/6ee2f67d-6... "
]
},
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit a425765

Please sign in to comment.