<p>I actually <a href="https://github.com/mniip/Doger/blob/44b4dcafde3b71c5d2d2446e376318ad0ab91487/Transactions.py" rel="nofollow">wrote a program</a> that does this for an IRC tipbot.</p>

<p>Essentially you need to do the following:</p>

<ul>
<li>Start the <strong>command-line</strong> dogecoin server by doing <code>./dogecoind -server</code>. I'm not sure if the dogecoind file is available for OS X. <a href="http://techspry.com/how-to/how-to-install-litecoind-bitcoind-dogecoind-on-os-x-10-9-mavericks/" rel="nofollow">See here</a></li>
<li>Import the library: <code>import dogecoinrpc</code></li>
<li>Open a connection in your python program: <code>conn = dogecoinrpc.connect_to_local()</code></li>
</ul>

<p>Now you can do the following:</p>

<ul>
<li>Get account balance with <code>conn.getbalance('joe', minconf=4)</code></li>
<li>Get total balance with <code>conn.getbalance('',minconf=4)</code>
<ul>
<li>In these examples, <code>minconf=4</code> tell it it only return the balance that has 4 or more confirmations</li>
</ul></li>
<li>Full list of API calls <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list" rel="nofollow">here</a>. I know it says Bitcoin, but the API is the same</li>
</ul>

CC BY-SA 4.0
2021-04-02T22:34:05.770Z
how do you add new wallet's like "joe"?
Rob
CC BY-SA 3.0
2014-06-13T13:25:29.090Z
2014-06-13T13:25:29.090Z
TheDoctor
<p>I want to get a Dogecoin service up that holds, sends, and checks the balances of Dogecoin wallets. I plan on running this service via the Django Web framework so I need Python libraries for dealing with Dogecoin.</p>

<p>I've already found a Python wallet generator for all the top Crypto-currencies:
<a href="https://github.com/onenameio/coinkit" rel="nofollow">https://github.com/onenameio/coinkit</a></p>

<p>now I need to find a way to send money using any public and private key for Dogecoin. I've found this Python library that seems to have the ability to connect to a Dogecoin-Qt:</p>

<p><a href="http://jcsaaddupuy.github.io/dogecoin-python/doc/usage.html" rel="nofollow">http://jcsaaddupuy.github.io/dogecoin-python/doc/usage.html</a></p>

<p>But this documentation is completely leaves out the wallet itself. Right away it tells you to run this line of Python code: </p>

<pre><code>&gt;&gt;&gt; conn = dogecoinrpc.connect_to_local()
</code></pre>

<p>But what local dogecoin exactly is this thing connecting to?? Is it connecting to the Dogecoin-Qt app which is already installed on my OS X computer?</p>

<p>So if I enter that line of Python code in the Python shell interpreter, it seems to go through without any problems. And so immediately in the documentation the very next step involves getting the balance already, this is where I'm lost:</p>

<pre><code>&gt;&gt;&gt; print "Your balance is %f" % (conn.getbalance(),)
</code></pre>

<p>The guide never got into any specifics of what wallet or key pair we're working with, and so here's how the entire guide pans out:</p>

<pre><code>&gt;&gt;&gt; import dogecoinrpc
&gt;&gt;&gt; conn = dogecoinrpc.connect_to_local()
&gt;&gt;&gt; print "Your balance is %f" % (conn.getbalance(),)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "build/bdist.macosx-10.9-intel/egg/dogecoinrpc/connection.py", line 444, in getbalance
  File "build/bdist.macosx-10.9-intel/egg/dogecoinrpc/proxy.py", line 121, in __call__
  File "build/bdist.macosx-10.9-intel/egg/dogecoinrpc/proxy.py", line 72, in request
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 791, in send
    self.connect()
</code></pre>

<p>What wallet are we trying to get the balance from in this guide? </p>

<p>Is there a better way to perform Dogecoin transactions via pure Python?</p>

<wallet><dogecoin>
Best way to send Dogecoins and view wallet balance with Python?
Matt Andrzejczuk
# Best way to send Dogecoins and view wallet balance with Python?

(Asked by: username_0 on 2014-04-25)

I want to get a Dogecoin service up that holds, sends, and checks the balances of Dogecoin wallets. I plan on running this service via the Django Web framework so I need Python libraries for dealing with Dogecoin.

I've already found a Python wallet generator for all the top Crypto-currencies:
<https://github.com/onenameio/coinkit>

now I need to find a way to send money using any public and private key for Dogecoin. I've found this Python library that seems to have the ability to connect to a Dogecoin-Qt:

<http://jcsaaddupuy.github.io/dogecoin-python/doc/usage.html>

But this documentation is completely leaves out the wallet itself. Right away it tells you to run this line of Python code:

```
>>> conn = dogecoinrpc.connect_to_local()

```

But what local dogecoin exactly is this thing connecting to?? Is it connecting to the Dogecoin-Qt app which is already installed on my OS X computer?

So if I enter that line of Python code in the Python shell interpreter, it seems to go through without any problems. And so immediately in the documentation the very next step involves getting the balance already, this is where I'm lost:

```
>>> print "Your balance is %f" % (conn.getbalance(),)

```

The guide never got into any specifics of what wallet or key pair we're working with, and so here's how the entire guide pans out:

```
>>> import dogecoinrpc
>>> conn = dogecoinrpc.connect_to_local()
>>> print "Your balance is %f" % (conn.getbalance(),)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.9-intel/egg/dogecoinrpc/connection.py", line 444, in getbalance
  File "build/bdist.macosx-10.9-intel/egg/dogecoinrpc/proxy.py", line 121, in __call__
  File "build/bdist.macosx-10.9-intel/egg/dogecoinrpc/proxy.py", line 72, in request
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 791, in send
    self.connect()

```

What wallet are we trying to get the balance from in this guide?

Is there a better way to perform Dogecoin transactions via pure Python?

**Tags:** wallet, dogecoin


---

## 1 answers

### Answer by username_1 on 2014-06-13. Score: 1

I actually [wrote a program](https://github.com/mniip/Doger/blob/44b4dcafde3b71c5d2d2446e376318ad0ab91487/Transactions.py) that does this for an IRC tipbot.

Essentially you need to do the following:

* Start the **command-line** dogecoin server by doing `./dogecoind -server`. I'm not sure if the dogecoind file is available for OS X. [See here](http://techspry.com/how-to/how-to-install-litecoind-bitcoind-dogecoind-on-os-x-10-9-mavericks/)
* Import the library: `import dogecoinrpc`
* Open a connection in your python program: `conn = dogecoinrpc.connect_to_local()`

Now you can do the following:

* Get account balance with `conn.getbalance('joe', minconf=4)`
* Get total balance with `conn.getbalance('',minconf=4)`
  + In these examples, `minconf=4` tell it it only return the balance that has 4 or more confirmations
* Full list of API calls [here](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list). I know it says Bitcoin, but the API is the same

> **Comments:**
> **username_2**: how do you add new wallet's like "joe"?  

---

