<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module notehub</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>notehub</strong></big></big> (18 January 2014)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/sean/projects/notehub/notehub.py">/home/sean/projects/notehub/notehub.py</a></font></td></tr></table>
    <p><tt>A&nbsp;simple&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;api.<br>
&nbsp;<br>
A&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;api&nbsp;that&nbsp;simplifies&nbsp;much&nbsp;of&nbsp;the&nbsp;work&nbsp;needed&nbsp;to<br>
make&nbsp;a&nbsp;call.&nbsp;The&nbsp;wrapper&nbsp;handles&nbsp;the&nbsp;work&nbsp;of&nbsp;adding&nbsp;necessary&nbsp;parameters,<br>
hashing&nbsp;passwords,&nbsp;generating&nbsp;signatures,&nbsp;encoding&nbsp;the&nbsp;data&nbsp;and&nbsp;checking<br>
response&nbsp;codes.<br>
&nbsp;<br>
*************************************************************<br>
***You&nbsp;will&nbsp;need&nbsp;a&nbsp;PID&nbsp;and&nbsp;PSK&nbsp;from&nbsp;<a href="http://notehub.org/api">http://notehub.org/api</a>***<br>
***in&nbsp;order&nbsp;to&nbsp;use&nbsp;the&nbsp;create_note&nbsp;and&nbsp;update_note&nbsp;methods.**<br>
*************************************************************<br>
&nbsp;<br>
Example&nbsp;use:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;notehub&nbsp;import&nbsp;<a href="#Notehub">Notehub</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;notehub&nbsp;import&nbsp;<a href="#NotehubError">NotehubError</a><br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;PID&nbsp;=&nbsp;'example_pid'&nbsp;#&nbsp;Replace&nbsp;with&nbsp;your&nbsp;PID<br>
&nbsp;&nbsp;&nbsp;&nbsp;PSK&nbsp;=&nbsp;'example_psk'&nbsp;#&nbsp;Replace&nbsp;with&nbsp;your&nbsp;PSK<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;nh&nbsp;=&nbsp;<a href="#Notehub">Notehub</a>(PID,&nbsp;PSK)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;get_note<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.get_note('2014/1/26/test')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;create_note<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.create_note(note_text)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;create_note&nbsp;with&nbsp;password<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;password&nbsp;=&nbsp;'<PASSWORD>'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.create_note(note_text,&nbsp;password=password)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;create_note&nbsp;with&nbsp;specific&nbsp;theme&nbsp;and&nbsp;fonts<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;theme&nbsp;=&nbsp;'solarized-light'<br>
&nbsp;&nbsp;&nbsp;&nbsp;text_font&nbsp;=&nbsp;'Alegreya&nbsp;Sans&nbsp;SC'<br>
&nbsp;&nbsp;&nbsp;&nbsp;header_font&nbsp;=&nbsp;'Chau&nbsp;Philomene&nbsp;One'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.create_note(note_text,&nbsp;theme=theme,&nbsp;text_font=text_font,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header_font=header_font)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;update_note<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_id&nbsp;=&nbsp;'2014/1/26/test-note-123-1'<br>
&nbsp;&nbsp;&nbsp;&nbsp;new_note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;password&nbsp;=&nbsp;'<PASSWORD>'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.update_note(note_id,&nbsp;new_note_text,&nbsp;password)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="json.html">json</a><br>
</td><td width="25%" valign=top><a href="requests.html">requests</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#Exception">builtins.Exception</a>(<a href="builtins.html#BaseException">builtins.BaseException</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="notehub.html#NotehubError">NotehubError</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="notehub.html#Notehub">Notehub</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Notehub">class <strong>Notehub</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;api.<br>
&nbsp;<br>
Attributes:<br>
&nbsp;&nbsp;&nbsp;&nbsp;pid:&nbsp;The&nbsp;publisher&nbsp;ID&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.<br>
&nbsp;&nbsp;&nbsp;&nbsp;psk:&nbsp;The&nbsp;publisher&nbsp;secret&nbsp;key&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;version:&nbsp;The&nbsp;api&nbsp;version&nbsp;to&nbsp;use.&nbsp;(Default:&nbsp;'1.3').<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Notehub-__init__"><strong>__init__</strong></a>(self, pid, psk, version<font color="#909090">='1.3'</font>)</dt><dd><tt>Constructor&nbsp;for&nbsp;<a href="#Notehub">Notehub</a>&nbsp;<a href="builtins.html#object">object</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;&nbsp;pid:&nbsp;The&nbsp;publisher&nbsp;ID&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.<br>
&nbsp;&nbsp;&nbsp;&nbsp;psk:&nbsp;The&nbsp;publisher&nbsp;secret&nbsp;key&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.<br>
&nbsp;&nbsp;&nbsp;&nbsp;version:&nbsp;Optional.&nbsp;Default&nbsp;'1.3'.&nbsp;Which&nbsp;version&nbsp;of&nbsp;the&nbsp;API&nbsp;to&nbsp;use.</tt></dd></dl>

<dl><dt><a name="Notehub-create_note"><strong>create_note</strong></a>(self, note_text, password<font color="#9<PASSWORD>90">=''</font>, theme<font color="#909090">=''</font>, text_font<font color="#909090">=''</font>, header_font<font color="#909090">=''</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;note&nbsp;on&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;with&nbsp;the&nbsp;given&nbsp;text.<br>
&nbsp;<br>
Makes&nbsp;a&nbsp;call&nbsp;to&nbsp;<a href="#Notehub">Notehub</a>.orgs&nbsp;CREATE&nbsp;NOTE&nbsp;api.&nbsp;To&nbsp;edit&nbsp;a&nbsp;note&nbsp;later<br>
a&nbsp;password&nbsp;must&nbsp;be&nbsp;given.&nbsp;If&nbsp;successful&nbsp;the&nbsp;note's&nbsp;ID&nbsp;and&nbsp;some&nbsp;URLs<br>
linking&nbsp;too&nbsp;it&nbsp;will&nbsp;be&nbsp;returned.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text:&nbsp;The&nbsp;ID&nbsp;of&nbsp;the&nbsp;note&nbsp;to&nbsp;request.<br>
&nbsp;&nbsp;&nbsp;&nbsp;password:&nbsp;Optional.&nbsp;A&nbsp;password&nbsp;to&nbsp;allow&nbsp;for&nbsp;updating&nbsp;the&nbsp;note.<br>
&nbsp;&nbsp;&nbsp;&nbsp;theme:&nbsp;Optional.&nbsp;The&nbsp;color&nbsp;theme&nbsp;to&nbsp;use.<br>
&nbsp;&nbsp;&nbsp;&nbsp;text_font:&nbsp;Optional.&nbsp;Font&nbsp;to&nbsp;use&nbsp;for&nbsp;body&nbsp;text.<br>
&nbsp;&nbsp;&nbsp;&nbsp;header_font:&nbsp;Optional.&nbsp;Font&nbsp;to&nbsp;use&nbsp;for&nbsp;header&nbsp;text.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;dict&nbsp;populated&nbsp;from&nbsp;the&nbsp;JSON&nbsp;response&nbsp;of&nbsp;the&nbsp;API&nbsp;call.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#NotehubError">NotehubError</a>:&nbsp;There&nbsp;was&nbsp;a&nbsp;problem&nbsp;making&nbsp;the&nbsp;call.&nbsp;Check&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;message.</tt></dd></dl>

<dl><dt><a name="Notehub-get_note"><strong>get_note</strong></a>(self, note_id)</dt><dd><tt>Retreives&nbsp;the&nbsp;text&nbsp;of&nbsp;a&nbsp;note&nbsp;on&nbsp;<a href="#Notehub">Notehub</a>.org.<br><commit_msg>Updating documenation for new API version.<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module notehub</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>notehub</strong></big></big> (18 January 2014)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/sean/src/python/notehub/notehub.py">/home/sean/src/python/notehub/notehub.py</a></font></td></tr></table>
    <p><tt>A&nbsp;simple&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;api.<br>
&nbsp;<br>
A&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;api&nbsp;that&nbsp;simplifies&nbsp;much&nbsp;of&nbsp;the&nbsp;work&nbsp;needed&nbsp;to<br>
make&nbsp;a&nbsp;call.&nbsp;The&nbsp;wrapper&nbsp;handles&nbsp;the&nbsp;work&nbsp;of&nbsp;adding&nbsp;necessary&nbsp;parameters,<br>
hashing&nbsp;passwords,&nbsp;generating&nbsp;signatures,&nbsp;encoding&nbsp;the&nbsp;data&nbsp;and&nbsp;checking<br>
response&nbsp;codes.<br>
&nbsp;<br>
*************************************************************<br>
***You&nbsp;will&nbsp;need&nbsp;a&nbsp;PID&nbsp;and&nbsp;PSK&nbsp;from&nbsp;<a href="http://notehub.org/api">http://notehub.org/api</a>***<br>
***in&nbsp;order&nbsp;to&nbsp;use&nbsp;the&nbsp;create_note&nbsp;and&nbsp;update_note&nbsp;methods.**<br>
*************************************************************<br>
&nbsp;<br>
Example&nbsp;use:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;notehub&nbsp;import&nbsp;<a href="#Notehub">Notehub</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;notehub&nbsp;import&nbsp;<a href="#NotehubError">NotehubError</a><br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;PID&nbsp;=&nbsp;'example_pid'&nbsp;#&nbsp;Replace&nbsp;with&nbsp;your&nbsp;PID<br>
&nbsp;&nbsp;&nbsp;&nbsp;PSK&nbsp;=&nbsp;'example_psk'&nbsp;#&nbsp;Replace&nbsp;with&nbsp;your&nbsp;PSK<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;nh&nbsp;=&nbsp;<a href="#Notehub">Notehub</a>(PID,&nbsp;PSK)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;get_note<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.get_note('2014/1/26/test')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;create_note<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.create_note(note_text)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;create_note&nbsp;with&nbsp;password<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;password&nbsp;=&nbsp;'<PASSWORD>'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.create_note(note_text,&nbsp;password=password)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;create_note&nbsp;with&nbsp;specific&nbsp;theme&nbsp;and&nbsp;fonts<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;theme&nbsp;=&nbsp;'solarized-light'<br>
&nbsp;&nbsp;&nbsp;&nbsp;text_font&nbsp;=&nbsp;'Alegreya&nbsp;Sans&nbsp;SC'<br>
&nbsp;&nbsp;&nbsp;&nbsp;header_font&nbsp;=&nbsp;'Chau&nbsp;Philomene&nbsp;One'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.create_note(note_text,&nbsp;theme=theme,&nbsp;text_font=text_font,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header_font=header_font)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;update_note<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_id&nbsp;=&nbsp;'2014/1/26/test-note-123-1'<br>
&nbsp;&nbsp;&nbsp;&nbsp;new_note_text&nbsp;=&nbsp;'Test&nbsp;note&nbsp;123.'<br>
&nbsp;&nbsp;&nbsp;&nbsp;password&nbsp;=&nbsp;'<PASSWORD>'<br>
&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;note&nbsp;=&nbsp;nh.update_note(note_id,&nbsp;new_note_text,&nbsp;password)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(note)<br>
&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;<a href="#NotehubError">NotehubError</a>&nbsp;as&nbsp;e:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(e)</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="json.html">json</a><br>
</td><td width="25%" valign=top><a href="requests.html">requests</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#Exception">builtins.Exception</a>(<a href="builtins.html#BaseException">builtins.BaseException</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="notehub.html#NotehubError">NotehubError</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="notehub.html#Notehub">Notehub</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Notehub">class <strong>Notehub</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;api.<br>
&nbsp;<br>
Attributes:<br>
&nbsp;&nbsp;&nbsp;&nbsp;pid:&nbsp;The&nbsp;publisher&nbsp;ID&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.<br>
&nbsp;&nbsp;&nbsp;&nbsp;psk:&nbsp;The&nbsp;publisher&nbsp;secret&nbsp;key&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;version:&nbsp;The&nbsp;api&nbsp;version&nbsp;to&nbsp;use.&nbsp;(Default:&nbsp;'1.4').<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Notehub-__init__"><strong>__init__</strong></a>(self, pid, psk, version<font color="#909090">='1.4'</font>)</dt><dd><tt>Constructor&nbsp;for&nbsp;<a href="#Notehub">Notehub</a>&nbsp;<a href="builtins.html#object">object</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;&nbsp;pid:&nbsp;The&nbsp;publisher&nbsp;ID&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.<br>
&nbsp;&nbsp;&nbsp;&nbsp;psk:&nbsp;The&nbsp;publisher&nbsp;secret&nbsp;key&nbsp;received&nbsp;from&nbsp;<a href="#Notehub">Notehub</a>.org.<br>
&nbsp;&nbsp;&nbsp;&nbsp;version:&nbsp;Optional.&nbsp;Default&nbsp;'1.4'.&nbsp;Which&nbsp;version&nbsp;of&nbsp;the&nbsp;API&nbsp;to&nbsp;use.</tt></dd></dl>

<dl><dt><a name="Notehub-create_note"><strong>create_note</strong></a>(self, note_text, password<font color="#909090">=''</font>, theme<font color="#909090">=''</font>, text_font<font color="#909090">=''</font>, header_font<font color="#909090">=''</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;note&nbsp;on&nbsp;<a href="#Notehub">Notehub</a>.org&nbsp;with&nbsp;the&nbsp;given&nbsp;text.<br>
&nbsp;<br>
Makes&nbsp;a&nbsp;call&nbsp;to&nbsp;<a href="#Notehub">Notehub</a>.orgs&nbsp;CREATE&nbsp;NOTE&nbsp;api.&nbsp;To&nbsp;edit&nbsp;a&nbsp;note&nbsp;later<br>
a&nbsp;password&nbsp;must&nbsp;be&nbsp;given.&nbsp;If&nbsp;successful&nbsp;the&nbsp;note's&nbsp;ID&nbsp;and&nbsp;some&nbsp;URLs<br>
linking&nbsp;too&nbsp;it&nbsp;will&nbsp;be&nbsp;returned.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;&nbsp;note_text:&nbsp;The&nbsp;ID&nbsp;of&nbsp;the&nbsp;note&nbsp;to&nbsp;request.<br>
&nbsp;&nbsp;&nbsp;&nbsp;password:&nbsp;Optional.&nbsp;A&nbsp;password&nbsp;to&nbsp;allow&nbsp;for&nbsp;updating&nbsp;the&nbsp;note.<br>
&nbsp;&nbsp;&nbsp;&nbsp;theme:&nbsp;Optional.&nbsp;The&nbsp;color&nbsp;theme&nbsp;to&nbsp;use.<br>
&nbsp;&nbsp;&nbsp;&nbsp;text_font:&nbsp;Optional.&nbsp;Font&nbsp;to&nbsp;use&nbsp;for&nbsp;body&nbsp;text.<br>
&nbsp;&nbsp;&nbsp;&nbsp;header_font:&nbsp;Optional.&nbsp;Font&nbsp;to&nbsp;use&nbsp;for&nbsp;header&nbsp;text.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;dict&nbsp;populated&nbsp;from&nbsp;the&nbsp;JSON&nbsp;response&nbsp;of&nbsp;the&nbsp;API&nbsp;call.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#NotehubError">NotehubError</a>:&nbsp;There&nbsp;was&nbsp;a&nbsp;problem&nbsp;making&nbsp;the&nbsp;call.&nbsp;Check&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;message.</tt></dd></dl>

<dl><dt><a name="Notehub-get_note"><strong>get_note</strong></a>(self, note_id)</dt><dd><tt>Retreives&nbsp;the&nbsp;text&nbsp;of&nbsp;a&nbsp;note&nbsp;on&nbsp;<a href="#Notehub">Notehub</a>.org.<br>
{'fraction_non_alphanumeric': 0.2778668427008676, 'fraction_numerical': 0.014004149377593362, 'mean_word_length': 18.47566574839302, 'pattern_counts': {'":': 0, '<': 712, '<?xml version=': 0, '>': 712, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2307420', 'n_tokens_mistral': 8729, 'n_tokens_neox': 8252, 'n_words': 582}