The following Python scripting examples can be run as scripts, when saved as a .py file, or run interactively through the Python interpreter. The first is as minimal as you can get, the others show you a bit more context.
The Saving Data example shows you the quickest way to set, add, and update a document in the database. The Retrieving Data section shows the simplest way to retrieve, get, and extract information.
Both scripts involve four steps:
define connection - setting your variables for use in connecting to a node
open connection - creating your connection as defined
interaction - send new data, or send commands to retrieve data
disconnect - close connection to server
Additional methods are used in the scripts to make them easy to use and to demonstrate basic ways of applying Python to these types of problems. For more advanced scripting see the Test Script section later in this Getting Started guide.