Skip to main content

pppic

CI PyPI

A PIC processor written in pure Python that is compatible with dpic 2025.08.01 and produces PSTricks output, like dpic -p. No compiler, no dpic.exe, no dependencies.

The name follows gpic and dpic; the ppp stands for Python, PSTricks and Peter.

pppic implements the dpic language: macros (define), for loops, if/else, blocks, labels, positions, copy, sprintf and the object geometry and PSTricks backend of dpic. The sh command is never executed.

It is one part of a pure-Python toolchain for Circuit Macros:

Package Replaces Role
pym4 GNU m4 m4 → pic
pppic dpic -p pic → PSTricks
m4cmpy m4cm.py m4 → PDF / PNG / JPG / SVG / EPS

Install

pip install pppic

Use

Command line (-p is accepted for dpic compatibility; PSTricks is the only output):

pppic -p examples/shapes.pic > shapes.tex
pym4 -I path/to/circuit_macros circuit.m4 | pppic -p > circuit.tex

Python:

from pppic import PicCompiler, compile_pic

print(compile_pic('.PS\nbox "hello"; arrow; circle\n.PE\n'))

compiler = PicCompiler(include_dirs=["path/to/circuit_macros"])
tex = compiler.compile(open("circuit.pic").read())
print(compiler.errors, compiler.warnings)

Include the result in LaTeX with \usepackage{pstricks} and compile with latex + dvips (or use m4cmpy).

Examples and tests

examples holds plain PIC files and a Circuit Macros diagram pre-expanded by pym4. The unit tests also compile every example:

python -m unittest discover -s tests -v

Licence

BSD-2-Clause; see LICENSE. pppic is a Python port of dpic by J. D. Aplevich, and keeps dpic's licence and copyright notice.

Metadata

Release files for pppic 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pppic 1.0.0
File Size Uploaded Provenance
pppic-1.0.0.tar.gz 30.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pppic 1.0.0
File Interpreter ABI Platform
pppic-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.3 kB

Release files / pppic-1.0.0.tar.gz

Download URL pppic-1.0.0.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d16e5a250d8b83877f4991531046241b53358d9c7afca0369d7a0aac233fa6b8
BLAKE2b-256 checksum
How to use checksums
9dd3b9281c3f219794c0ba9f0ff210dae4c7602f2eaba765a57470a281cd8d20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / pppic-1.0.0-py3-none-any.whl

Download URL pppic-1.0.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dce2da93acb3b4d44f02f80b80a669188f0c40cc3598487c6168065fe3ba074e
BLAKE2b-256 checksum
How to use checksums
f6e8c0011754edbf0440be211b0f447a21e2ea45697ca89a9aed129b9da4e830
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for pppic 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pppic-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page