The development installation is necessary if you want to contribute to up42-py, e.g. to fix a bug.
- Optional (but highly recommended): Create a new virtual environment e.g. using virtualenvwrapper:
mkvirtualenv --python=$(which python3.7) up42-py
- Clone the repository and install locally with SystemLink (code changes are reflected).
This will install all the neccessary dependencies for up42-py, running the tests and editing the docs.
git clone git@github.com:up42/up42-py.git
cd up42-py
make install[dev]
-
Create a new project on UP42.
-
Create a
config.json
file and fill in the project credentials.
{
"project_id": "...",
"project_api_key": "..."
}
- Test it in Python! This will authenticate with the UP42 Server and get the project information.
import up42
up42.authenticate(cfg_file="config.json")
project = up42.initialize_project()
print(project)
The up42-py documentation is based on markdown and build with MkDocs & Material for MkDocs.
In order to live-preview your changes for easier editing, run the MkDocs preview in the main folder:
cd up42-py
mkdocs serve
In the browser, open:
http://127.0.0.1:8000
Edit the markdown files in up42-py/docs. Save them to see the changes reflected in the preview.
In the main folder up42-py, run:
make test
or run all tests including the live tests:
make test[live]