<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SciTools Blog &#187; api</title>
	<atom:link href="http://scitools.com/blog/tag/api/feed" rel="self" type="application/rss+xml" />
	<link>http://scitools.com/blog</link>
	<description>Maintain your Software</description>
	<lastBuildDate>Mon, 30 Jan 2012 19:15:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Python API</title>
		<link>http://scitools.com/blog/2011/08/new-python-api.html</link>
		<comments>http://scitools.com/blog/2011/08/new-python-api.html#comments</comments>
		<pubDate>Mon, 29 Aug 2011 20:47:57 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Scitools Announcements]]></category>
		<category><![CDATA[Understand 2.6]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2011/08/new-python-api.html</guid>
		<description><![CDATA[Understand now fully supports Python access to its underlying database! The new Python API allows you to write your own scripts that can create custom reports, generate your own metrics and in general make Understand deliver exactly what you want it to.
Getting Started
The Python API runs on your 3.x installation of Python, you can grab [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://python.org"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="python-logo[1]" border="0" alt="python-logo[1]" align="right" src="http://www.scitools.com/blog/wp-content/uploads/2011/08/pythonlogo1.gif" width="211" height="71" /></a>Understand now fully supports Python access to its underlying database! The new Python API allows you to write your own scripts that can create custom reports, generate your own metrics and in general make Understand deliver exactly what you want it to.</p>
<h3>Getting Started</h3>
<p>The Python API runs on your 3.x installation of Python, you can grab it from <a href="http://python.org/download/">here</a> if you need to install it. </p>
<p>Once you have Python installed you need to tell it where the Understand module is. The easiest way to do that is to add/modify the PYTHONPATH <a href="http://en.wikipedia.org/wiki/Environment_variable">environment variable</a> to include the module location, which is SciTools/bin/&lt;<em>System</em>&gt;/python. Also if you did not add Understand to the Path variable during installation, you will need to add the SciTools/bin/&lt;System&gt; directory to PATH.</p>
<p>Finally, to use the API you will need to put &#8216;import Understand&#8217; in your script.</p>
<h3>Documentation</h3>
<p>The most up-to-date documentation will ship with Understand and can be accessed from the Python Console with:    <br />&#160;&#160; import understand     <br />&#160; help (understand)     <br />A more readable version can be obtained with the python &#8216;pydoc&#8217; command, which can generate an html version of the documentation. We also try to keep a current version of the Python documentation on the <a href="http://www.scitools.com/support/manuals.php">Manuals</a> page.</p>
<h3>Sample Scripts</h3>
<p>The documentation includes some samples. More detailed example scripts are shipped with Understand in the SciTools/scripts/python folder.</p>
<p><strong>Happy Scripting!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2011/08/new-python-api.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changes to the Perl API</title>
		<link>http://scitools.com/blog/2009/04/changes-to-the-perl-api.html</link>
		<comments>http://scitools.com/blog/2009/04/changes-to-the-perl-api.html#comments</comments>
		<pubDate>Thu, 09 Apr 2009 14:16:15 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Scitools Labs]]></category>
		<category><![CDATA[Understand 2.0]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2009/04/changes-to-the-perl-api.html</guid>
		<description><![CDATA[We&#8217;ve made several changes to the Understand Perl API recently. The largest change was upgrading from Perl 5.6.0 to 5.10.0 in build 473.
In addition to several cool new features like the smart match operators and switch statements, Perl 5.10 runs faster and has a smaller memory footprint. For more details on what the changes are [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve made several changes to the <em>Understand</em> <a href="http://www.scitools.com/products/understand/perl.php">Perl API</a> recently. The largest change was upgrading from Perl 5.6.0 to 5.10.0 in build <a href="http://scitools.com/blog/2009/03/understand-20-build-notes-b473.html" target="_blank">473</a>.<br />
In addition to several cool new features like the smart match operators and switch statements, Perl 5.10 runs faster and has a smaller memory footprint. For more details on what the changes are and how to use<br />
them, see the <a href="http://dev.perl.org/perl5/news/2007/perl-5.10.0.html" target="_blank">Perl 5.10 Release Announcement</a>.</p>
<p>We are also in the process of adding Snapshot support for the Perl API for build 476. Now you can access historical versions of the code through your scripts as well. For example you can compare versions of files or write a script to compare metrics between versions. <span id="more-395"></span><strong> </strong></p>
<p><strong>What does this mean to you as an <em>Understand</em> script user?</strong><br />
In addition to the new features, the main side effect might be that some scripts might no longer work.</p>
<p>If any of your scripts stop working, review this list of incompatabilites in the <a href="http://search.cpan.org/dist/perl-5.10.0/pod/perl5100delta.pod#Incompatible_Changes/">Perl delta document</a>. You can also make sure the scripts are still valid syntax by running <strong>maintain_uperl -c myscipt.pl</strong>.</p>
<p>The new snapshot changes modify the API in a few different ways:</p>
<ul>
<li> Db::snapshots() to get a list of snapshots for the db.</li>
<li>$snapshot-&gt;name() to get the name of a snapshot and</li>
<li>$snapshot-&gt;open() to open the snapshot and return a $db variable that represents the snapshot.</li>
<li>The $db object is now &#8220;live&#8221;. It never used to be and it was never important that a script pass around and use the correct object. It is now critical.</li>
<li>Entity objects carry with them knowledge of the database/snapshot they belong to. Multiple databases/snapshots can be open and you can have entities from them all at once.</li>
<li>Any <strong>scripts which used entity ids <em>$ent-&gt;id() </em>as keys in hashes must be updated</strong> &#8211; the $ent-&gt;id is no longer unique across snapshots and multiple databases
<ul>
<li><span style="text-decoration: line-through;">At the beginning of the script add:   <em>use Tie::RefHash;</em></span></li>
<li><span style="text-decoration: line-through;">declare the hash with:  <em>tie my %my_hash, &#8216;Tie::RefHash&#8217;;</em></span></li>
<li><span style="text-decoration: line-through;">use the actual entity object as the key <em>$my_hash{$ent}</em>, not the dereference of the entity <em>$my_hash{$ent-&gt;id}</em>.</span></li>
<li><span style="text-decoration: line-through;">Don&#8217;t use Understand::ent-&gt;new($id) to reconstruct an Ent object from the id.</span></li>
</ul>
</li>
</ul>
<p>If you run into any problems that you need help with, feel free to post a question on the <a href="http://www.scitools.com/support/forum/viewforum.php?f=5" target="_blank">scripting forum</a>, or shoot us an email at support@scitools.com</p>
<p>UPDATE- We found some issues with the above approach to $ent-&gt;id and changed it with build 477. Using a Tie::RefHash for entities does not work as intended and is no longer recommended. We added a new call $db-&gt;<strong>ent_from_id</strong>($id), to reconstruct entity objects from ids.  To use entities as hash keys without later retrieving the entities from keys, it is sufficient to simply use $ent for the key. To later retrieve an entity from a key, instead, use the entity id as the key ($ent-&gt;id()), and retrieve the entity from the key with $db-&gt;ent_from_id($key). Note, it is not possible to safely store entities from different db&#8217;s into the same hash using this technique, since id&#8217;s are not unique across multiple open db&#8217;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2009/04/changes-to-the-perl-api.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

