Skip to main content

CSL styles.

Project description

https://img.shields.io/travis/inveniosoftware/citeproc-py-styles.svg https://img.shields.io/coveralls/inveniosoftware/citeproc-py-styles.svg https://img.shields.io/pypi/v/citeproc-py-styles.svg

About

This module is meant to be used as a static resources package, in order to make it easy to include the required Citation Style files (.csl) when using citeproc-py.

In order to avoid always installing ~40MB of files each time you include it in a project you could specify it as an extra in your setup.py, and only use it in the production environment or as an optional feature of your module. (Example setup.py)

The included files are originally hosted on the CSL Style Repository which belongs to the CSL Project

Note: The style files are referenced as a git submodule. This means that this repository/package is pinned on a specific commit of the CSL Style Repository, and thus may not include any fixes or new styles that may have been added. Next versions of this repository will of course ‘bump’ the styles version to the latest commit, but this will not happen on a scheduled basis for the time being.

Installation

citeproc-py-styles is on PyPI so all you need is:

pip install citeproc-py-styles

Usage

This is a minimal example of how one could use citeproc-py-styles to render a citation with citeproc-py:

from citeproc import (Citation, CitationItem, CitationStylesBibliography,
                      CitationStylesStyle, formatter)
from citeproc.source.json import CiteProcJSON
from citeproc_styles import get_style_filepath

csl_data = json.loads("...")
source = CiteProcJSON(csl_data)

style_path = get_style_filepath('apa')
style = CitationStylesStyle(style_path)

bib = CitationStylesBibliography(style, source, formatter.plain)
bib.register(Citation([CitationItem('data_id')]))
print(''.join(bib.bibliography()[0]))

Project details


Download files

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

Source Distribution

citeproc-py-styles-0.1.1.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

citeproc_py_styles-0.1.1-py2.py3-none-any.whl (8.2 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file citeproc-py-styles-0.1.1.tar.gz.

File metadata

File hashes

Hashes for citeproc-py-styles-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3856920968f1c5873bff2e85e4753131797f27a034c59f2b2e8dd625f1732a69
MD5 e64aabbb2ea4e334703445a72468c76a
BLAKE2b-256 4049b402387b77ccc977ff4e44578348d2ccb9a2d29d1f2b858b29bc932eec2a

See more details on using hashes here.

Provenance

File details

Details for the file citeproc_py_styles-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for citeproc_py_styles-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9c1c8c8eba0f45435f20ee9818019d5ce48707dc309bf72848aab3c98266dd2a
MD5 e5ef886755daae728a91669204d6ebc4
BLAKE2b-256 f7b3008102b5aa867289ff70f50f0b58bc019e58ed5d9d94243eaf57c6272cb5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page