Skip to main content

No project description provided

Project description

texonomy

texonomy* is a Python tool that facilitates the generation of entity-relationship diagrams in $\LaTeX$ using TikZ.

License Build Status codecov PyPI Docs

*An entity-relationship diagram is more of an ontology than a taxonomy, but when the shoe fits...

Overview

Writing $\LaTeX$ code can be tedious; texonomy makes it easier. This tool generates entity-relationship diagrams in $\LaTeX$ using a beginner-friendly Python interface, so you can spend less time wrestling with missing semicolons.

Prerequisites

To install texonomy, you'll need python3.8 or higher and pip.

In order to output as a PDF, you'll need to install some software that includes pdflatex, like TeX Live (recommended):

sudo apt install texlive
sudo apt-get install texlive-pictures # for TikZ
sudo apt-get install texlive-plain-generic # for ulem

Getting started

Install texonomy with the following command:

pip install texonomy

Example usage

Let's create a very simple program with texonomy. First, we'll create an Entity object to represent a fruit:

fruit = Entity("Fruit", ["SKU", "name", "price", "origin"])

The first argument is the entity's name, "Fruit". The second argument is a list of the entity's attributes.

Let's create a diagram that contains our fruit entity...

diag = ERDiagram(fruit)

...and output the generated $\LaTeX$ to a file!

with open("fruit.tex", "w") as er:
    er.write(diag.to_latex())

Then, you can run pdflatex (or something similar) on the command line to generate a PDF from this $\LaTeX$:

pdflatex fruit.tex
Screen Shot 2023-03-26 at 8 18 18 PM

It's that simple! Take a look at the programs in texonomy/tests/integration_tests for more examples of API usage.

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

texonomy-0.2.0.tar.gz (38.6 kB view hashes)

Uploaded Source

Supported by

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