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 TikzPictureimports theTikzPictureclass from thetikzpypackage. -
The second line of code is analogous to the TeX code
\begin{tikzpicture}and\end{tikzpicture}. The variabletikzis 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
|