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.5.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

citeproc_py_styles-0.1.5-py2.py3-none-any.whl (11.9 MB view details)

Uploaded Python 2Python 3

File details

Details for the file citeproc_py_styles-0.1.5.tar.gz.

File metadata

  • Download URL: citeproc_py_styles-0.1.5.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for citeproc_py_styles-0.1.5.tar.gz
Algorithm Hash digest
SHA256 20a82e22b4eb814039449ba83be8c142a385e6f6f17f5b70b1b33b3fd1f8e619
MD5 87457a29ee2df6b537a9b99c6b7d3a88
BLAKE2b-256 a95ff404e956c24ea487563eb898e5a34cf4a399cd3f29e0a62abfd85d8e38c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for citeproc_py_styles-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2d15558d82fc447daf49a0861f01b51ee9dbc0d2f1872ac87fb6545867620433
MD5 52847dca82c5f27d250953099fa94768
BLAKE2b-256 7cf446806ef35525b9025561f1a05cc28f7f88a19ee4e03e4d005f7da3dd46e3

See more details on using hashes here.

Supported by

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