Connectez votre Données Procore en téléchargeant Analytics Maquettes
Steps
Cette méthode de connexion est généralement utilisée par les professionnels de la donnée.
Create Credentials File
Run user_exp.py script
Run as PySpark
Run as Python
Choose Your Own Method
Create Credentials File
You must first generate a data token within the Procore web application. See Generate Access Token.
Create a file called config.share.
Add the fields below:
{
"shareCredentialsVersion": 1,
"bearerToken": "",
"endpoint": "",
"expirationTime": ""
}Add the Bearer Token, Endpoint, Share Credentials Version, and Expiration Time values received from Procore to the config.share file.
Run user_exp.py script
You can use the following scripts to create a config.yaml file with the necessary configurations.
For Azure Storage:
cron_job: #true/false
run_as: #pyspark/python
source_config:
config_path: #path to the config.share file
tables:
- '' # table name if you want to download a specific table. Leave it empty if you want to download all tables
source_type: delta_share
target_config:
auth_type: service_principal
client_id: #client_id
secret_id: #secret_id
storage_account: #storage-account name
storage_path: #@.dfs.core.windows.net/
enant_id: #tenant_id
target_type: azure_storageFor MSSQL DB:
cron_job: #true/false
run_as: #pyspark/python
source_config:
config_path: #path to the config.share file
tables:
- '' # table name if you want to download a specific table. Leave it empty if you want to download all tables
source_type: delta_share
target_config:
database: #target database
host: #target hostname:port
password: #password
schema: #target schema (default to procore_analytics)
username: #username
target_type: sql_server
Run as PySpark
If your environment is already set up with Spark, choose the 'pyspark' option when requested or once the 'config.yaml' is generated, you can run the following commands to download the reports to the data directory.
For Writing to ADLS Gen2 Storage:
spark-submit --packages io.delta:delta-sharing-spark_2.12:3.1.0,org.apache.hadoop:hadoop-azure:3.4.0,com.microsoft.azure:azure-storage:8.6.6,org.apache.hadoop:hadoop-common:3.4.0 --exclude-packages com.sun.xml.bind:jaxb-impl delta_share_to_sql_spark.pyFor Writing to MSSQL DB:
spark-submit --packages io.delta:delta-sharing-spark_2.12:3.1.0 --jars mssql -jdbc jar> delta_share_to_sql_spark.py
Run as Python
From the command line, navigate to the folder by entering the “cd ” command.
Install required packages using “pip install -r requirements.txt” or “python -m pip install -r requirements.txt”.
Execute the command python delta_share_to_azure_pandy.py.
Using SSIS
Open SSIS and create a new project.
From the SSIS Toolbox drag and drop Execute Process Task.
Double click Execute Process Task.
Go to the Process tab.
Next to Executable, enter the path to python.exe in the Python installation folder.
In WorkingDirectory, enter the path to the folder containing the script you want to execute (without the script file name).
In Arguments, enter the name of the script delta_share_to_azure_panda.py you want to execute with the .py extension and click Save.
Click Start in the top ribbon menu.
During the execution of the task, the output of the Python console is displayed in the external console window.
Once the task is done it will display a checkmark.
Choose Your Own Method
Delta Sharing is an open protocol for secure data sharing. You can find the public GitHub repository for Delta Sharing at https://github.com/delta-io/delta-sharing. The repository includes examples and documentation for accessing shared data using various languages such as Python and Spark Connector (SQL, Python, Scala, Java, R).
Assurez-vous que vous disposez des autorisations et des droits d’accès appropriés pour télécharger les fichiers requis et exécuter des conteneurs Docker sur votre système. Suivez toujours les sécurité bonnes pratiques et directives fournies par Procore lorsque vous manipulez des données et des identifiants sensibles.