Python SDK for Common Data Model.
Note: These instructions were verified on Windows. For Mac, the steps might change a bit.
- Download Python 3.5.4 x86-64 executable installer from python.org.
- Run the installer. Make sure 'Add Python 3.5 to PATH' checkbox is ticked during installation.
- Open command prompt, change to the cloned repository folder and type
python -m venv envto create a virtual Python environment. - Make sure that you have Visual Studio Code installed. Type
code .to open the folder in Visual Studio Code. - In Visual Studio Code, install the Python extension for VS Code.
- Select
Python: Create Terminalcommand from the Command Palette (Ctrl+Shift+P). From the terminal, typepip3 install -r requirements.txtto install project dependencies. - The project requires some base files that are present in the schemaDocuments folder. Run
python .\setup.py copy_resourcesto copy the necessary files to the project. - To enable debugging of sample code in VSCode, please update your launch.json file with following settings: "cwd": "${workspaceFolder}", "env": { "PYTHONPATH": "${workspaceRoot}" }
Note: If in step 6 on Mac you receive error mentioning TLSV1_ALERT_PROTOCOL_VERSION, you need to upgrade pip with command curl https://bootstrap.pypa.io/get-pip.py | python3 - 'pip==9.0.3' --user, followed by pip3 install --upgrade setuptools --user. Then repeat the command to install all of the project requirements from step 6.