Python Environment#

This guide provides step-by-step instructions to set up a Python virtual environment for developing and running a Dlubal API client. A virtual environment helps you isolate dependencies and manage your Python projects efficiently.

Prerequisites#

Before starting, ensure your system meets the following requirements:

  1. Install Python programming langugage (version 3.10 or later).

    • Verify the installation by running:

      python --version
      
  2. Install Visual Studio Code as your code editor:

    • Verify the installation by running:

      code --version
      
  3. Install Python Extension in VS Code:

    • Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).

    • Search for Python and click “Install”.

Setting Up the Virtual Environment#

Follow these steps to create and configure a Python virtual environment for your project:

  1. Create the Virtual Environment:

    • Open a terminal in your project folder and run:

      python -m venv myenv
      
    • This creates a virtual environment named myenv in your project directory.

  2. Activate the Virtual Environment:

    • Activate the environment depending on your operating system:

      • On Windows:

        myenv\Scripts\activate
        
    • You should see (myenv) in your terminal, indicating the environment is active.

  3. Install the Dlubal API:

    • Install the Dlubal API using pip:

      pip install dlubal.api
      
    • To install a specific version, use:

      pip install dlubal.api==<version>
      

    Replace <version> with the desired version number (e.g., 2.9.4). The last two numbers in the version relate to the Dlubal App version, in the format X.09.0004.

  1. Verify the Installation:

    • Verify that the Dlubal API is installed correctly by running:

      pip list | grep dlubal
      

Using the Virtual Environment#

Once the virtual environment is set up, follow these steps to start developing:

  1. Activate the Environment: - Run the activation command for your operating system (e.g., source myenv/bin/activate).

  2. Write and Test Code: - Use your preferred editor, such as Visual Studio Code, to write and test your Dlubal API client.

This setup provides a lightweight and isolated development environment for Dlubal API client development. If you encounter issues, refer to the troubleshooting section or consult Python and VS Code documentation.