python-backlog


Namepython-backlog JSON
Version 0.7.4 PyPI version JSON
download
home_pagehttps://github.com/hassaku63/pbl
SummaryBacklog API v2 wrapper
upload_time2024-09-07 08:29:14
maintainerNone
docs_urlNone
authorhassaku63
requires_python>=3.8
licenseMIT
keywords nulab backlog
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hassaku63/pbl",
    "name": "python-backlog",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "nulab backlog",
    "author": "hassaku63",
    "author_email": "hassaku63@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0e/c5/7a14724b0c3576d7ad625d78e418d46be867674406236e8f467491cc5261/python_backlog-0.7.4.tar.gz",
    "platform": null,
    "description": "# pbl\n\nA Python package wraps Backlog API V2\n\n## Usage\n\nInstall\n\n```bash\npip install python-backlog\n```\n\nCode snippet\n\n```python\nimport base64\nimport json\nfrom backlog.base import BacklogAPI\n\n\ndef main():\n    \"\"\"\n    Initialize API Object\n    \"\"\"\n    api = BacklogAPI(\"your-space\", \"your-api-key\")\n\n    \"\"\"\n    Project API\n    \"\"\"\n    # list project users\n    # https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-project-list/\n    print(\"# list project users\")\n    users = api.project.list_users(\"SampleProject\")\n    print(json.dumps(users, indent=2))\n\n\n    \"\"\"\n    Wiki API\n    \"\"\"\n    # list wikis\n    # https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-list/\n    print(\"# list wikis\")\n    wikis = api.wiki.list(\"SampleProject\")\n    print(json.dumps(wikis[0], indent=2))\n\n    # get attachment\n    # https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-issue-attachment/\n    print(\"# get attachment\")\n    wiki = [w for w in api.wiki.list(\"SampleProject\") if len(w[\"attachments\"]) > 0][0]\n    attachment = api.wiki.get_attachment(\n        wikiId=wiki[\"id\"],\n        attachmentId=wiki[\"attachments\"][0][\"id\"])\n    attachment[\"data\"] = base64.b64encode(attachment[\"data\"]).decode()\n    print(json.dumps(attachment, indent=2))\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## See also\n\nQiita https://qiita.com/hassaku_63/items/b9eb2a1c7ecd3c19507d\n\n## Contact\n\nTwitter: [hassaku_63](https://twitter.com/hassaku_63)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Backlog API v2 wrapper",
    "version": "0.7.4",
    "project_urls": {
        "Homepage": "https://github.com/hassaku63/pbl",
        "Source": "https://github.com/hassaku63/pbl"
    },
    "split_keywords": [
        "nulab",
        "backlog"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c91b7a2c98c475ad2ff77ed37d4e1e473120c8cb0a57084118dd17b9b282f146",
                "md5": "26312cd043b20c08fa813bb547db96d2",
                "sha256": "bed9c3306f8fc985bf085e02ce1672466fd2fab07a36c9c4fda8e2df61992fdb"
            },
            "downloads": -1,
            "filename": "python_backlog-0.7.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "26312cd043b20c08fa813bb547db96d2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 13482,
            "upload_time": "2024-09-07T08:29:13",
            "upload_time_iso_8601": "2024-09-07T08:29:13.606296Z",
            "url": "https://files.pythonhosted.org/packages/c9/1b/7a2c98c475ad2ff77ed37d4e1e473120c8cb0a57084118dd17b9b282f146/python_backlog-0.7.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ec57a14724b0c3576d7ad625d78e418d46be867674406236e8f467491cc5261",
                "md5": "d666ebce84033db0586cd0968f982d4b",
                "sha256": "20a3293cca1acd95adf522da1c0409cd684d8a99e3751fafa950a683c023657c"
            },
            "downloads": -1,
            "filename": "python_backlog-0.7.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d666ebce84033db0586cd0968f982d4b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18211,
            "upload_time": "2024-09-07T08:29:14",
            "upload_time_iso_8601": "2024-09-07T08:29:14.931797Z",
            "url": "https://files.pythonhosted.org/packages/0e/c5/7a14724b0c3576d7ad625d78e418d46be867674406236e8f467491cc5261/python_backlog-0.7.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-07 08:29:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hassaku63",
    "github_project": "pbl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "requirements": [],
    "tox": true,
    "lcname": "python-backlog"
}
        
Elapsed time: 0.44364s