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 details)

Uploaded Source

File details

Details for the file texonomy-0.2.0.tar.gz.

File metadata

  • Download URL: texonomy-0.2.0.tar.gz
  • Upload date:
  • Size: 38.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for texonomy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d6272b06e1d92f8f854b3b538fd96e98381e55d3da18191a2a53bfbbf78ac423
MD5 9bf3f066df1a7b08bb053eb61ae5d4ce
BLAKE2b-256 d7a4fcfab8fab1d20304c0f78e4ea23025b595ea8686fe973ada52bdf79c36d9

See more details on using hashes here.

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