Files
.com/category/projects.html
Kenneth Reitz 4bc7de9da5 content update
2011-01-03 01:37:40 -05:00

210 lines
5.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Kenneth's log - projects</title>
<meta charset="utf-8" />
<link rel="stylesheet" href=".././theme/css/main.css" type="text/css" />
<link href=".././feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Kenneth's log ATOM Feed" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" media="all" href=".././css/ie.css"/>
<script src=".././js/IE8.js" type="text/javascript"></script><![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="all" href=".././css/ie6.css"/><![endif]-->
</head>
<body id="index" class="home">
<a href="http://github.com/kennethreitz/">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" />
</a>
<header id="banner" class="body">
<h1>
<a href="../.">Kenneth's log </a>
</h1>
<nav><ul>
<li >
<a href=".././category/Life.html">Life</a>
</li>
<li >
<a href=".././category/Code.html">Code</a>
</li>
<li class="active">
<a href=".././category/projects.html">projects</a>
</li>
</ul></nav>
</header><!-- /#banner -->
<aside id="featured" class="body"><article>
<h1 class="entry-title"><a href=".././tablib.html">Tablib</a></h1>
<p>Tablib is an extensive Python module for working with tabular datasets. It allows you create tables of data using standard Python datatypes, manipulate them, and easily export to Excel, JSON, YAML, and CSV.</p>
<p>Basic Usage:</p>
<pre class="literal-block">
import tablib
headers = ('first_name', 'last_name', 'gpa')
data = [('John', 'Adams', 90), ('George', 'Washington', 67)]
data = tablib.Dataset(*data, headers=headers)
</pre>
<p>You can manipulate your data like a standard Python list:</p>
<pre class="literal-block">
&gt;&gt;&gt; data.append(('Henry', 'Ford', 83))
&gt;&gt;&gt; print data['first_name']
['John', 'George', 'Henry']
&gt;&gt;&gt; del data[1]
</pre>
<p>You can easily export your data to JSON, YAML, XLS, and CSV.</p>
<pre class="literal-block">
&gt;&gt;&gt; print data.json
[{&quot;first_name&quot;: &quot;John&quot;, &quot;last_name&quot;: &quot;Adams&quot;, &quot;gpa&quot;: 90},
{&quot;first_name&quot;: &quot;Henry&quot;, &quot;last_name&quot;: &quot;Ford&quot;, &quot;gpa&quot;: 83}]
&gt;&gt;&gt; print data.yaml
- {age: 90, first_name: John, last_name: Adams}
- {age: 83, first_name: Henry, last_name: Ford}
&gt;&gt;&gt; print data.csv
first_name,last_name,age
John,Adams,90
Henry,Ford,83
&gt;&gt;&gt; open('people.xls', 'w').write(data.xls)
</pre>
<p>Excel files with multiple sheets are also supported (via the DataBook object).</p>
<p>[Source on GitHub] [PyPi Listing]</p>
</article>
</aside><!-- /#featured -->
<section id="content" class="body">
<h1>Other articles</h1>
<hr />
<ol id="posts-list" class="hfeed">
<li><article class="hentry">
<header>
<h1><a href=".././github-syncer-in-python.html" rel="bookmark" title="Permalink to GitHub Syncer in Python">GitHub Syncer in Python</a></h1>
</header>
<div class="entry-content">
<p>Today I rewrote a little utility I've been using for a while to
keep all of my GitHub repos up to date and organized. It updates /
clones all private, public, and watched repositories from your
account. It also detects if your repo is a mirror or fork, and
files ...</p>
<a class="readmore" href=".././github-syncer-in-python.html">read more</a>
</div><!-- /.entry-content -->
</article></li>
</ol><!-- /#posts-list -->
</section><!-- /#content -->
<section id="extras" class="body">
<div class="blogroll">
<h2>Links</h2>
<ul>
<li><a href="http://github.com/kennethreitz">GitHub Repos</a></li>
<li><a href="http://flickr.com/kennethreitz">Photography (Flickr)</a></li>
<li><a href="http://twitter.com/kennethreitz">Latest Tweets</a></li>
<li><a href="http://www.linkedin.com/in/kennethreitz">R&eacute;sum&eacute;</a></li>
<li><a href="http://pick.im/kenneth-reitz">Design Portfolio</a></li>
<li><a href="http://laterstars.com/kennethreitz">Later Stars</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<ul>
<li><a href=".././feeds/all.atom.xml" rel="alternate">atom feed</a></li>
<li><a href="http://facebook.com/kennethreitz">Facebook</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
&copy; 2011 Kenneth Reitz &amp; co. All Rights Reserved.
</address><!-- /#about -->
</footer><!-- /#contentinfo -->
<script type="text/javascript">
var disqus_shortname = 'kennethreitz';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<script type="text/javascript" charset="utf-8">
var disqus_developer = 1;
</script>
</body>
</html>