https://github.com/hassaku63/pbl
This is a Python3 library wraps Backlog API V2
https://github.com/hassaku63/pbl
backlog
Last synced: 5 months ago
JSON representation
This is a Python3 library wraps Backlog API V2
- Host: GitHub
- URL: https://github.com/hassaku63/pbl
- Owner: hassaku63
- License: mit
- Created: 2018-12-08T10:19:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-07T08:28:13.000Z (almost 2 years ago)
- Last Synced: 2025-09-29T08:10:01.489Z (9 months ago)
- Topics: backlog
- Language: Python
- Homepage: https://pypi.org/project/python-backlog/
- Size: 123 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# pbl
A Python package wraps Backlog API V2
## Usage
Install
```bash
pip install python-backlog
```
Code snippet
```python
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](https://twitter.com/hassaku_63)