[:DebianWiki/EditorGuide#translation:Translation(s)]: none

(!) [:/Discussion:Discussion]


["DDE"] Tutorial: exploring DDE

Introduction

["DDE"] Is a tool to make it easy to publish Debian information. In this tutorial we have a little tour to see how DDE works.

If you just want to know a quick&dirty way to get at the data, just go to a DDE site (["DDE"] has a list) and follow the instructions.

Prerequisites

# Note: you can use python-syck if you do not have python-yaml
apt-get install python-json python-yaml python-paste
git clone git://git.debian.org/debtags/dde.git
cd dde

Explore the information tree

./testdde --help /
./testdde ls -l /apt
./testdde get /apt/packages/apt
./testdde get -t json /apt/packages/apt  (requires python-json)
./testdde get -t yaml /apt/packages/apt  (requires python-yaml or python-syck)

DDE exports data as a read-only tree that can be queried using paths. Given a tree path, you can get its value, list its child nodes or get some documentation about what it contains.

Tree paths are provided by plugins loaded at program startup. It is quite easy to write new plugins that add new branches to the tree, exporting new information.

When you get the value of a path, you can choose the format of the result. Currently supported are json, yaml, csv and pickle, but more can be added.

Publish the information on the web

Start DDE as a HTTP server (requires python-paste):

./testdde --server

You can now point your browser at http://localhost:8080

The DDE server shows an introduction about DDE, and allows you to navigate the tree.

Once you find the information that you want, you can download it in a format of your choice:

From the DDE main page you also have links to further information about all the supported data formats.