Skip to main content

LCG Framework

PyPI Tests

LCG is a Python framework for content abstraction and generic document processing. A document is built as a hierarchy of Python objects, independent of any output format, and exported to HTML, PDF, EPUB, Braille and others.

It is meant for developers who need to produce structured documents programmatically -- or read them from a source format -- and publish them in several formats at once. It can also be used directly, as a command line tool turning documents written in a human readable markup into the target format.

What LCG provides

  • One document, many formats. Write the content once and export it to HTML, PDF, EPUB, plain text, MS HTML Help or an IMS package for e-learning systems. Each exporter can be extended or replaced.
  • Content, not markup. Documents are composed of content elements -- paragraphs, sections, tables, definition lists, quotations, figures, mathematics (MathML), inline SVG, plots, audio and video. Custom elements are just new classes, so the framework grows with the application.
  • Braille output that means it. Text is translated through liblouis with the document layout handled by louisutdml, and mathematics is transcribed in the Nemeth code. Documents can be embossed, not just approximated.
  • Accessibility as a design goal. The HTML output follows the W3C standards, and the interactive widgets -- foldable trees, notebooks, popup menus, collapsible sections, an audio player -- are operable by keyboard and announced properly by screen readers.
  • Internationalization beyond gettext. Translation is deferred until export, so one document tree serves several language variants and may mix languages within a single page. Dates, times, decimal and monetary values are localized, plural forms included.
  • Presentation kept apart. Layout and styling are described by presentation sets matched against the content, so the same document can be published in different looks without touching it.
  • E-learning exercises. Multiple choice questions, selections, true/false statements, gap filling and other interactive exercise types are built in -- the framework's original purpose, still supported.

License

LCG is Free Software, distributed under the terms of the GNU General Public License v2 (GPLv2). See the COPYING file for details.

History

LCG stands for Learning Content Generator. It was initially developed to generate online e-learning material for the Eurochance project.

Changelog

For a history of changes in each version, see the changelog.

Installation

LCG is a pure Python library running on Python 3.5 or later and may be installed by pip install lcg-framework[all]. The last version supporting Python 2.7 is 0.8.2.

When using PDF output, you additionally need the following system packages:

  • Fontconfig (Debian/Ubuntu package fontconfig)
  • Freefont (Debian/Ubuntu package fonts-freefont-ttf or ttf-freefont)

Usage

LCG comes with a command line tool which can be run directly using python -m lcg.make to build and export documents into different output formats. Run with --help to find out how to use it.

LCG is also used as a content abstraction layer in the Wiking web application development framework and for document construction and as a print backend in Pytis information systems development framework.

Documentation

The documentation is published at cerha.github.io/lcg.

Its source is also included in the package. To generate the HTML version locally, run make doc from the package root directory.

Metadata

Release files for lcg-framework 0.9.1

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

Source distribution (sdist)

Source distribution for lcg-framework 0.9.1
File Size Uploaded Provenance Actions
lcg_framework-0.9.1.tar.gz 21.5 MB Without provenance Details for lcg_framework-0.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lcg-framework 0.9.1
File Interpreter ABI Platform Actions
lcg_framework-0.9.1-py3-none-any.whl Python 3 none any Details for lcg_framework-0.9.1-py3-none-any.whl

Total release size: 32.4 MB

Release files / lcg_framework-0.9.1.tar.gz

Download URL lcg_framework-0.9.1.tar.gz
Size 21.5 MB
Tags Source
SHA-256 checksum
How to use checksums
6f813e3d86acd0aff123dd27ee930e290a279948cd630809a758cedb8b466de4
BLAKE2b-256 checksum
How to use checksums
5923e1ed6d7d085c1728a7056cc4cfcf7da1486664e3c3ff89671c677e941bfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / lcg_framework-0.9.1-py3-none-any.whl

Download URL lcg_framework-0.9.1-py3-none-any.whl
Size 10.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0cc8d62126ddecb2fe8822154cc5154f053452d895a585f72c250a11665315f3
BLAKE2b-256 checksum
How to use checksums
707844b6532e5ca50774e7a7fbe230ad9e4f725d7b6707b96172715e38b7080b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for lcg-framework 0.9.1

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