File: ch_python_bindings.docbook

package info (click to toggle)
gnucash-docs 5.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164,260 kB
  • sloc: xml: 101,090; ruby: 229; makefile: 59; sh: 8
file content (57 lines) | stat: -rw-r--r-- 2,548 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter SYSTEM "gnc-gui-zh.dtd">
<!-- (Do not remove this comment block.)
Version: 2.4.0
Last modified: 2011-01-01
Maintainers:
Author:
Mike Evans <mikee@saxicola.co.uk>
Translators:
(translators put your name and email here)
-->
<!-- Todo: Database backends offer read access;
           Guile is also a sripting language perhaps its stand alone use should be explained here, too? -->
<!-- Todo: after adding a procedure convert this page into a https://tdg.docbook.org/tdg/4.5/task.html -->
<chapter id="ch_python_bindings">
  <title>Python Bindings</title>

  <para>&app; historically has always been a traditional application in the sense that you open it, use it
    to manipulate your financial data via the windows it presents, save your data and close the
    windows again. This has the inherent limitation that you can only do whatever the windows, menus
    and toolbars allow you to do.
  </para>

  <para>Sometimes you might need a little more flexibility. For example, you need a report with just a
    little different information than what the built-in reports provide, or you want to automate a
    frequently recurring action. Such custom manipulations are ideal candidates to write in one or
    the other scripting language.
  </para>

  <para>Starting with &app; version 2.4 you can write
    <ulink url="&url-wp-en;Python_(programming_language)">&app-py;</ulink> scripts to manipulate
    your financial data.
  </para>

  <important>
    <para>The &app-py; extensions are an optional feature which creates additional dependencies. To be able to
      use &app-py; scripts, &app; must have been built with the <code language="sh">cmake
      -DWITH_PYTHON=ON …</code> option enabled, otherwise all what follows won&rsquo;t work. At
      present this option is not enabled by default, so if you need this, you may have to compile
      &app; from source yourself. But some distributions offer it also as a separate package with a
      name like<package>
        python[<replaceable>version</replaceable>]-&appname;
      </package>
    </para>
  </important>

  <para>The &app-py; extensions come with a couple of ready to use scripts. This chapter will show you how
    to <emphasis>use</emphasis> some of them.
  </para>

  <tip>
    <para>This chapter is not about how to write your own &app-py; scripts. Refer to the
      <ulink url="&url-doc-api-stable;python_bindings_page.html">developer documentation</ulink> for
      that instead.
    </para>
  </tip>
</chapter>