{"id":22546495,"url":"https://github.com/deephaven/report-generation-plugin","last_synced_at":"2025-04-10T00:52:22.766Z","repository":{"id":78595817,"uuid":"271077588","full_name":"deephaven/report-generation-plugin","owner":"deephaven","description":"The report generation plugin enables users to create and send structured reports","archived":false,"fork":false,"pushed_at":"2024-12-02T21:59:22.000Z","size":148,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"release/20211129","last_synced_at":"2025-04-10T00:52:15.066Z","etag":null,"topics":["database","deephaven","plugin","reports"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deephaven.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-09T18:16:43.000Z","updated_at":"2023-09-09T16:29:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"43518995-0172-488a-bf60-3077ff394799","html_url":"https://github.com/deephaven/report-generation-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Freport-generation-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Freport-generation-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Freport-generation-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Freport-generation-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deephaven","download_url":"https://codeload.github.com/deephaven/report-generation-plugin/tar.gz/refs/heads/release/20211129","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137995,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","deephaven","plugin","reports"],"created_at":"2024-12-07T15:08:00.804Z","updated_at":"2025-04-10T00:52:22.730Z","avatar_url":"https://github.com/deephaven.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reports Plugin\nThe Reports Plugin ([io.deephaven.plugins.report.*](src/main/java/io/deephaven/plugins/report/))\nenables users to create structured [Reports][Report].\n\nA [Report] is composed of a title, a timestamp, and an [Item].\n\nAn [Item] is one of the following:\n * [Text] represents a string value\n * [Table] represents a Deephaven table\n * [Figure] represents a Deephaven plot\n * [Group] represents an ordered list of [Items][Item]\n\nA [Group] provides the ability to structure reports hierarchically.\n\nThe basic report model does not (and should not) contain styling or layout information.\nAdditional information can be attached to any [Item] as named attributes, which may be useful for\nstyling or layout information.\n\n### Language Ergonomics\nThe strongly-typed object model backing [Reports][Report] and [Items][Item] is potentially verbose\nto construct. A series of [Functions] and implicit coercions are provided to aid in the construction\nof these objects.\n\n#### Type coercions\n* A `CharSequence` will be coerced into a [Text].\n* A `com.illumon.iris.db.tables.Table` will be coerced into a [TableLocal].\n* A `com.illumon.iris.db.plot.Figure` will be coerced into a [FigureLocal].\n* An `Iterable` or array will be coerced into a [Group], with each element coerced.\n\n#### Common helper methods\n* `report(String name, Object... items)`\n* `named(String name, Object... items)`\n* `figure(Object obj)`\n\nThe full list of helper methods can be found in [Functions].\n\n### Examples\n\n```groovy\nimport static io.deephaven.plugins.report.Functions.*\n\ndef date = currentDateNy()\ndef pnl_table = db.i(\"Devins\", \"PNL\").where(\"Date=$date\")\ndef pnl_plot = plot(\"PNL\", pnl_table, \"Timestamp\", \"PNL\").show()\ndef pnl_report = report(\"Devin's PNL Report for $date\", pnl_table.tail(1), figure(pnl_plot).withSize(800, 400))\n```\n\n```groovy\n...\ndef section_1 = named(\"Weeklies\", weeklies_plot, weeklies_summary_table)\ndef section_2 = named(\"Monthlies\", monthlies_plot, monthlies_summary_table)\ndef section_3a = [quarterlies_plot_a, quarterlies_summary_table_a]\ndef section_3b = [quarterlies_plot_b, quarterlies_summary_table_b]\ndef section_3 = named(\"Quarterlies\", section_3a, section_3b)\ndef expiration_report = report(\"By Expiration Report\", section_1, section_2, section_3)\n```\n\n```groovy\n...\ndef intro = \"This is some introductory text...\"\ndef historical = [[aapl_plot_historical, spy_plot_historical], \"Some commentary on historical trends.\"]\ndef recent = [[aapl_plot_recent, spy_plot_recent], \"Some commentary on recent trends.\"]\ndef conclusion = \"Given the above, we should plan to do X, Y, and Z.\"\ndef aapl_v_spy_report = report(\"AAPL v SPY\", intro, historical, recent, conclusion)\n```\n\n```groovy\n...\ndef pq1 = figure(pq(\"devin\", \"My Query\"), \"my_plot\")\ndef pq2 = figure(pq(31337L), \"my_other_plot\")\ndef my_report = report(\"From PQs\", pq1, pq2)\n```\n\n## Email\n\nThe email section ([io.deephaven.plugins.email.*](src/main/java/io/deephaven/plugins/email/)) of the\nReports Plugin allows users to create and send HTML-based emails from [Reports][Report].\n\n### Example server configuration\n\n```groovy\ndef email = io.deephaven.plugins.email.Functions.nonStatic()\n\ndef gmail_server = email.gmail(\"user\", \"pass\")\n\ndef localhost_server = email.localhost()\n\ndef custom_server = email.server()\n  .hostName(\"the-hostname.example.com\")\n  .smtpPort(31337)\n  .sslOnConnect(true)\n  .auth(email.auth(\"user\", \"password\"))\n  .build()\n```\n\n### Example header configuration\n\n```groovy\ndef email = io.deephaven.plugins.email.Functions.nonStatic()\n\ndef email_1 = email.header()\n  .sender(\"somebody@example.com\")\n  .addRecipients(\"list1@example.com\")\n  .addRecipientsCC(\"admin@example.com\")\n  .subject(\"[REPORT] Daily report XYZ\")\n  .build()\n\ndef email_2 = email.header()\n  .sender(\"operator@example.com\")\n  .addRecipients(\"devin@example.com\")\n  .subject(\"[ALERT] Disk space quota exceeded\")\n  .build()\n```\n\n### Example sending report\n\n```groovy\nimport static io.deephaven.plugins.report.Functions.*\n\ndef email = io.deephaven.plugins.email.Functions.nonStatic()\n\n// construct the report\ndef date = currentDateNy()\ndef pnl_table = db.i(\"Devins\", \"PNL\").where(\"Date=$date\")\ndef pnl_plot = plot(\"PNL\", pnl_table, \"Timestamp\", \"PNL\").show()\ndef pnl_report = report(\"Devin's PNL Report for $date\", pnl_table.tail(1), figure(pnl_plot).withSize(800, 400))\n\n// configure the email\ndef localhost_server = email.localhost()\ndef email_header = email.header()\n  .sender(\"devin@example.com\")\n  .addRecipients(\"devin@example.com\")\n  .subject(\"[REPORT] Daily PNL\")\n  .build()\n\n// send the email\nemail.send(localhost_server, email_header, pnl_report)\n```\n\n### With explicit lock type\n\n```groovy\ndef email = io.deephaven.plugins.email.Functions.nonStatic()\ndef report = io.deephaven.plugins.report.Functions.nonStatic()\n\nemail.email(\n        email.localhost(),\n        email.header().sender(\"example@example.com\").addRecipients(\"todo@example.com\").subject(\"the subject\").build(),\n        report.report(\"Simple report\", \"Simple text\"))\n        .withLockType(email.noLock())\n```\n\n## Slack\n\n### Standard (shared lock by default)\n\n```groovy\ndef slack = io.deephaven.plugins.slack.Functions.nonStatic()\ndef client = slack.client(slack.config(\"\u003ctoken\u003e\", \"#the_channel\"))\nclient.send(\"Simple string message\")\nclient.send(my_report)\n```\n\n### With explicit lock type\n```groovy\ndef slack = io.deephaven.plugins.slack.Functions.nonStatic()\ndef config = slack.config(\"\u003ctoken\u003e\", \"#the_channel\")\ndef client_with_no_lock = slack.client(config).withLockType(slack.noLock())\ndef client_with_shared_lock = slack.client(config).withLockType(slack.sharedLock())\ndef client_with_exclusive_lock = slack.client(config).withLockType(slack.exclusiveLock())\n```\n\n# Development\n\n### Documentation\n\n  * `./gradlew javadoc`\n  * Open `build/docs/javadoc/index.html`\n\n### Test\n\n`./gradlew check`\n\n### Build\n\n`./gradlew build`\n\n[Report]: src/main/java/io/deephaven/plugins/report/Report.java\n[Item]: src/main/java/io/deephaven/plugins/report/Item.java\n[Text]: src/main/java/io/deephaven/plugins/report/Text.java\n[Table]: src/main/java/io/deephaven/plugins/report/Table.java\n[TableLocal]: src/main/java/io/deephaven/plugins/report/TableLocal.java\n[TablePQ]: src/main/java/io/deephaven/plugins/report/TablePQ.java\n[Figure]: src/main/java/io/deephaven/plugins/report/Figure.java\n[FigureLocal]: src/main/java/io/deephaven/plugins/report/FigureLocal.java\n[FigurePQ]: src/main/java/io/deephaven/plugins/report/FigurePQ.java\n[Group]: src/main/java/io/deephaven/plugins/report/Group.java\n[Functions]: src/main/java/io/deephaven/plugins/report/Functions.java\n[Email]: src/main/java/io/deephaven/plugins/email/Email.java\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeephaven%2Freport-generation-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeephaven%2Freport-generation-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeephaven%2Freport-generation-plugin/lists"}