HomeGuidesRecipesAPI EndpointsRelease NotesCommunity
Log In
Guides

Importing Dependencies

Creating a New Document

The first thing we need is a place to write your application! You can name this whatever you like as long as there are no spaces. You can use underscores between words to keep it readable. It is also common practice to keep your filenames all lowercase. For the purposes of this tutorial, we will be using main.py and referring to your top-level document as the “root document”. There are a few ways to add a document to your project. Pick the one that you are most comfortable with.

From The Command Line

You can create a new file from your Terminal by using the touch command. First, make sure you are in your project directory as we went over in Setting Up Your Environment, and then run:

touch main.py

This will create a blank python script file. You can open this file to start typing your API script by using the open command:

open main.py

From VS Code

If you are using VSCode you can add new files very easily by using the “New File button at the top of the Explorer tab.

Importing Requirements

Alright! We have Layar installed and a fresh new document to work in. Now we need to tell our project that we’ll be using the packages we installed earlier.

In any guides or recipes you see in this documentation, you'll see a block of dependencies to import. These packages only need to be imported in your project once.

At the top of your root (main) document you’ll want to import the following packages:

# Import Dependencies
from __future__ import print_function
from pprint import pprint
import time
import requests
import json

👍

Dependencies Installed

Success! You've now installed all of the dependencies needed to use the Layar API.


Up Next

You've now set up your environment and installed the necessary languages and dependencies. The last step before making any API calls is to configure and authenticate your instance.