A python wrapper for tikz
Project description
Tikz-Python
An object-oriented Python approach towards providing a giant wrapper for Tikz code, with the goal of streamlining the process of creating complex figures for TeX documents.
To install it, run
pip install tikz-python
Documentation
We have documentation now! Please visit the documentation site.
Examples
Want to see some nice examples of what this package can do? See here.
How to Use: Basics
An example of this package in action is below.
from tikzpy import TikzPicture # Import the class TikzPicture
tikz = TikzPicture()
tikz.circle((0, 0), 3, options="thin, fill=orange!15")
arc_one = tikz.arc((3, 0), 0, 180, x_radius=3, y_radius=1.5, options="dashed")
arc_two = tikz.arc((-3, 0), 180, 360, x_radius=3, y_radius=1.5)
tikz.show() # Displays a pdf of the drawing to the user
which produces
We explain line-by-line the above code.
-
from tikzpy import TikzPicture
imports theTikzPicture
class from thetikzpy
package. -
The second line of code is analogous to the TeX code
\begin{tikzpicture}
and\end{tikzpicture}
. The variabletikz
is now a tikz environment, specifically an instance of the classTikzPicture
, and we can now append drawings to it. -
The third, fourth, and fifth lines draw a filled circle and two elliptic arcs, which give the illusion of a sphere.
-
In the last line, the call
show()
immediately displays the PDF of the drawing to the user.
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
Built Distribution
File details
Details for the file tikz_python-0.0.6.tar.gz
.
File metadata
- Download URL: tikz_python-0.0.6.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b96cc37fd4635b5a8f21cf1b1211a9142c7a79828664bdb901459edf35d815cb
|
|
MD5 |
3429b87e6f64bf540663bf8cc3425747
|
|
BLAKE2b-256 |
1a84e36be4d51dedef5ad126be5e6d2e437d7a78bce33e0b6926cced33e3b06f
|
File details
Details for the file tikz_python-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: tikz_python-0.0.6-py3-none-any.whl
- Upload date:
- Size: 33.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
9bcd73ad6ae07504a287bffaee209d2aa068a762f5280b4812a8beb64f1dc8b8
|
|
MD5 |
a877e6dc8a538a5262d7c2fce5145186
|
|
BLAKE2b-256 |
a2f10e716da388e6ba4f253d1320a96b097905529417517e8ea9e4d3ef17059b
|