Pandoc Documents for Python
Project description
Pandoc (Python Library)
This README is about the 2.x branch of the library (alpha stage!).
Getting started
Install the latest version with:
$ pip install --upgrade git+https://github.com/boisgera/pandoc.git
The Pandoc command-line tool is a also required dependency ; you may install it with :
$ conda install -c conda-forge pandoc
Overview
This project brings Pandoc's data model for markdown documents to Python:
$ echo "Hello world!" | python -m pandoc read
Pandoc(Meta(map()), [Para([Str('Hello'), Space(), Str('world!')])])
It can be used to analyze, create and transform documents, in Python :
>>> import pandoc
>>> text = "Hello world!"
>>> doc = pandoc.read(text)
>>> doc
Pandoc(Meta(map()), [Para([Str('Hello'), Space(), Str('world!')])])
>>> paragraph = doc[1][0]
>>> paragraph
Para([Str('Hello'), Space(), Str('world!')])
>>> from pandoc.types import Str
>>> paragraph[0][2] = Str('Python!')
>>> pandoc.write(doc)
'Hello Python!\n'
Pandoc is the general markup converter (and Haskell library) written by John MacFarlane.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pandoc-2.0a3.tar.gz
(37.0 kB
view details)
File details
Details for the file pandoc-2.0a3.tar.gz
.
File metadata
- Download URL: pandoc-2.0a3.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13e062333a983a8d84c3ebaea4495b470c86011a7efc51d8cd408cb04b23e09 |
|
MD5 | 2a7641094b9c3bb997a4e6d391d120b7 |
|
BLAKE2b-256 | 36224324a67535a3bdcd51cc1f2c573d7bee52fc66dfac9fd40a91d3f54728f4 |