Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Allow definition of custom metadata parsers for Pelican content

Project Description

A plugin for Pelican that allows the easy definition of custom metadata parsers.


To install the library, you can use pip

$ pip install pelican-metadataparsing


  1. Update

    1. Add metadataparsing to PLUGINS.

      You should add it before any metadata-affecting plugins.

      PLUGINS = [..., 'metadataparsing', ...]
    2. Define your custom metadata parsers through the METADATA_PARSERS setting:

          "<metadata-field-name1>": <function parser1(x)>,
          "<metadata-field-name2>": <function parser2(x)>
  2. Corresponding fields of the page, article or entity object will have the value returned from the respective parser function.


Multi-line metadata to simple string

import collections
import six

def parse_description(string):
    if string is None or isinstance(string, six.string_types):
        return string

    if isinstance(string, collections.Iterable):
        string = " ".join(string)

    return string

    "Description": parse_description

For a working example check my site and my site’s source code.

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(7.0 kB) Copy SHA256 Hash SHA256
Source None Aug 26, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate