WordPress JSON API插件的Python客户端
项目描述
一个简单的Python库,用于以JSON格式与WordPress通信。此库依赖于[WordPress JSON API插件][1]。如果没有安装插件,此库将无法工作。
[1]: http://wordpress.org/extend/plugins/json-api/ “WordPress JSON API”
安装
$ pip install python-wordpress
或者 git clone 和 python setup.py install 以及其他。
用法
>>> from wordpress import WordPress >>> wp = WordPress('http://example.com/blog/') >>> posts = wp.get_recent_posts()
目前,这仅涵盖在 core 控制器下API的 读取 部分。有关详细信息,请参阅[WordPress JSON API文档][2]。
[2]: http://wordpress.org/extend/plugins/json-api/other_notes/
测试假定运行在[MAMP][3]上的WordPress博客,网址为http://localhost:8888/wordpress,但您可以通过设置环境变量 WORDPRESS_BLOG_URL 来更改它,如下所示
WORDPRESS_BLOG_URL=http://wordpress.local.host python test.py
[3]: http://www.mamp.info/en/index.html “MAMP!”
项目详情
关闭
python-wordpress-0.1.3.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | feb305a7f3697af4fc558be5787c429db23f1e6fd43d8a17caf4ba6d60ac508c |
|
MD5 | b6da12546f0cc780db0871ae24b1a617 |
|
BLAKE2b-256 | 46c6e5fcb4eff13f68d4f852a697f68af18521c83c792535b8ef1c9f3fb03500 |