Package: pycirkuit
DescriptionPyCirkuit is a GUI/CLI front-end forCircuit MacrosandDpicby Dwight Aplevich, which make up a software chain for drawing high-quality line diagrams to include in LaTeX, web, LibreOffice or similar documents. PyCirkuit GUI builds a live preview of the source code and can export the resulting images in TikZ code, PDF, SVG, PNG and JPEG formats. More export formats are also planned. PyCirkuit CLI mode is useful for batch-processing multiple files.PyCirkuit is written in Python 3 using the PyQt5 libraries, but is largely inspired (in both ideas and code snippets) onCirkuit, a C++ application written by Matteo Agostinelli using KDE4 libraries, which is nowadays increasingly difficult to compile due to the switching, started in 2013, of KDE project from KDE4 platform to the Qt5-based KDE frameworks 5. A port of Cirkuit to KDE frameworks 5has begun, but's still not functional and its development appears to be stalled.Source codePyCirkuit source code is now hosted on github.com. The project homepage ishttps://github.com/orestesmas/pycirkuit.git.RequirementsAs PyCirkuit is written in python 3 and uses multiplatform GUI libraries, it loads without problems on GNU/Linux, Windows and macOS. However, its execution relies on using some helper applications whose availability on non-GNU systems is irregular. Version 0.1 has been reported to work on MacOS using external tools provided byMacPorts. Works on Windows from version 0.2 onwards, although it's not throughly tested.To install and run this application you need to have the following applications/libraries installed:Qt5 librariesPython 3, with virtual environment supportPyQt5 python bindings to Qt libraries (see note below)'libmagic' and its Python bindings(pdf)latexm4dpicpdftoppm (from poppler project)Circuit MacrosInstallationInstalling on recent Debian/Ubuntu systemsPyCirkuit will hopefully enter Debian Sid/Bullseye shortly after the 0.5.0 release (September 2019). It will also probably be available on Ubuntu 20.04 onwards. On those systems, you can install it by the usual Debian spell (casted as root):apt-get install pycirkuitNote that if your system is Debian Stable you will probably have to usepinningto install selected packages from Debian Testing, or use the more generic methods described below.Installing on older Debian/Ubuntu or other GNU/Linux systemsTo install PyCirkuit in you computer, please follow this steps:Install the auxiliary apps: On Debian-based systems1(e.g. Ubuntu/Kubuntu)
type the following command to install the required apps and dependencies (tested on Ubuntu
18.04 LTS / Debian Stretch):sudo apt-get install texlive-latex-base texlive-latex-recommended \
texlive-base-bin texlive-extra-utils texlive-latex-extra texlive-science texlive-pictures preview-latex-style \
m4 dpic poppler-utils python3-venv libmagic11Debian Buster and older don't havedpicpackaged, but Ubuntu 18.10 (cosmic) has (in
theuniverserepository). If you are trying PyCirkuit in such a Debian system, you'll
have to compile and install it yourself. Luckily, this is very easy because it's a
little program with few/no dependencies. Downloaddpicfromhttps://ece.uwaterloo.ca/~aplevich/dpic/and follow the instructions in the README file.There's no Debian package for the Circuit Macros, but if PyCirkuit doesn't find them at
startup, it will offer the user to download and install them automatically. They don't
require building.In order to isolate PyCirkuit and its dependencies from other python packages on your system, it's advisable to install it into a Python's Virtual Environment. To do so, choose or create a directory somewhere andchange into it. Do the following to create the Virtual Environment inside and activate it:python3 -m venv PyCirkuit
source PyCirkuit/bin/activateInstall PyCirkuit. You have several ways to do so. Choose one of the following:3.1 PyCirkuit is available at thePython Package Index (PyPI), so you can install it using PIP. It will download and install alongside the required dependencies (PyQt5). After installation, PyCirkuit code and files will be underPyCirkuit/lib/python3.X/site-packages/pycirkuitpip install pycirkuit3.2 The former will install the lastest stable version on PyPI. If you prefer to install the latest development version,download it from GitHub as a .ZIP fileand install from it:pip install <path_to_the_downloaded_ZIP_file>If all went well, you can execute PyCirkuit by means of an executable script created underPyCirkuit/bin. Test it with:pycirkuitInstalling on MacOS(These explanations were provided by some user. I cannot test them personally)Prerequisites and dependencies:1.1 You need to have installed Xcode and Xcode command tools. Of course, you will need also Python 3. To install it you can followhttps://www.python.org/downloads/release/python-372/orhttps://docs.python-guide.org/starting/install3/osx/.1.2 Then you have to install LaTeX using MacPorts:https://docs.typo3.org/typo3cms/extensions/sphinx/AdministratorManual/RenderingPdf/InstallingLaTeXLinux.html.1.3 The M4 and DPIC are UNIX apps, so they run without much trouble on macOS. Similar with poppler. Some useful links arehttps://ece.uwaterloo.ca/~aplevich/Circuit_macros/andhttps://www.google.es/amp/macappstore.org/poppler/amp/.Finally, proceed as explained on the steps #2 and #3 of the previous section to create a Python virtual environment and to install PyCirkuit from PyPI there.Installing on MS WindowsInstall the dependencies and auxiliary programs:1.1 Choose a LaTeX distribution for windows. I tested PyCirkuit with MikTeX. Download it fromhttps://miktex.org/and follow the instructions to install it.1.2 Download and install a python 3 interpreter for windows fromhttps://www.python.org/downloads/windows/.1.3 Download and install the M4 macro processor and the DPIC executables for windows fromhttps://ece.uwaterloo.ca/~aplevich/dpic/Windows/index.html1.4 Finally, obtain and install a copy of the "pdftoppm" utility. It usually comes bundled along with other utilities from the "Poppler" library, although it can be found alone on some webs. For instance fromhttp://blog.alivate.com.au/poppler-windows/.You have to put this utilities somewhere on your PATH, but alternatively you can put them inside PyCirkuit code. See #4 below.Prepare a location where to install PyCircuit. It's advisable to install it inside a so-called python environment to isolate it from other python installations and libraries you may have on your system. To do so, choose a directory where to install PyCirkuit. Open a command line (I assume you have how to do it) and navigate to the chosen location. Then create the Python virtual environment and activate it using the commands below:python -m venv PyCirkuit
PyCirkuit\Scripts\activateThe console "prompt" should change and show "(PyCirkuit)" at the beginning indicating the environment is active.To install PyCirkuit, proceed like Step 3 in the "Linux Installation" sectionFor convenience you can put the m4.exe, dpic.exe and pdftoppm.exe executables downloaded before inside the pycirkuit package you've just installed. Copy them to "PyCirkuit\Lib\site-packages\pycirkuit\lib". PyCirkuit will add this directory to the executable's PATH when running.Test the executable:PyCirkuitYou will find some examples inside "PyCirkuit\Lib\site-packages\pycirkuit\examples"When you're done you can deactivate the virtual environment:deactivateor simply close the command line console.UsageTo execute PyCirkuit open a console/terminal window, navigate into the directory where PyCirkuit is installed and activate the virtual environment as in 2:cd<path-to-Virtual-Environment>sourcePyCirkuit/bin/activate(forGNU/Linuxsystems)PyCirkuit\Scripts\activate(forWindowssystems)Then execute the program as above:pycirkuitUpon finished executing PyCirkuit, you should deactivate the virtual environment (and/or close the terminal window):deactivateHave fun!