Skip to main content

Handle SPS packages like a breeze.

Project description

scielo.packtools

Python library and command-line utilities to handle SciELO PS XML files that runs on python 2.7, 3.3+.

Build status

master Travis CI Status Latest Documentation Status

Installation

packtools depends on lxml.

Python Package Index (recommended):

$ pip install packtools

Pip + git (versão de desenvolvimento):

$ pip install -e git+git://github.com/scieloorg/packtools.git#egg=packtools

Source-code:

$ git clone https://github.com/scieloorg/packtools.git
$ cd packtools
$ python setup.py install

Documentation

http://packtools.readthedocs.org/ (we need help!)

Use license

Copyright 2013 SciELO <scielo-dev@googlegroups.com>. Licensed under the terms of the BSD license. Please see LICENSE in the source code for more information.

https://github.com/scieloorg/packtools/blob/master/LICENSE

Changelog

https://github.com/scieloorg/packtools/blob/master/HISTORY.rst

History

2.4 (2019-01-16)

  • Makes possible to have plugable catalogs of validation schemas and xslts.

  • Minor fixes and adjusts to the generated HTML.

2.3.8 (2018-12-03)

2.3.7 (2018-07-17)

2.3.6 (2018-06-20)

  • Fixes a bug on the distribution os xsl data files.

2.3.5 (2018-03-22)

  • Fixes a bug that would cause affs to be mandatory for corrections and retractions.

2.3.4 (2018-03-21)

  • Fixes support for SciELO PS 1.8.

2.3.3 (2018-03-15)

  • Fixes support for SciELO PS 1.8 adding validations to affs and ref-lists.

2.3.2 (2018-03-14)

  • Makes the validation of the response element more flexible.

  • Adds more values to //product/@product-type.

  • Adds more values to //date/@date-type.

  • Adds SciELO BR specific rules.

2.3.1 (2018-03-05)

  • Fixes a bug that would cause error messages on all sps-1.8 documents.

2.3 (2018-03-02)

  • Initial support for SciELO PS 1.8.

2.2 (2018-02-02)

  • Updates the HTMLGenerator to support the build of the most recent version of the articles in HTML.

2.1 (2017-09-28)

  • Initial support for SciELO PS 1.7.

  • Adds support to JATS 1.1.

  • Removes Python 3.3 and adds lxml 3.8 and 4.0 to the test matrix.

2.0.3 (2017-06-02)

  • Fixes a bug that would cause etree.XMLParser to raise TypeError on some old versions of lxml.

2.0.2 (2017-05-16)

  • Reduces the size of the test matrix so tests run on a reasonable amount of time (the full matrix was taking almost 1 hour to run). Now we are testing against minor versions of lxml – 3.4, 3.5 and 3.6 –, except for 3.7.x series where we also test patch versions.

  • Fixes bug that would cause wheel distributions to handle dependencies incorrectly.

2.0.1 (2017-04-26)

  • Fixes bugs and regressions.

2.0 (2017-04-25)

  • [Backwards incompatible] Major changes on packtools.domain.XMLValidator initializer and .parse classmethod. The param extra_schematron is now deprecated. Use sch_schemas and extra_sch_schemas instead, since both params accept an arbitrary number of schematron schemas.

  • Validation logic was abstracted and moved to Validator objects (packtools.domain.PyValidator, packtools.domain.DTDValidator, and packtools.domain.SchematronValidator).

  • The stylechecker utility exits 0 on success, and >0 if an error occurs [https://github.com/scieloorg/packtools/issues/118].

  • The values in attribute @country are checked against ISO3166 alpha-2 list.

  • Fixes a bug that would cause element’s text to be printed out on error messages instead of the element’s name [https://github.com/scieloorg/packtools/issues/123].

  • [Backwards incompatible] Major changes to the data structure returned by packtools.stylechecker.summarize and, as consequence, to the JSON-encoded data structure produced by the stylechecker command-line tool [https://github.com/scieloorg/packtools/issues/75].

  • The parsing of schematron schemas was accelerated by preventing the collection of the IDs in an auxiliary hash table [https://github.com/scieloorg/packtools/issues/109].

1.5 (2017-04-03)

  • Initial support for SciELO PS 1.6.

1.4.2 (2017-03-22)

  • This release is purely bureaucratic, because Pypi does not allow a package to be fixed and resubmitted with the same filename.

1.4.1 (2017-03-22)

  • Fixes syntax error on HISTORY.rst that caused style problems on Pypi.

1.4 (2017-03-22)

1.3.3 (2017-02-16)

  • Fixes a bug that would cause invalid product types to be accepted on article/front/article-meta/product/@product-type.

  • Fixes a bug that would cause invalid invalid values to be accepted on article/front/article-meta/aff/institution/@content-type.

  • Clean up unused attributes from classes from the packtools.style_error module.

  • Log messages are now omitted from the stderr by default.

  • Fixes a bug that would cause tests to fail on Python 3.6 [https://github.com/scieloorg/packtools/issues/107].

1.3.2 (2016-11-22)

1.3.1 (2016-10-03)

1.3 (2016-09-30)

  • Added functions stylechecker.summarize and stylechecker.annotate.

  • Added zip-file validation capabilities.

  • Initial support for SciELO PS 1.5.

1.2 (2016-04-04)

  • Fixes a bug that would cause country elements to be mandatory on sub-articles of type transation.

  • HTMLGenerator().generate() method now handling undefined article/@xml:lang attribute.

1.1 (2016-03-11)

  • Initial support for SciELO PS 1.4.

1.0 (2016-02-23)

  • Better debug information with stylechecker --sysinfo option.

  • Added scripts to handle registration of local xml catalog in the super catalog.

  • New domain specific exceptions.

  • The module packtools.xray was removed.

  • Added support for automatic generation of HTML documents through HTMLGenerator.

  • Backwards incompatible change in XMLValidator init method signature.

0.8.1 (2015-09-03)

  • Fixe some issues that would cause invalid sps-1.3 XMLs to be considered valid.

0.8.0 (2015-08-31)

  • Minor refactoring to make possible for the XMLValidator to handle deprecated versions of SciELO PS.

  • Added basic support to SciELO PS 1.3.

0.7.6 (2015-07-08)

  • Fixed bug that would cause empty mandatory elements to be valid.

0.7.5 (2015-07-03)

  • Added feature to run the validation against an external schematron schema [#55].

  • stylechecker’s --loglevel option accepts upper, lower or mixed case strings.

  • stylechecker utility can read from stdin, so it can be a filter in unix pipelines.

  • Added --raw option to stylechecker.

  • Fixed bug that would raise UnicodeDecodeError in the presence of any non-ascii character in the path to the file (Python 2 on Windows only).

0.7.4 (2015-06-19)

  • Fixed bug that would cause page counts to be reported as error when pagination is identified with elocation-id [#51].

  • Added support for creative commons IGO licenses (sps-1.2 only).

  • Fixed bug that would cause funding-group validation to raise false positives.

0.7.3 (2015-05-18)

0.7.2 (2015-04-30)

  • Fixes a bug in which the occurrence of empty award-id, fn[@fn-type=”financial-disclosure”] or ack could lead stylechecker to crash.

0.7.1 (2015-04-29)

  • Fixes a bug that report page-count as invalid when fpage or lpage values are non-digit.

  • Fixes a bug that mark as invalid XMLs containing use-licenses with https scheme or missing trailing slashes.

  • Changes the funding-group validation algorithm.

  • Checking for funding-statement when fn[fn-type=”financial-disclosure”] is present.

0.7 (2015-03-13)

  • Added SciELO PS 1.2 support.

  • Added the apparent sourceline of the element raising validation errors (stylechecker).

  • Added the option –nocolors to prevent stylechecker output from being colorized by ANSI escape sequences.

  • stylechecker now prints log messages to stdout. The option –loglevel should be used to define the log level. Options are: DEBUG, INFO, WARNING, ERROR or CRITICAL.

  • SciELO PS 1.2 schematron uses EXSLT querybinding.

  • Better error handling while analyzing multiple XML files with stylechecker.

0.6.4 (2015-02-03)

  • Fixes a bug that causes malfunctioning on stylechecker while expanding wildcards on windows.

  • Major semantic changes at –assetsdir options. Now it is always turned ON, and the option is used to set the lookup basedir. By default, the XML basedir is used.

0.6.3 (2015-02-02)

  • stylechecker CLI utility overhaul:
    • The basic output is now presented as JSON structure.

    • The option –assetsdir lookups, in the given dir, for each asset referenced in XML. The –annotated option now writes the output to a file. The utility now takes more than one XML a time.

    • pygments, if installed, will be used to display pretty JSON outputs.

0.6.2 (2015-01-23)

  • Added method XMLValidator.lookup_assets.

  • Added property XMLValidator.assets.

  • Fixed minor issue that would cause //element-citation[@publication-type=”report”] to be reported as invalid.

  • Fixed minor issue that would erroneously identify an element-citation element as not being child of element ref.

0.6.1 (2014-11-28)

  • Minor fix to implement changes from SciELO PS 1.1.1.

0.6 (2014-10-28)

  • Python 3 support.

  • Project-wide code refactoring.

  • packtools.__version__ attribute to get the package version.

  • Distinction between classes of error with the attribute StyleError.level.

0.5 (2014-09-29)

  • Basic implementation of XML style rules according to SciELO PS version 1.1.

  • stylechecker and packbuilder console utilities.

  • Major performance improvements on XMLValidator instantiation, when used with long-running processes (9.5x).

Project details


Release history Release notifications | RSS feed

This version

2.4

Download files

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

Source Distribution

packtools-2.4.tar.gz (676.6 kB view details)

Uploaded Source

Built Distribution

packtools-2.4-py2.py3-none-any.whl (950.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file packtools-2.4.tar.gz.

File metadata

  • Download URL: packtools-2.4.tar.gz
  • Upload date:
  • Size: 676.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for packtools-2.4.tar.gz
Algorithm Hash digest
SHA256 5472eb1ed37ce725fe1d416ea930ef81f1410637e3c92f5e8ec39f52eae2f649
MD5 84b7240ebd7e8643579b28d2619d5306
BLAKE2b-256 31921417f84d08585ee77af433c6935bf7a45a443bfef6758a70a8da35d31931

See more details on using hashes here.

File details

Details for the file packtools-2.4-py2.py3-none-any.whl.

File metadata

  • Download URL: packtools-2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 950.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for packtools-2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2e005edf8c3f992b9bcfff8791e4b9ac471f55d4e75e5e3c0e71e6f17c52f926
MD5 d3a3d3544456226c2ddb35fe38e35506
BLAKE2b-256 85fabdee9871b3f6301c72873ef3a2a9cddef220a15b116b9c5cd6f8e7cdcc83

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