Skip to main content

E360 Chart Image Client

pipeline status

E360 Chart Image Client for Python

Requires Python 3.12+. Packaging uses uv and pyproject.toml.

Development

Requires Python 3.12+ and uv.

This package depends on clients_core, resolved from the internal e360-pypi index (see [tool.uv.index] / [tool.uv.sources] in pyproject.toml). On a machine that can reach Artifactory, sync dependencies—for example with UV_INDEX_URL set to https://rwes-artifactory01.internal.imsglobal.com/artifactory/api/pypi/e360-pypi/simple if your tooling needs it (see clients-core README for the same pattern):

uv sync --group dev

Run tests and lint:

uv run pytest
uv run ruff check chart_image_clients tests

Introduction

Utilises the E360-ChartImage-Service microservice.

Features

  • Uses the Plotly endpoint to send requests to.
  • Returns an chart content as bytes.

Usage

An example of a full implementation

from clients_core.authentication.token_handler import OIDCTokenHandler
from clients_core.api_match_client import ApiMatchClient, MatchSpec
from clients_core.secured_rest_client import SecuredRestClient
from sd_clients.service_directory_client import ServiceDirectoryClient
from chart_image_clients import ChartImageServicePlotlyClient


token_handler = OIDCTokenHandler(
    "https://e360-identity-dev.internal.imsglobal.com:20001/connect/token",
    "<CLIENT_ID>", "<CLIENT_SECRET>", False)

rest_client = SecuredRestClient(
    "https://e360-service-directory-service-dev.internal.imsglobal.com/",
    ["service-directory-service"], token_handler, verify_ssl=False)

sd_client = ServiceDirectoryClient(rest_client)

match_client = ApiMatchClient(sd_client)

match_spec = MatchSpec("E360-ChartImage-Service", "Plotly", 1, 0, 0, ["e360_chart_image_service"])

service_rest_client = match_client.get_secured_client(
    match_spec, token_handler, extra_headers=ChartImageServicePlotlyClient.extra_headers, verify_ssl=False)

ci = ChartImageServicePlotlyClient(service_rest_client, user_id='<USER_GUID>')

payload = {
    "data": [
        {
            "x": [
                "giraffes",
                "orangutans",
                "monkeys"
            ],
            "y": [
                20,
                14,
                23
            ],
            "type": "bar"
        }
    ]
}

image_bytes = ci.get_chart_bytes(payload)

Metadata

Release files for chart-image-clients 1.2.2

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

Built distribution (wheel)

Table of built distributions (wheels) for chart-image-clients 1.2.2
File Interpreter ABI Platform
chart_image_clients-1.2.2-py3-none-any.whl Python 3 none any Details

Release files / chart_image_clients-1.2.2-py3-none-any.whl

Download URL chart_image_clients-1.2.2-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06d5b31aed3a1ca141052732dbf50fcc46af5ad347a863ec949ec2010b982bf4
BLAKE2b-256 checksum
How to use checksums
fd9d5b52854cdb14ae84f423b01bf46ca2c6f0c87094a7a97d195f220c2779ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for chart-image-clients 1.2.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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