Skip to main content

pbl

A Python package that wraps the Backlog API v2.

  • Requires Python 3.10 or later.
  • No runtime dependencies: only the Python standard library is used.

Usage

Install

pip install python-backlog

Code snippet

import base64
import json
from backlog.base import BacklogAPI


def main():
    """
    Initialize API Object
    """
    # The API key is sent in the "Backlog-API-Key" request header.
    # Requests time out after 30 seconds by default (configurable with `timeout=`).
    api = BacklogAPI("your-space", "your-api-key")

    # Categories
    # https://developer.nulab.com/docs/backlog/api/2/get-category-list/
    print(api.category.list("SampleProject"))

    """
    Project API
    """
    # list project users
    # https://developer.nulab.com/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.com/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.com/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()

Errors

  • backlog.base.BacklogError is raised when the API returns a non-2xx response.
  • backlog.base.BacklogConnectionError (a subclass of BacklogError) is raised when the request could not be sent or no response was received, for example on a timeout.

TLS certificates

HTTPS certificates are verified against the system trust store (it also honors SSL_CERT_FILE and SSL_CERT_DIR). If certifi is installed, or REQUESTS_CA_BUNDLE or CURL_CA_BUNDLE is set, those CA certificates are trusted as well.

Upgrading to 0.9

0.9.0 removed the dependency on requests:

  • BaseAPI.invoke_method() returns a backlog._http.Response instead of a requests.Response. It provides status_code, ok, headers, content, text and json().
  • invoke_method() only accepts the timeout and files keyword arguments. Requests-specific options such as verify or proxies raise TypeError. Proxies are still read from the HTTP(S)_PROXY and NO_PROXY environment variables.
  • Network errors raise BacklogConnectionError instead of requests.exceptions.*.
  • Redirects are not followed, so the API key is never sent to another host.
  • Project.list_categories(), add_category(), update_category() and delete_category() are deprecated. Use BacklogAPI.category instead.

See also

Qiita https://qiita.com/hassaku_63/items/b9eb2a1c7ecd3c19507d

Contact

Please open an issue on GitHub.

Twitter: hassaku_63

Metadata

Release files for python-backlog 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-backlog 0.9.0
File Size Uploaded Provenance Actions
python_backlog-0.9.0.tar.gz 28.4 kB With provenance Details for python_backlog-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-backlog 0.9.0
File Interpreter ABI Platform Actions
python_backlog-0.9.0-py3-none-any.whl Python 3 none any Details for python_backlog-0.9.0-py3-none-any.whl

Total release size: 46.8 kB

Release files / python_backlog-0.9.0.tar.gz

Download URL python_backlog-0.9.0.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
636646634b246fb2c8d008f0d8cc5d0b09efc9e846a6cf401467e8d09523693c
BLAKE2b-256 checksum
How to use checksums
e946039827d35479f8342dfeb5c03970ce6119216b343b2ab6e2d2148b197e7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / python_backlog-0.9.0-py3-none-any.whl

Download URL python_backlog-0.9.0-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dab637cafeff7b03cc5cd7559179b21240f17f95106c2747118ee19373ac3fa
BLAKE2b-256 checksum
How to use checksums
96bcfdc326309652bc696ef5b2286ccfa08441211b9f5007e06d9c4d011ca17d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for python-backlog 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for python_backlog-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page