Page MenuHomec4science

bibconvert-api.webdoc
No OneTemporary

File Metadata

Created
Thu, May 23, 23:23

bibconvert-api.webdoc

## -*- mode: html; coding: utf-8; -*-
## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
<!-- WebDoc-Page-Title: BibConvert API -->
<!-- WebDoc-Page-Navtrail: <a class="navtrail" href="<CFG_SITE_URL>/help/hacking">Hacking Invenio</a> &gt; <a class="navtrail" href="bibconvert-internals">BibConvert Internals</a> -->
<!-- WebDoc-Page-Revision: $Id$ -->
<protect>
<pre>
Invenio BibConvert can be called from within your Python
programs via a high-level API.
BibConvert High-level API (subject to change)
Description:
The high-level access to the BibConvert formatting and value generation
allows to perform basic text formatting basde on BibConvert's metadata
conversion configuration language. There are two main functions accessible
via the BibConvert API: (i) The BibConvert formatter and (ii) The BibConvert
value generator. For detailed description of formatting functions and
generated values please have a look at the <a href=<CFG_SITE_URL>/help/admin/bibconvert-admin-guide>BibConvert Admin Guide</a>.
Signature:
def format_field(value_raw, "function(parameters)"):
"""
value_raw - text to be formatted
function - BibConvert formatting function
parameters - Comma separated parameters
output - formated text
def generate():
"""
"""
Examples:
>>> # import the function:
>>> from invenio.bibconvert import format_field, generate
>>> # format field
>>> out = format_field(value_raw,"")
>>> # generate value in requested format
>>> out = generate("DATE(%Y-%m-%dT%H:%M:%SZ)")
</pre>
</protect>

Event Timeline