用于StrongArm.io API的Python库
stronglib的Python项目详细描述
StrongLib是Apache2许可的Python库,用于 strongarm.ioAPI。
功能
- 令牌身份验证
- 获取、创建和删除黑洞域
安装
最新版本可以从PyPI:
安装$ pip install --upgrade stronglib
最新开发版本可以直接从github安装:
$ pip install --upgrade https://github.com/percipient/stronglib/tarball/master
用法
importstrongarm# token authenticationstrongarm.api_key='your_api_token'# get (ie, search) a single Domaindomain=strongarm.Domain.get('example.com')print(domain.name)# list all blackholed domainsfordomaininstrongarm.Domain.all():print(domain.name)# list just blacklisted domainsfordomaininstrongarm.Domain.filter(statuses=strongarm.Domain.BLACKLISTED)# create a new blackholed domaindomain=strongarm.Domain.create(name='example.com')# create a new whitelisted domaindomain=strongarm.Domain.create(name='my-company.com',status=strongarm.Domain.WHITELISTED,description='Our Company Website')# delete a blackholed domaindomain.delete()
开发
为了开发StrongLib,必须安装需求文件。
pip install -r requirements.txt
使用pytest运行测试套件:
py.test
贡献
- 检查未解决的问题或打开新问题以开始讨论 围绕一个功能想法或一个bug。
- 如果你对某个问题或你的改变感到不舒服或不确定, 欢迎发邮件给我们,我们会很乐意帮助您的。
- 从github上的forkthe repository开始对 master分支(或分支)。
- 编写一个测试,显示错误已被修复或功能 按预期工作。
- 发送一个pull请求并对维护程序进行bug操作,直到它被合并并 出版。:)确保将自己添加到AUTHORS。