Skip to main content

CSL styles.

Project description

https://github.com/inveniosoftware/citeproc-py-styles/workflows/CI/badge.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.3.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

citeproc_py_styles-0.1.3-py2.py3-none-any.whl (11.6 MB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: citeproc-py-styles-0.1.3.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for citeproc-py-styles-0.1.3.tar.gz
Algorithm Hash digest
SHA256 94062470b4e6f0deb801e6a2c03fe1672a2f97dd0d8c1882c92ff60725d16405
MD5 2dfe0a674a1200f528757b0d1087d66a
BLAKE2b-256 0e2b4109a406a640fcf4145c4062deb9e9c1c4eb7dd1bd91107de911da0ac54e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: citeproc_py_styles-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.6 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for citeproc_py_styles-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 22183eeab9f5c21811423a3d5e750e10c4ceb817ee9cb36814368fc8c84a6d78
MD5 38efa89143f1c17a601057f1ccc7e687
BLAKE2b-256 e2948a984e85aceb11826e7b8b86b1ede48517725cda66de6cd830cc5b74eda5

See more details on using hashes here.

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