<!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>Top-level variables and functions — PyTables 3.0.0 documentation</title> <link rel="stylesheet" href="../../_static/cloud.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../', VERSION: '3.0.0', 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> <script type="text/javascript" src="../../_static/jquery.cookie.js"></script> <script type="text/javascript" src="../../_static/toggle_sections.js"></script> <script type="text/javascript" src="../../_static/toggle_sidebar.js"></script> <link rel="shortcut icon" href="../../_static/favicon.ico"/> <link rel="top" title="PyTables 3.0.0 documentation" href="../../index.html" /> <link rel="up" title="Library Reference" href="../libref.html" /> <link rel="next" title="File manipulation class" href="file_class.html" /> <link rel="prev" title="Library Reference" href="../libref.html" /> </head> <body> <div class="relbar-top"> <div class="related"> <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="../../np-modindex.html" title="Python Module Index" >modules</a> </li> <li class="right" > <a href="file_class.html" title="File manipulation class" accesskey="N">next</a> </li> <li class="right" > <a href="../libref.html" title="Library Reference" accesskey="P">previous</a> </li> <li><a href="../../index.html">PyTables 3.0.0 documentation</a> »</li> <li><a href="../index.html" >PyTables User’s Guide</a> »</li> <li><a href="../libref.html" accesskey="U">Library Reference</a> »</li> </ul> </div> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="top-level-variables-and-functions"> <h1>Top-level variables and functions<a class="headerlink" href="#top-level-variables-and-functions" title="Permalink to this headline">¶</a></h1> <div class="section" id="global-variables"> <h2>Global variables<a class="headerlink" href="#global-variables" title="Permalink to this headline">¶</a></h2> <dl class="data"> <dt id="tables.__version__"> <tt class="descclassname">tables.</tt><tt class="descname">__version__</tt><em class="property"> = '3.0.0'</em><a class="headerlink" href="#tables.__version__" title="Permalink to this definition">¶</a></dt> <dd><p>The PyTables version number.</p> </dd></dl> <dl class="data"> <dt id="tables.hdf5_version"> <tt class="descclassname">tables.</tt><tt class="descname">hdf5_version</tt><em class="property"> = '1.8.9'</em><a class="headerlink" href="#tables.hdf5_version" title="Permalink to this definition">¶</a></dt> <dd><p>The underlying HDF5 library version number.</p> <p class="versionadded"> <span class="versionmodified">New in version 3.0.</span></p> </dd></dl> <dl class="data"> <dt> <tt class="descclassname">tables.</tt><tt class="descname">hdf5_version</tt><em class="property"> = '1.8.9'</em></dt> <dd><p>The underlying HDF5 library version number.</p> <p class="versionadded"> <span class="versionmodified">New in version 3.0.</span></p> </dd></dl> </div> <div class="section" id="global-functions"> <h2>Global functions<a class="headerlink" href="#global-functions" title="Permalink to this headline">¶</a></h2> <dl class="function"> <dt id="tables.copy_file"> <tt class="descclassname">tables.</tt><tt class="descname">copy_file</tt><big>(</big><em>srcfilename</em>, <em>dstfilename</em>, <em>overwrite=False</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#tables.copy_file" title="Permalink to this definition">¶</a></dt> <dd><p>An easy way of copying one PyTables file to another.</p> <p>This function allows you to copy an existing PyTables file named srcfilename to another file called dstfilename. The source file must exist and be readable. The destination file can be overwritten in place if existing by asserting the overwrite argument.</p> <p>This function is a shorthand for the <a class="reference internal" href="file_class.html#tables.File.copy_file" title="tables.File.copy_file"><tt class="xref py py-meth docutils literal"><span class="pre">File.copy_file()</span></tt></a> method, which acts on an already opened file. kwargs takes keyword arguments used to customize the copying process. See the documentation of <a class="reference internal" href="file_class.html#tables.File.copy_file" title="tables.File.copy_file"><tt class="xref py py-meth docutils literal"><span class="pre">File.copy_file()</span></tt></a> for a description of those arguments.</p> </dd></dl> <dl class="function"> <dt id="tables.is_hdf5_file"> <tt class="descclassname">tables.</tt><tt class="descname">is_hdf5_file</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#tables.is_hdf5_file" title="Permalink to this definition">¶</a></dt> <dd><p>Determine whether a file is in the HDF5 format.</p> <p>When successful, it returns a true value if the file is an HDF5 file, false otherwise. If there were problems identifying the file, an HDF5ExtError is raised.</p> </dd></dl> <dl class="function"> <dt id="tables.is_pytables_file"> <tt class="descclassname">tables.</tt><tt class="descname">is_pytables_file</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#tables.is_pytables_file" title="Permalink to this definition">¶</a></dt> <dd><p>Determine whether a file is in the PyTables format.</p> <p>When successful, it returns the format version string if the file is a PyTables file, None otherwise. If there were problems identifying the file, an HDF5ExtError is raised.</p> </dd></dl> <dl class="function"> <dt id="tables.open_file"> <tt class="descclassname">tables.</tt><tt class="descname">open_file</tt><big>(</big><em>filename</em>, <em>mode='r'</em>, <em>title=''</em>, <em>root_uep='/'</em>, <em>filters=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#tables.open_file" title="Permalink to this definition">¶</a></dt> <dd><p>Open a PyTables (or generic HDF5) file and return a File object.</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"><p class="first"><strong>filename</strong> : str</p> <blockquote> <div><p>The name of the file (supports environment variable expansion). It is suggested that file names have any of the .h5, .hdf or .hdf5 extensions, although this is not mandatory.</p> </div></blockquote> <p><strong>mode</strong> : str</p> <blockquote> <div><p>The mode to open the file. It can be one of the following:</p> <blockquote> <div><ul class="simple"> <li><em>‘r’</em>: Read-only; no data can be modified.</li> <li><em>‘w’</em>: Write; a new file is created (an existing file with the same name would be deleted).</li> <li><em>‘a’</em>: Append; an existing file is opened for reading and writing, and if the file does not exist it is created.</li> <li><em>‘r+’</em>: It is similar to ‘a’, but the file must already exist.</li> </ul> </div></blockquote> </div></blockquote> <p><strong>title</strong> : str</p> <blockquote> <div><p>If the file is to be created, a TITLE string attribute will be set on the root group with the given value. Otherwise, the title will be read from disk, and this will not have any effect.</p> </div></blockquote> <p><strong>root_uep</strong> : str</p> <blockquote> <div><p>The root User Entry Point. This is a group in the HDF5 hierarchy which will be taken as the starting point to create the object tree. It can be whatever existing group in the file, named by its HDF5 path. If it does not exist, an HDF5ExtError is issued. Use this if you do not want to build the <em>entire</em> object tree, but rather only a <em>subtree</em> of it.</p> <p class="versionchanged"> <span class="versionmodified">Changed in version 3.0: </span>The <em>rootUEP</em> parameter has been renamed into <em>root_uep</em>.</p> </div></blockquote> <p><strong>filters</strong> : Filters</p> <blockquote class="last"> <div><p>An instance of the Filters (see <a class="reference internal" href="helper_classes.html#filtersclassdescr"><em>The Filters class</em></a>) class that provides information about the desired I/O filters applicable to the leaves that hang directly from the <em>root group</em>, unless other filter properties are specified for these leaves. Besides, if you do not specify filter properties for child groups, they will inherit these ones, which will in turn propagate to child nodes.</p> </div></blockquote> </td> </tr> </tbody> </table> <p class="rubric">Notes</p> <p>In addition, it recognizes the (lowercase) names of parameters present in <tt class="file docutils literal"><span class="pre">tables/parameters.py</span></tt> as additional keyword arguments. See <a class="reference internal" href="../parameter_files.html#parameter-files"><em>PyTables parameter files</em></a> for a detailed info on the supported parameters.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">If you need to deal with a large number of nodes in an efficient way, please see <a class="reference internal" href="../optimization.html#lruoptim"><em>Getting the most from the node LRU cache</em></a> for more info and advices about the integrated node cache engine.</p> </div> </dd></dl> <dl class="function"> <dt id="tables.set_blosc_max_threads"> <tt class="descclassname">tables.</tt><tt class="descname">set_blosc_max_threads</tt><big>(</big><em>nthreads</em><big>)</big><a class="headerlink" href="#tables.set_blosc_max_threads" title="Permalink to this definition">¶</a></dt> <dd><p>Set the maximum number of threads that Blosc can use.</p> <p>This actually overrides the <a class="reference internal" href="../parameter_files.html#tables.parameters.MAX_BLOSC_THREADS" title="tables.parameters.MAX_BLOSC_THREADS"><tt class="xref py py-data docutils literal"><span class="pre">tables.parameters.MAX_BLOSC_THREADS</span></tt></a> setting in <tt class="xref py py-mod docutils literal"><span class="pre">tables.parameters</span></tt>, so the new value will be effective until this function is called again or a new file with a different <a class="reference internal" href="../parameter_files.html#tables.parameters.MAX_BLOSC_THREADS" title="tables.parameters.MAX_BLOSC_THREADS"><tt class="xref py py-data docutils literal"><span class="pre">tables.parameters.MAX_BLOSC_THREADS</span></tt></a> value is specified.</p> <p>Returns the previous setting for maximum threads.</p> </dd></dl> <dl class="function"> <dt id="tables.print_versions"> <tt class="descclassname">tables.</tt><tt class="descname">print_versions</tt><big>(</big><big>)</big><a class="headerlink" href="#tables.print_versions" title="Permalink to this definition">¶</a></dt> <dd><p>Print all the versions of software that PyTables relies on.</p> </dd></dl> <dl class="function"> <dt id="tables.restrict_flavors"> <tt class="descclassname">tables.</tt><tt class="descname">restrict_flavors</tt><big>(</big><em>keep=['python']</em><big>)</big><a class="headerlink" href="#tables.restrict_flavors" title="Permalink to this definition">¶</a></dt> <dd><p>Disable all flavors except those in keep.</p> <p>Providing an empty keep sequence implies disabling all flavors (but the internal one). If the sequence is not specified, only optional flavors are disabled.</p> <div class="admonition important"> <p class="first admonition-title">Important</p> <p class="last">Once you disable a flavor, it can not be enabled again.</p> </div> </dd></dl> <dl class="function"> <dt id="tables.split_type"> <tt class="descclassname">tables.</tt><tt class="descname">split_type</tt><big>(</big><em>type</em><big>)</big><a class="headerlink" href="#tables.split_type" title="Permalink to this definition">¶</a></dt> <dd><p>Split a PyTables type into a PyTables kind and an item size.</p> <p>Returns a tuple of (kind, itemsize). If no item size is present in the type (in the form of a precision), the returned item size is None:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">split_type</span><span class="p">(</span><span class="s">'int32'</span><span class="p">)</span> <span class="go">('int', 4)</span> <span class="gp">>>> </span><span class="n">split_type</span><span class="p">(</span><span class="s">'string'</span><span class="p">)</span> <span class="go">('string', None)</span> <span class="gp">>>> </span><span class="n">split_type</span><span class="p">(</span><span class="s">'int20'</span><span class="p">)</span> <span class="gt">Traceback (most recent call last):</span> <span class="c">...</span> <span class="gr">ValueError</span>: <span class="n">precision must be a multiple of 8: 20</span> <span class="gp">>>> </span><span class="n">split_type</span><span class="p">(</span><span class="s">'foo bar'</span><span class="p">)</span> <span class="gt">Traceback (most recent call last):</span> <span class="c">...</span> <span class="gr">ValueError</span>: <span class="n">malformed type: 'foo bar'</span> </pre></div> </div> </dd></dl> <dl class="function"> <dt id="tables.test"> <tt class="descclassname">tables.</tt><tt class="descname">test</tt><big>(</big><em>verbose=False</em>, <em>heavy=False</em><big>)</big><a class="headerlink" href="#tables.test" title="Permalink to this definition">¶</a></dt> <dd><p>Run all the tests in the test suite.</p> <p>If <em>verbose</em> is set, the test suite will emit messages with full verbosity (not recommended unless you are looking into a certain problem).</p> <p>If <em>heavy</em> is set, the test suite will be run in <em>heavy</em> mode (you should be careful with this because it can take a lot of time and resources from your computer).</p> <p>Return 0 (os.EX_OK) if all tests pass, 1 in case of failure</p> </dd></dl> <dl class="function"> <dt id="tables.which_lib_version"> <tt class="descclassname">tables.</tt><tt class="descname">which_lib_version</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#tables.which_lib_version" title="Permalink to this definition">¶</a></dt> <dd><p>Get version information about a C library.</p> <p>If the library indicated by name is available, this function returns a 3-tuple containing the major library version as an integer, its full version as a string, and the version date as a string. If the library is not available, None is returned.</p> <p>The currently supported library names are hdf5, zlib, lzo and bzip2. If another name is given, a ValueError is raised.</p> </dd></dl> <dl class="function"> <dt id="tables.silence_hdf5_messages"> <tt class="descclassname">tables.</tt><tt class="descname">silence_hdf5_messages</tt><big>(</big><em>silence=True</em><big>)</big><a class="headerlink" href="#tables.silence_hdf5_messages" title="Permalink to this definition">¶</a></dt> <dd><p>Silence (or re-enable) messages from the HDF5 C library.</p> <p>The <em>silence</em> parameter can be used control the behaviour and reset the standard HDF5 logging.</p> <p class="versionadded"> <span class="versionmodified">New in version 2.4.</span></p> </dd></dl> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="../../index.html"> <img class="logo" src="../../_static/logo-pytables-small.png" alt="Logo"/> </a></p> <h3><a href="../../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Top-level variables and functions</a><ul> <li><a class="reference internal" href="#global-variables">Global variables</a></li> <li><a class="reference internal" href="#global-functions">Global functions</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="../libref.html" title="previous chapter">Library Reference</a></p> <h4>Next topic</h4> <p class="topless"><a href="file_class.html" title="next chapter">File manipulation class</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../_sources/usersguide/libref/top_level.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <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="relbar-bottom"> <div class="related"> <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="../../np-modindex.html" title="Python Module Index" >modules</a> </li> <li class="right" > <a href="file_class.html" title="File manipulation class" >next</a> </li> <li class="right" > <a href="../libref.html" title="Library Reference" >previous</a> </li> <li><a href="../../index.html">PyTables 3.0.0 documentation</a> »</li> <li><a href="../index.html" >PyTables User’s Guide</a> »</li> <li><a href="../libref.html" >Library Reference</a> »</li> </ul> </div> </div> <div class="footer"> © Copyright 2011-2013, PyTables maintainers. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> <!-- cloud_sptheme 1.3 --> </body> </html>