Factuursturen.nl的API剩余客户类别
factuursturen的Python项目详细描述
====
factuursturen
===
要能够使用api,您需要一个api密钥。您可以通过以下步骤获得:
*登录http://www.factuursturen.nl
*单击"instellingen"
*单击"verbindingen"
*单击"maak api sleutel"
在您阅读本文时提供)
/usr/bin/env python
import factuursturen
username='foo'
apikey='some_long_string'
clients=fact.get('clients')
new_product={'code':'productcode',
"name":"name of this product",
"price":123.45,
"taxes":21}
尝试:
fact.post('products',data)
除了factuursturenwrongpostvalue作为错误消息:
打印"oops!{errorMessage}.格式(errorMessage=errorMessage)
invoices=fact.get('invoices')
invoicesnr=invoice[u'invoicenr']
尝试:
pdf=fact.get('invoices_pdf',invoicenr)
filename='/tmp/{invoicenr}.pdf'。打开(filename,"w")作为f:
f.write(pdf)
打印"{}已写入"。格式(文件名)
除factuursturenemptyresult之外:
打印"factuur{invoicenr}为空"。格式(invoicenr=invoicenr)
安装:
==
sudo pip install factuursturen
或:
*下载源代码
*将
*cd解压缩到包含setup.py
*键入此命令
python setup.py install
对api文档的更改
=客户是蟒蛇,因此,有些东西被翻译:
-布尔值被返回为真布尔值(而不是带有"true"的字符串)
-嵌套字典可以用于发布(将自动展平)
-返回的dict与dict的结构相同,dict可以用于发布
示例
==
初始化
----
在实例化对象时,可以传递用户名和apikey:
import factuursturen
username='foo'
apikey='一些长字符串'
fact=factuursturen.client(apikey,用户名)
,或者在当前目录或主目录中创建一个名为.factuursturen_rc的文件,如下所示:
[默认值]
username=foo
apikey=some_long_string
(注意:没有引号!),并在不明确传递它们的情况下创建对象:
fact=factuursturen.client()
create a product
---------
fact=factuursturen.client()
new_product={'code':'productcode',
"name":"name of this product",
"price":123.45,
"taxes":21}
尝试:
fact.post('产品,新产品)
除了factuursturen.factuursturenwrongpostvalue作为错误消息:
打印"噢!{errorMessage}。格式(errorMessage=errorMessage)
'Zipcode':'1337 JB',
'City':'Johnsville',
'Country':146,
'Phone':'010 123 4567',
'Mobile':'0612 34 56 78',
'email':'johnny@bravo.com',
'bankcode':'123456789',
'taxnumber':'nl001234567b01',
'tax-shifted':false,
'sendmethod':'email',
'paymentmethod':'bank',
'top':3,
"stddiscount":5.30,
"mailinro":"亲爱的强尼,",
"reference":{"line1":"your ref:abc123",
"line2":"our ref:xzx0029/2932/001",
"line3":"谢谢您的订单"},
'notes':'此客户总是延迟付款',
'发票上的notes':false
}
尝试:
clientid=fact.post('clients',客户端)
打印"添加了id{id}的客户端"。格式(id=clientid)
factuursturen除外。factuursturen错误消息:
打印"oops!{errorMessage}。格式(errorMessage=errorMessage)
-
factuursturen
===
要能够使用api,您需要一个api密钥。您可以通过以下步骤获得:
*登录http://www.factuursturen.nl
*单击"instellingen"
*单击"verbindingen"
*单击"maak api sleutel"
/usr/bin/env python
import factuursturen
username='foo'
apikey='some_long_string'
clients=fact.get('clients')
new_product={'code':'productcode',
"name":"name of this product",
"price":123.45,
"taxes":21}
尝试:
fact.post('products',data)
除了factuursturenwrongpostvalue作为错误消息:
打印"oops!{errorMessage}.格式(errorMessage=errorMessage)
invoices=fact.get('invoices')
invoicesnr=invoice[u'invoicenr']
尝试:
pdf=fact.get('invoices_pdf',invoicenr)
filename='/tmp/{invoicenr}.pdf'。打开(filename,"w")作为f:
f.write(pdf)
打印"{}已写入"。格式(文件名)
除factuursturenemptyresult之外:
打印"factuur{invoicenr}为空"。格式(invoicenr=invoicenr)
安装:
==
sudo pip install factuursturen
或:
*下载源代码
*将
*cd解压缩到包含setup.py
*键入此命令
python setup.py install
对api文档的更改
=客户是蟒蛇,因此,有些东西被翻译:
-布尔值被返回为真布尔值(而不是带有"true"的字符串)
-嵌套字典可以用于发布(将自动展平)
-返回的dict与dict的结构相同,dict可以用于发布
示例
==
初始化
----
在实例化对象时,可以传递用户名和apikey:
import factuursturen
username='foo'
apikey='一些长字符串'
fact=factuursturen.client(apikey,用户名)
,或者在当前目录或主目录中创建一个名为.factuursturen_rc的文件,如下所示:
[默认值]
username=foo
apikey=some_long_string
(注意:没有引号!),并在不明确传递它们的情况下创建对象:
create a product
---------
new_product={'code':'productcode',
"name":"name of this product",
"price":123.45,
"taxes":21}
尝试:
fact.post('产品,新产品)
除了factuursturen.factuursturenwrongpostvalue作为错误消息:
打印"噢!{errorMessage}。格式(errorMessage=errorMessage)
'Zipcode':'1337 JB',
'City':'Johnsville',
'Country':146,
'Phone':'010 123 4567',
'Mobile':'0612 34 56 78',
'email':'johnny@bravo.com',
'bankcode':'123456789',
'taxnumber':'nl001234567b01',
'tax-shifted':false,
'sendmethod':'email',
'paymentmethod':'bank',
'top':3,
"stddiscount":5.30,
"mailinro":"亲爱的强尼,",
"reference":{"line1":"your ref:abc123",
"line2":"our ref:xzx0029/2932/001",
"line3":"谢谢您的订单"},
'notes':'此客户总是延迟付款',
'发票上的notes':false
}
尝试:
clientid=fact.post('clients',客户端)
打印"添加了id{id}的客户端"。格式(id=clientid)
factuursturen除外。factuursturen错误消息:
打印"oops!{errorMessage}。格式(errorMessage=errorMessage)
-