Skip to main content

python-ghostscript

Python-Interface to the Ghostscript C-API

Author:

Hartmut Goebel <h.goebel@crazy-compiler.com>

Version:

0.3

Copyright:

GNU Public License v3 (GPLv3)

Homepage:

http://bitbucket.org/htgoebel/python-ghostscript

Ghostscript, is a well known interpreter for the PostScript language and for PDF. This package implements a interface to the Ghostscript C-API using ctypes. Both a low-level and a pythonic, high-level interface are provided.

This package is currently tested only under GNU/Linux and Windows XP. Please report whether it works in your environment, too. Thanks.

Example

Here is an example for how to use the high-level interface of python-ghostscript. This implements a very basic ps2pdf-tool:

import sys
import ghostscript

args = [
    "ps2pdf", # actual value doesn't matter
    "-dNOPAUSE", "-dBATCH", "-dSAFER",
    "-sDEVICE=pdfwrite",
    "-sOutputFile=" + sys.argv[1],
    "-c", ".setpdfwrite",
    "-f",  sys.argv[2]
    ]

ghostscript.Ghostscript(*args)

Requirements and Installation

Please note:

This package is meant for developers. Even if there are some usable examples included, installations instructions are meant for developers.

python-ghostscript requires

  • Python 2.3 or higher (tested with Python 2.6)

  • ctypes when using Python 2.3 or 2.4 (ctypes is already included in Python 2.5 and higher)

  • setuptools or distribute for installation (see below).

  • Ghostscript Version 8.x

Installing python-ghostscript

Since this package is meant for developers, we assume you have experience in installing Python packages.

python-ghostscript is listed on PyPI (Python Package Index), so you can install it using easy_install or pip as usual. Please refer to the manuals of easy_install resp. pip for further information.

Alternatively you may download and unpack the source package of python-ghostscript from http://pypi.python.org/pypi/ghostscript and run:

python ./setup.py install

Metadata

Release files for ghostscript 0.3

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

Source distributions (sdists)

Source distribution for ghostscript 0.3
File Size Uploaded Provenance
ghostscript-0.3.zip 39.0 kB Without provenance Details
ghostscript-0.3.tar.bz2 25.6 kB Without provenance Details

Release files / ghostscript-0.3.zip

Download URL ghostscript-0.3.zip
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
14168815c9811bade03ce61b3f4e8cc82aacebf15218d740374b6eefff5226d0
BLAKE2b-256 checksum
How to use checksums
ab855404f4d3154d30f4667855a72aa27f9f6f0489bd9b37edde7c8c42c01689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ghostscript-0.3.tar.bz2

Download URL ghostscript-0.3.tar.bz2
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
87c1bc7bfc984fed1732434f8a150897696cad5abdaaabb57b3b7f77b4b30f1f
BLAKE2b-256 checksum
How to use checksums
6cd800ec3842a682959468463e57d2208820bdd7000c0ef1e194ad8caf6f8fc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ghostscript 0.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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