Skip to main content

Create easy-to-understand graphs

Project description

graspgraph

Create easy-to-understand graphs

Concept

Make it easier to understand with graphs

Stats

Database ER diagram-like

Pivot table

What is possible

statsgraph

  1. Graphing statistics

dbergraph

  1. Graphing database table definition information

pivotgraph

  1. Graphing a pivot table

Reason for development

  • I want to make things that are difficult to understand through text alone easier to understand by creating graphs

Versions

Version Summary
0.3.4 Add pivotgraph
0.2.5 Refactoring
0.2.4 Add dbergraph
0.1.0 Release graspgraph(statsgraph)

Installation

graspgraph

pip install graspgraph

Graphviz

Required for PDF output

Poppler

Required for PDF image conversion

Usage

statsgraph

import graspgraph as gg

statsgraph = gg.Statsgraph(
  gg.StatsgraphAxis([1, 2, 3, 4, 5]),
  gg.StatsgraphAxis([11, 12, 13, 14, 15]),
  gg.FigureColors(line = "blue"))
figure = statsgraph.to_figure()
figure.LayoutTitleText = "<b>[statsgraph]<br>タイトル</b>"
figure.XTitleText = "X軸"
figure.YTitleText = "Y軸"
figure.Write("./statsgraph.png")

dbergraph

import graspgraph as gg

prefix = "./database"
dbergraph = gg.Dbergraph(gg.Database.from_file_path(gg.Path.join(prefix, "yaml")))
dbergraph.Database.update()
dot = dbergraph.to_dot()
dot.TitleText = "<b>[dbergraph]</b>"
pdfFilePath = gg.Path.join(prefix, "pdf")
pngFilePath = gg.Path.join(prefix, "png")
dot.Write(pdfFilePath)
gg.Pdf.convert(pdfFilePath, pngFilePath)

pivotgraph

import graspgraph as gg

pivotTable = gg.PivotTable.from_array([
  ["", "収入", "支出", "利益"],
  ["1月", 1, 2, 3],
  ["2月", -1, -2.5, -2],
  ["3月", 0, -0.5, 1],
])
pivotgraph = gg.Pivotgraph(gg.PivotgraphAxis(pivotTable, gg.FigureTick(2)), gg.PivotgraphColors(bars = ["blue", "red", "green"]))
figure = pivotgraph.to_figure()
figure.LayoutTitleText = "<b>[pivotgraph]</b>"
figure.XTitleText = "金額(百万円)"
figure.YTitleText = "月次"
figure.Write("./images/pivot/usage.png")

CLI

pdf.convert

Convert PDF to image

1. Image(PNG) conversion by CLI execution

pdf.convert # <pdf file path> <image file path>

graspgraph pdf.convert graph.pdf graph.png

graph.png is done.

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

graspgraph-0.3.4.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

graspgraph-0.3.4-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file graspgraph-0.3.4.tar.gz.

File metadata

  • Download URL: graspgraph-0.3.4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for graspgraph-0.3.4.tar.gz
Algorithm Hash digest
SHA256 f7adc0bb30c6107c10e5b0512cd802b4f5a2ff523b94b7d5c3b202d603c0183f
MD5 ee0c0d96bfc53fc705085418b4bdae6e
BLAKE2b-256 f0177c08feef07f8d667ba5f593ab686407021446ed5dc0b0e7a7b09a448a429

See more details on using hashes here.

File details

Details for the file graspgraph-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: graspgraph-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for graspgraph-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7782785961bccbefa2a6601e599df0d22266789c3dc20aaf6e312c6373038a05
MD5 8b5bf8e109a44fb61cb6594adb209f82
BLAKE2b-256 a7f714c2bef8f27be0fb374eabd32532782fd27f441185b869530707c15e9b66

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