Skip to main content

ops-py-reports

Payloads

Slack App

Creates Slack payload(s) from the provided title and body.

The title will be formatted as bold, while the body will be formatted as a Code block:
[{"text": f"*{title}*\n{body}"}]

  • If the payload is too large it will be split into multiple parts (individual posts).
    • If spilt, the provided title will be used for all posts.
      • The part number will be appended to the title on each post.

Reports

SlackMessages

Accepts a list of dicts and returns Slack Markdown formatted rows.

The get_ssl_report() method creates a message with a provided title in bold (defaults to SSL certificates report) .
If any of the provided rows of dicts contains a status key, the value of this key will be formatted according to the status value. Defaults to the following config:

{
  "ok": {
    "emoji": ":white_check_mark:",
    "txt": "OK"
  },
  "warning": {
    "emoji": ":warning:",
    "txt": "WARNING"
  },
  "critical": {
    "emoji": ":bangbang:",
    "txt": "CRITICAL!"
  },
  "expired": {
    "emoji": ":rotating_light:",
    "txt": "EXPIRED!!"
  },
  "error": {
    "emoji": ":no_entry:",
    "txt": "ERROR"
  },
  "unknown": {
    "emoji": ":question:",
    "txt": "UNKNOWN"
  }
}

The status will use the provided config to apply corresponding emoji and status text.

Markdown

Creates a plain text Markdown table from a list (rows) of lists (columns). The header is the first list in the list of rows.

HTMLTable

Creates a HTML table from a list (rows) of lists (columns). The header is the first list in the list of rows.

Styles

"grey": " style='background-color: Grey; color: White; font-weight:bold'"
"purple": " style='background-color: Purple; color: White; font-weight:bold'"
"yellow": " style='background-color: Yellow; color: Black; font-weight:bold'"
"red": " style='background-color: Red; color: White; font-weight:bold'"
"green": " style='background-color: Green; color: White; font-weight:bold'"

will be added to the cells which equals the following values:

"disabled": "grey"  
"unknown": "grey"  
"warning": "yellow"  
"critical": "red"  
"ok": "green"  
"error": "red"  
"expired": "red"  

Functions

dict_to_rows

Converts a list of dicts to a list of a header and rows.

dict_to_csv

Converts a list of dicts to a comma separated csv text, with a header and rows.

Metadata

Release files for ops-py-reports 0.6.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 ops-py-reports 0.6.0
File Size Uploaded
ops_py_reports-0.6.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ops-py-reports 0.6.0
File Interpreter ABI Platform
ops_py_reports-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 kB

Release files / ops_py_reports-0.6.0.tar.gz

Download URL ops_py_reports-0.6.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
877820a2bbbd375737db55efc84c8f6b7289ca836e1c51578bb17de8f6b579da
BLAKE2b-256 checksum
How to use checksums
71374f0846339204a615c61ae454a5ec9dd98ec3870d76ed4848a1ce3eefa3f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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 28, 2024.

Transparency log

Release files / ops_py_reports-0.6.0-py3-none-any.whl

Download URL ops_py_reports-0.6.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d802b564caabbb11082d0838c7a7c1c7131b02a4078ebca6e3155423bd8e9aad
BLAKE2b-256 checksum
How to use checksums
4a0ee65e2ed303efe3f12a03d2b91b1bdb4309c1b7bb5d6adae5d9cff40ad3fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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 28, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

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