/usr/share/doc/python-bibtexparser-doc/html/bibtexparser.html is in python-bibtexparser-doc 0.6.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>bibtexparser: API — BibtexParser 0.6.2 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.6.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="BibtexParser 0.6.2 documentation" href="index.html" />
<link rel="next" title="Logging module to understand failures" href="logging.html" />
<link rel="prev" title="Tutorial" href="tutorial.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="logging.html" title="Logging module to understand failures"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="tutorial.html" title="Tutorial"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">BibtexParser 0.6.2 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="bibtexparser-api">
<span id="id1"></span><h1>bibtexparser: API<a class="headerlink" href="#bibtexparser-api" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-bibtexparser">
<span id="bibtexparser-parsing-and-writing-bibtex-files"></span><h2><a class="reference internal" href="#module-bibtexparser" title="bibtexparser"><code class="xref py py-mod docutils literal"><span class="pre">bibtexparser</span></code></a> — Parsing and writing BibTeX files<a class="headerlink" href="#module-bibtexparser" title="Permalink to this headline">¶</a></h2>
<p>BibTeX <<a class="reference external" href="http://en.wikipedia.org/wiki/BibTeX">http://en.wikipedia.org/wiki/BibTeX</a>> is a bibliographic data file format.</p>
<p>The <a class="reference internal" href="#module-bibtexparser" title="bibtexparser"><code class="xref py py-mod docutils literal"><span class="pre">bibtexparser</span></code></a> module provides parsing and writing of BibTeX files functionality. The API is similar to the
<code class="xref py py-mod docutils literal"><span class="pre">json</span></code> module. The parsed data is returned as a simple <code class="xref py py-class docutils literal"><span class="pre">BibDatabase</span></code> object with the main attribute being
<code class="xref py py-attr docutils literal"><span class="pre">entries</span></code> representing bibliographic sources such as books and journal articles.</p>
<p>Parsing is a simple as:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="go">>>>> import bibtexparser</span>
<span class="go">>>>> with open('bibtex.bib') as bibtex_file:</span>
<span class="go">>>>> bibtex_database = bibtexparser.load(bibtex_file)</span>
</pre></div>
</div>
<p>And writing:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="go">>>>> import bibtexparser</span>
<span class="go">>>>> with open('bibtex.bib', 'w') as bibtex_file:</span>
<span class="go">>>>> bibtexparser.dump(bibtex_database, bibtex_file)</span>
</pre></div>
</div>
<dl class="function">
<dt id="bibtexparser.load">
<code class="descclassname">bibtexparser.</code><code class="descname">load</code><span class="sig-paren">(</span><em>bibtex_file</em>, <em>parser=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bibtexparser.html#load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bibtexparser.load" title="Permalink to this definition">¶</a></dt>
<dd><p>Load <code class="xref py py-class docutils literal"><span class="pre">BibDatabase</span></code> object from a file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>bibtex_file</strong> (<em>file</em>) – input file to be parsed</li>
<li><strong>parser</strong> (<em>BibTexParser</em>) – custom parser to use (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">bibliographic database object</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#bibdatabase.BibDatabase" title="bibdatabase.BibDatabase">BibDatabase</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bibtexparser.loads">
<code class="descclassname">bibtexparser.</code><code class="descname">loads</code><span class="sig-paren">(</span><em>bibtex_str</em>, <em>parser=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bibtexparser.html#loads"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bibtexparser.loads" title="Permalink to this definition">¶</a></dt>
<dd><p>Load <code class="xref py py-class docutils literal"><span class="pre">BibDatabase</span></code> object from a string</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>bibtex_str</strong> (<em>str or unicode</em>) – input BibTeX string to be parsed</li>
<li><strong>parser</strong> (<em>BibTexParser</em>) – custom parser to use (optional)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">bibliographic database object</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#bibdatabase.BibDatabase" title="bibdatabase.BibDatabase">BibDatabase</a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bibtexparser.dumps">
<code class="descclassname">bibtexparser.</code><code class="descname">dumps</code><span class="sig-paren">(</span><em>bib_database</em>, <em>writer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bibtexparser.html#dumps"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bibtexparser.dumps" title="Permalink to this definition">¶</a></dt>
<dd><p>Dump <code class="xref py py-class docutils literal"><span class="pre">BibDatabase</span></code> object to a BibTeX string</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>bib_database</strong> (<a class="reference internal" href="#bibdatabase.BibDatabase" title="bibdatabase.BibDatabase"><em>BibDatabase</em></a>) – bibliographic database object</li>
<li><strong>writer</strong> (<em>BibTexWriter</em>) – custom writer to use (optional) (not yet implemented)</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">BibTeX string</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">unicode</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="bibtexparser.dump">
<code class="descclassname">bibtexparser.</code><code class="descname">dump</code><span class="sig-paren">(</span><em>bib_database</em>, <em>bibtex_file</em>, <em>writer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/bibtexparser.html#dump"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bibtexparser.dump" title="Permalink to this definition">¶</a></dt>
<dd><p>Save <code class="xref py py-class docutils literal"><span class="pre">BibDatabase</span></code> object as a BibTeX text file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>bib_database</strong> (<a class="reference internal" href="#bibdatabase.BibDatabase" title="bibdatabase.BibDatabase"><em>BibDatabase</em></a>) – bibliographic database object</li>
<li><strong>bibtex_file</strong> (<em>file</em>) – file to write to</li>
<li><strong>writer</strong> (<em>BibTexWriter</em>) – custom writer to use (optional) (not yet implemented)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="bibtexparser-bibdatabase-the-bibliographic-database-object">
<h2><code class="xref py py-mod docutils literal"><span class="pre">bibtexparser.bibdatabase</span></code> — The bibliographic database object<a class="headerlink" href="#bibtexparser-bibdatabase-the-bibliographic-database-object" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="bibdatabase.BibDatabase">
<em class="property">class </em><code class="descclassname">bibdatabase.</code><code class="descname">BibDatabase</code><a class="reference internal" href="_modules/bibdatabase.html#BibDatabase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#bibdatabase.BibDatabase" title="Permalink to this definition">¶</a></dt>
<dd><p>A bibliographic database object following the data structure of a BibTeX file.</p>
<dl class="attribute">
<dt id="bibdatabase.BibDatabase.comments">
<code class="descname">comments</code><em class="property"> = None</em><a class="headerlink" href="#bibdatabase.BibDatabase.comments" title="Permalink to this definition">¶</a></dt>
<dd><p>List of BibTeX comment (<cite>@comment{...}</cite>) blocks.</p>
</dd></dl>
<dl class="attribute">
<dt id="bibdatabase.BibDatabase.entries">
<code class="descname">entries</code><em class="property"> = None</em><a class="headerlink" href="#bibdatabase.BibDatabase.entries" title="Permalink to this definition">¶</a></dt>
<dd><p>List of BibTeX entries, for example <cite>@book{...}</cite>, <cite>@article{...}</cite>, etc. Each entry is a simple dict with
BibTeX field-value pairs, for example <cite>‘author’: ‘Bird, R.B. and Armstrong, R.C. and Hassager, O.’</cite> Each
entry will always have the following dict keys (in addition to other BibTeX fields):</p>
<blockquote>
<div><ul class="simple">
<li><cite>ID</cite> (BibTeX key)</li>
<li><cite>ENTRYTYPE</cite> (entry type in lowercase, e.g. <cite>book</cite>, <cite>article</cite> etc.)</li>
</ul>
</div></blockquote>
</dd></dl>
<dl class="attribute">
<dt id="bibdatabase.BibDatabase.entries_dict">
<code class="descname">entries_dict</code><a class="headerlink" href="#bibdatabase.BibDatabase.entries_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a dictionary of BibTeX entries.
The dict key is the BibTeX entry key</p>
</dd></dl>
<dl class="attribute">
<dt id="bibdatabase.BibDatabase.preambles">
<code class="descname">preambles</code><em class="property"> = None</em><a class="headerlink" href="#bibdatabase.BibDatabase.preambles" title="Permalink to this definition">¶</a></dt>
<dd><p>List of BibTeX preamble (<cite>@preamble{...}</cite>) blocks.</p>
</dd></dl>
<dl class="attribute">
<dt id="bibdatabase.BibDatabase.strings">
<code class="descname">strings</code><em class="property"> = None</em><a class="headerlink" href="#bibdatabase.BibDatabase.strings" title="Permalink to this definition">¶</a></dt>
<dd><p>OrderedDict of BibTeX string definitions (<cite>@string{...}</cite>). In order of definition.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="bibtexparser-bparser-modifying-the-default-parser">
<h2><code class="xref py py-mod docutils literal"><span class="pre">bibtexparser.bparser</span></code> — Modifying the default parser<a class="headerlink" href="#bibtexparser-bparser-modifying-the-default-parser" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="bibtexparser-customization-record-customization-functions">
<h2><code class="xref py py-mod docutils literal"><span class="pre">bibtexparser.customization</span></code> — Record customization functions<a class="headerlink" href="#bibtexparser-customization-record-customization-functions" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="bibtexparser-bwriter-modifying-the-default-writer">
<h2><code class="xref py py-mod docutils literal"><span class="pre">bibtexparser.bwriter</span></code> — Modifying the default writer<a class="headerlink" href="#bibtexparser-bwriter-modifying-the-default-writer" title="Permalink to this headline">¶</a></h2>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">bibtexparser: API</a><ul>
<li><a class="reference internal" href="#module-bibtexparser"><code class="docutils literal"><span class="pre">bibtexparser</span></code> — Parsing and writing BibTeX files</a></li>
<li><a class="reference internal" href="#bibtexparser-bibdatabase-the-bibliographic-database-object"><code class="docutils literal"><span class="pre">bibtexparser.bibdatabase</span></code> — The bibliographic database object</a></li>
<li><a class="reference internal" href="#bibtexparser-bparser-modifying-the-default-parser"><code class="docutils literal"><span class="pre">bibtexparser.bparser</span></code> — Modifying the default parser</a></li>
<li><a class="reference internal" href="#bibtexparser-customization-record-customization-functions"><code class="docutils literal"><span class="pre">bibtexparser.customization</span></code> — Record customization functions</a></li>
<li><a class="reference internal" href="#bibtexparser-bwriter-modifying-the-default-writer"><code class="docutils literal"><span class="pre">bibtexparser.bwriter</span></code> — Modifying the default writer</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="tutorial.html"
title="previous chapter">Tutorial</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="logging.html"
title="next chapter">Logging module to understand failures</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/bibtexparser.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="logging.html" title="Logging module to understand failures"
>next</a> |</li>
<li class="right" >
<a href="tutorial.html" title="Tutorial"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">BibtexParser 0.6.2 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2013-2014, F. Boulogne.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.5.
</div>
</body>
</html>
|