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
Metadata
Release files for python-backlog 0.7.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_backlog-0.7.4.tar.gz | 18.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_backlog-0.7.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.7 kB
Release files / python_backlog-0.7.4.tar.gz
| Download URL | python_backlog-0.7.4.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20a3293cca1acd95adf522da1c0409cd684d8a99e3751fafa950a683c023657c
|
|
BLAKE2b-256 checksum How to use checksums |
0ec57a14724b0c3576d7ad625d78e418d46be867674406236e8f467491cc5261
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / python_backlog-0.7.4-py3-none-any.whl
| Download URL | python_backlog-0.7.4-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bed9c3306f8fc985bf085e02ce1672466fd2fab07a36c9c4fda8e2df61992fdb
|
|
BLAKE2b-256 checksum How to use checksums |
c91b7a2c98c475ad2ff77ed37d4e1e473120c8cb0a57084118dd17b9b282f146
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|