Getting started
Installation
To install py-PileCore, we strongly recommend using Python Package Index (PyPI). You can install py-PileCore with:
pip install py-pilecore
Guided usage
Getting started with pypilecore
is easy done by importing the pypilecore
library:
In [1]: import pypilecore
or any equivalent import
statement.
Create payload
If you’re not so comfortable with creating your own schema’s the SDK
provides usefully functions to creates a dictionary with the payload
content for the PileCore endpoints. You can find the function at
pypilecore.input
. Please read the reference page for more information:
from pypilecore.input import create_multi_cpt_payload
multi_cpt_payload, passover = create_multi_cpt_payload(
pile_tip_levels_nap: [0, -1, -2, -3],
cptdata_objects: [cpt],
classify_tables: classify,
groundwater_level_nap: -1,
friction_range_strategy: "lower_bound",
pile_type: "A",
specification: "concrete",,
installation: "1",
pile_shape: "rect",
)
Call endpoint
With the created payload and nuclei.client it is possible to create a request. SDK provides functions to assist with this process:
from nuclei.client import NucleiClient
from pypilecore.api import get_multi_cpt_api_result
client = NucleiClient()
response = get_multi_cpt_api_result(client, multi_cpt_payload)
Create results
To help the user with generating tables and plots based on the response of the API call the SDK provides classes that store the data in a structured way.
from pypilecore.results import MultiCPTBearingResults
result = MultiCPTBearingResults.from_api_response(response, passover)