Skip to main content

Reusable API connectors for Jira, GitLab, and Confluence

Project description

Platform connectors

Table of Contents

Overview

This module provides async client classes to interact with:

  • Jira: fetch issues and metadata
  • Confluence: retrieve pages and space information
  • GitLab: access repositories and merge requests
  • Http: base HTTP client for platform communication

All clients require authentication credentials passed as constructor parameters.

Installation

All the project is managed with Poetry. To install it, please visit the official page and follow these instructions :

poetry shell
poetry install --without dev

For the developers, it is useful to install extra tools like :

These tools can be installed with the following command :

poetry install

The Git hooks can be installed with :

poetry run pre-commit install

The hooks can be run manually at any time :

poetry run pre-commit run --all-file

Usage

import asyncio
from platform_connectors import JiraClient, ConfluenceClient, GitlabClient

async def main():
    # Jira example
    async with JiraClient(
        jira_url="https://my.jira.server.com",
        jira_username="user@example.com",
        jira_password="token"
    ) as jira_session:
        issues = await jira_session.tickets_from_jql(jql="project = TEST")
        changelogs = await jira_session.changelogs_from_tickets(issues)

    # GitLab example
    async with GitlabClient(
        gitlab_url="https://my.gitlab.server.com",
        gitlab_token="token"
    ) as gitlab_session:
        mrs = await gitlab_session.merge_requests(project_id=123)
        for mr in mrs:
            commits = await gitlab_session.commits_from_merge_request(
                project_id=mr["project_id"],
                merge_request_iid=mr["iid"]
            )

    # Confluence example
    async with ConfluenceClient(
        confluence_url="https://my.confluence.server.com",
        confluence_username="user@example.com",
        confluence_password="token"
    ) as confluence_session:
        space = await confluence_session.get_space_from_key(space_key="DOCS")
        pages = await confluence_session.get_all_pages_in_space(space_id=space["id"])

asyncio.run(main())

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be as defined in the Apache-2.0 license without any additional terms or conditions.

See CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

platform_connectors-0.1.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

platform_connectors-0.1.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file platform_connectors-0.1.0.tar.gz.

File metadata

  • Download URL: platform_connectors-0.1.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for platform_connectors-0.1.0.tar.gz
Algorithm Hash digest
SHA256 73e1cce8fcf5f7ba921e5df5489b32037233be86674c407bc28db60ef3c5b1f4
MD5 878fc0b78047d87bcd50d81540ba52fd
BLAKE2b-256 38f99819004f62981e283451e1a9831a6a6abc6e1c73abec402d993f0fb01b40

See more details on using hashes here.

File details

Details for the file platform_connectors-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: platform_connectors-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for platform_connectors-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fe77b586792013632103ff4d73b13de4d49f280385deee0ab716ce1731961e8
MD5 b8b05a8c061a236873c7171c28857456
BLAKE2b-256 d8400ccda63b1ad4b0489c384fdc1f507013d26bd74dc28996c699cec747aa06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page