Backlog API v2 wrapper
Project description
pbl
A Python package wraps Backlog API V2
Usage
Install
pip install python-backlog
Code snippet
import base64
import json
from backlog.base import BacklogAPI
def main():
"""
Initialize API Object
"""
api = BacklogAPI("your-space", "your-api-key")
"""
Project API
"""
# list project users
# https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-list/
print("# list project users")
users = api.project.list_users("SampleProject")
print(json.dumps(users, indent=2))
"""
Wiki API
"""
# list wikis
# https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-list/
print("# list wikis")
wikis = api.wiki.list("SampleProject")
print(json.dumps(wikis[0], indent=2))
# get attachment
# https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-attachment/
print("# get attachment")
wiki = [w for w in api.wiki.list("SampleProject") if len(w["attachments"]) > 0][0]
attachment = api.wiki.get_attachment(
wikiId=wiki["id"],
attachmentId=wiki["attachments"][0]["id"])
attachment["data"] = base64.b64encode(attachment["data"]).decode()
print(json.dumps(attachment, indent=2))
if __name__ == "__main__":
main()
See also
Qiita https://qiita.com/hassaku_63/items/b9eb2a1c7ecd3c19507d
Contact
Twitter: hassaku_63
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-backlog-0.5.0.tar.gz
(8.2 kB
view hashes)
Built Distribution
Close
Hashes for python_backlog-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3532a4c8f2222d70de8d103252911d48c36fb836f31cfb60d3111e9a4977c151 |
|
MD5 | 84be17d7c00b27b98480d16ffdd765d9 |
|
BLAKE2b-256 | 3615e290ed2b9c6f5c3b8e06e858f41363ca561bc9cdef653b3d046f0ac8fbd1 |