Tools

The following provides some background information on the types of tools we use in this lab as well as tips for working with them.

Visual Studio Code (VS Code)

As mentioned in the lab, we utilized Microsoft Visual Studio Code for code editing. Although the ability to run VS Code remotely, yet be accessed via a browser using code-server may not be relevant for your situation, to assist in debugging and formatting of Python code, you will almost certainly want a Python extension, or the Python Extension Pack, which includes a few Python-related extensions. Without this extension, VS Code can't even help us in syntax-related errors in Python code.

Since VS Code is multi-platform, regardless of the machine you use, once installed, the steps described in the lab here should be very similar, regardless of your specific platform. It is also a good starting off point for any subsequent tools, because in most cases, you'll want to use things that integrate with VS Code so that a single environment can be utilized.

Source Version Control - Git

Git is a set of tools to implement a distributed version-control system for tracking source code changes. Used in conjunction with hosting services like GitHub, GitLab, or BitBucket, software projects can be developed and shared with other developers. Even with just one developer, utilizing Git is useful to track changes, revert, and maintain proper versioning.

For this lab, while the lab guide is hosted on one of our servers, the API portal itself is published to a Git repository that is publicly available. That means with the right environment set up, you can download this software, run it and modify it as you wish. Obviously you won't be able to test with the equipment we make available to you, but with very minimal modifications, if you have access to a lab or test equipment, you can modify this to fit your needs.

If your platform does not come with Git, there are several sources not the least of which is the main Git site.

The external repository for our software is at: https://github.com/collabapilab/ltrcol-2574-portal.git

Note there are two branches in this Repo:

  • master Branch contains the fully built-out Portal
  • skeleton Branch contains a partially built-out Portal that is meant to be used while Following this lab's guide

Virtual Environments

Although not absolutely mandatory, understanding and using virtual environment for your project can save you a lot of time in the long run. A virtual environment, as the name implies, is a context in which the code runs. For example, in this project, all of the Python packages required--including their versions--are documented in the requirements.txt file in the root of the repository. It includes things like Flask, zeep, and many other components. If you just install these (pip install -r requirements.txt), then you have just installed these and every other Python project that you have on that system hopefully won't have a problem with those exact packages. With virtual environments, you create a separate "environment" just for this project so that you have an isolated environment for all of this software that is not accessible and will not interact with any other virtual environment. This solves dependency problems and allows you to keep track of exactly what your software package requires to run, if you ever need to share it with someone else or install it to run on another server.

There are a number of software packages that can implement virtual environments. A good reference and primer can be found at https://realpython.com/python-virtual-environments-a-primer/

Webex

Webex allows for users to set up small, temporary sandbox environments. These can be leveraged for testing of features and code without impacting production Webex organizations.

Postman

Postman has many handy features, but for the purposes of code development, it has a feature to generate sample code snippets that can help get you started automating things quickly.

For any request that you generate, you can click on Code at the right, then select the desired language, in our case Python - Requests. The result is an entire software snippet, that can be run in Python.