Python Training

Python Essentials

An introduction to thinking in a Pythonic way covering the fundamentals of the language and putting you in good stead for the Python for QGIS course.

1 day

Setup

Installation, Executing Scripts, Using the interpreter

Intro

Imports, Functions, Indentation, Variables

Strings

Strings, if condition

Exercise – basic/stringl.py

Lists

Lists, Looping

Sorting

Sorted function, Tuples

Exercise – basic/stringl.py

Dicts and files

Dicts, Reading and writing files, Extra: Using with context manager, Unicode Errors Simply Explained

Exercise – basic/wordcount.py

Regular Expressions

Exercise – babynames/babynames.py

The standard library

File System, Errors and Exceptions, HTTP (optional)

Exercise – copyspecial/copyspecial.py

Exercise – logpuzzle/logpuzzle.py (optional)

Further Topics

Introduction to classes

Installing packages via pip (python -m pip)

Postgres using psycopg, Python psycopg2 & PostGIS

Training Schedule

Python for QGIS

This course is a basic introduction to the administration tasks required for a PostGIS database. It covers basic administration tasks as well as a step-by-step guide for PostgreSQL and PostGIS installation in the Windows environment. The course explores the different elements of user access including connecting from a remote server and provides guidance and practical examples on roles and role groups for managing security on the PostgreSQL server.

1 day

4 CPD points

Introduction to QGIS

Explores types of users and groups available within PostgreSQL and the architecture in which a user can gain access to the database and the different methods for determining access.

PyQGIS

Explores the database server, database objects and events including starting & stopping, server version & uptime.  Database folder location, size along wtih logging and monitoring.

Python Expressions

Managing database parameters whether the default or for a session.   Performance tuning for spatial data according to your server RAM resources and backing up the database.

Using the Python Console

Understanding what an index is how to create one.  Using clusters to improve query performance. Locating indexes and using the Vacuum Analyse command.

PyQGIS API

Writing psql scripts allowing for the altering of tables by adding / removing columns, changing datatypes or moving between schemas and tablespaces.

Plugins

One of the most important commands is the Vacuum command and when to use.  Also covered is the loading of “bulky” data and the impacts this has.

Training Schedule

Primary Trainer

Matt Walker

@_walkermatt

Matt is a charter member of the OSGeo foundation

Matt has been working with Python since 2011 and is  the author of the Open Source GML Loader and provided commits to other projects such as MapProxy.

He has a passion for Open Source and regularly provides workshops at various Open Source events.

He has extensive experience working with GIS and programming languages (Python, JavaScript, Java) spanning over 20 years.