From c19c3ae3c482c112fcf962c5ebbea0e9b1185bd7 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Thu, 24 Oct 2019 16:21:47 +0200 Subject: [PATCH 1/8] [CI] Add python 3.7 and 3.8 builds --- .travis.yml | 10 ++++++++++ appveyor.yml | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/.travis.yml b/.travis.yml index fd0fa330..f9311169 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,21 @@ matrix: python: "3.5" - os: linux python: "3.6" + - os: linux + python: "3.7" + dist: xenial + - os: linux + python: "3.8" + dist: xenial - os: osx language: generic env: - OSXENV=3.6.0 + - os: osx + language: generic + env: + - OSXENV=3.7.0 - os: osx language: generic env: diff --git a/appveyor.yml b/appveyor.yml index 124dd818..d76ebe2e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,12 +6,16 @@ environment: PYVER: "3.5" - PYTHON: "C:\\Python36" PYVER: "3.6" + - PYTHON: "C:\\Python37" + PYVER: "3.7" - PYTHON: "C:\\Python27-x64" PYVER: "2.7" - PYTHON: "C:\\Python35-x64" PYVER: "3.5" - PYTHON: "C:\\Python36-x64" PYVER: "3.6" + - PYTHON: "C:\\Python37-x64" + PYVER: "3.7" build: false From dfd9e6e068f6ae3e13bb980bc06414de87d9aca4 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Thu, 24 Oct 2019 16:22:23 +0200 Subject: [PATCH 2/8] [.travis] Move coveralls to python 3.6 build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f9311169..5a669c6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,11 @@ matrix: include: - os: linux python: "2.7" - env: COVERALLS=1 - os: linux python: "3.5" - os: linux python: "3.6" + env: COVERALLS=1 - os: linux python: "3.7" dist: xenial From 2143c8b828c1aa9a4fa731a951879b7deda357ef Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Thu, 24 Oct 2019 16:24:09 +0200 Subject: [PATCH 3/8] [info] Update release number --- odml/info.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/odml/info.json b/odml/info.json index 84d70ddc..23991854 100644 --- a/odml/info.json +++ b/odml/info.json @@ -1,8 +1,8 @@ { - "VERSION": "1.4.2", + "VERSION": "1.4.3", "FORMAT_VERSION": "1.1", "AUTHOR": "Hagen Fritsch, Jan Grewe, Christian Kellner, Achilleas Koutsou, Michael Sonntag, Lyuba Zehl", - "COPYRIGHT": "(c) 2011-2018, German Neuroinformatics Node", + "COPYRIGHT": "(c) 2011-2019, German Neuroinformatics Node", "CONTACT": "dev@g-node.org", "HOMEPAGE": "https://github.com/G-Node/python-odml", "CLASSIFIERS": [ @@ -11,6 +11,8 @@ "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Topic :: Scientific/Engineering", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License" From 3d31d4f73e5673893865652f16d0d93d7df43814 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Thu, 24 Oct 2019 16:44:31 +0200 Subject: [PATCH 4/8] [CHANGELOG] Add version 1.4.3 release notes --- CHANGELOG.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e34a19fe..3f69e24d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,49 @@ until the next release. # Latest changes in master -... +# Version 1.4.3 + +## Introduction of odML templates support and update in odML terminology handling + +Support for importing and working with odML templates is added: +- the core library now features the `TemplateHandler` class to handle import and usage of odML templates. +- the default URL to fetch templates from has been set to `https://templates.g-node.org`. +- all terminology URLs are updated to the new terminology deployment at `https://terminology.g-node.org`. + +## Additional console script: 'odmlview' + +Currently most web browsers no longer support viewing local files that include further local files like stylesheets; check [here](https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs) for additional details. The console script `odmlview` provides a local webserver that is able to properly serve odML XML files from a local directory and render them correctly, if the appropriate stylesheets are present in the same directory. + +``` +'odmlview' sets up a minimal webserver to view odml files saved in the +XML format via the webbrowser. After it is started, the webserver will +open a new tab in the default webbrowser and display the content of +the directory the server was started from. odML files can then be +viewed from there. +To properly render XML, an odML file may contain the element +'' where the +'odmlDocument.xsl' stylesheet should reside in the same directory as the +odML file to be rendered. By using the '--fetch' flag the latest version +of this stylesheet will be downloaded from `templates.g-node.org` to +the current directory when starting up the service. +``` + +## 'pyyaml' dependency update +The `pyyaml` dependency has been changed to the non-breaking beta version 4.2b4. See issue #291 for details. + +## Minor changes, updates and fixes +- odML entity IDs are automatically added when converting from odML version 1 to odMl version 1.1 for `Document`, `Section` and `Property` elements. If an ID already exists, it stays the same, if it is compatible with the Python UUID types. Otherwise (also if empty) a new ID is created for the odML entity. +- `Property` can now be set as `int` with value `0`. See issue #314 for details. +- appending and extending of `Property` values of dtypes `person`, `url` and `text` is now possible. See issue #318 for details. +- the default `RDFWriter` format is set to `turtle`. See issue #214 for details. +- the `RDFWriter` now checks for a given file extension within the RDF document name if accidentally given there. See issue #213 for details. +- the `RDFWriter` now throws a `ValueError` if an unsupported RDF format is given. See issue #215 for details. +- the `XMLReader` now properly handles entity creation failures when started with option `ignore_errors=True`. See issue #276 for details. +- the `pprint` method has been added to `Document` to print while document section. See issue #319 for details. +- the README file has been changed from `rst` to the `md` format. +- the current tutorial has been updated to include latest changes. +- the automated builds have been updated to include Python versions 3.7 and 3.8; version 3.4 has been removed since it is no longer supported on travis. + # Version 1.4.2 From 8a3666c2cc527ece1dca8062fd9dcb4853351d6e Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Thu, 24 Oct 2019 16:57:45 +0200 Subject: [PATCH 5/8] [README] Update content - adds tutorial and cli script sections - restructures the content to point users first how to get started with odml and only later on to details like dependencies. - adds readthedocs badge --- README.md | 59 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index f6a816fb..05915f35 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build status](https://ci.appveyor.com/api/projects/status/br7pe6atlwdg5618/branch/master?svg=true)](https://ci.appveyor.com/project/G-Node/python-odml/branch/master) ![Test coverage](https://coveralls.io/repos/github/G-Node/python-odml/badge.svg?branch=master) [![PyPI version](https://img.shields.io/pypi/v/odml.svg)](https://pypi.org/project/odML/) +[![Read the Docs](https://img.shields.io/readthedocs/python-odml)](https://python-odml.readthedocs.io/en/latest/) + # odML (Open metaData Markup Language) core library @@ -15,8 +17,43 @@ with the version control system **git**, but still want to use it, have a look a documentation available on the [git-scm website](https://git-scm.com/). -# Breaking changes +# odML Project page + +More information about the project including related projects as well as tutorials and +examples can be found at our odML [project page](https://g-node.github.io/python-odml). + + +# Getting started + +## Installation + +*python-odml* is most conveniently installed via pip. + +``` +pip install odml +``` + +## Tutorial and examples + +- We have assembled a set of + [tutorials](http://github.com/G-Node/python-odml/blob/master/doc/tutorial.rst "Python Tutorial"). + +## Python convenience scripts + +The Python installation features multiple convenience commandline scripts. + +- `odmlconversion`: Converts odML files of previous file versions into the current one. +- `odmltordf`: Converts odML files to the supported RDF version of odML. +- `odmlview`: Render and browse local XML odML files in the webbrowser. +All scripts provide detailed usage descriptions by adding the `help` flag to the command. + + odmlconversion -h + odmltordf -h + odmlview -h + + +# Breaking changes odML Version 1.4 introduced breaking format and API changes compared to the previous versions of odML. Files saved in the previous format versions can be converted to a 1.4 @@ -57,21 +94,6 @@ release notes](https://github.com/G-Node/python-odml/releases). * lib32z1-dev -# Installation - -The simplest way to install Python-odML is from PyPI using the pip tool: - - -``` - $ pip install odml -``` - -On Ubuntu, the pip package manager is available in the repositories as ```python-pip```. - -If this method is used, the appropriate Python dependencies are downloaded and installed -automatically. - - # Building from source To download the Python-odML library please either use git and clone @@ -95,15 +117,12 @@ To install the Python-odML library, enter the corresponding directory and run: **Note** The master branch is our current development branch, not all features might be working as expected. Use the release tags instead. -# odML Project page - -More information about the project including related projects as well as tutorials and -examples can be found at our odML [project page](https://g-node.github.io/python-odml). # Contributing and Governance See the [CONTRIBUTING](CONTIBUTING.md) document for more information on this. + # Bugs & Questions Should you find a behaviour that is likely a bug, please file a bug report at From ad4d411fb904f6c2c426f8cecdc4dfc07b6db55d Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Fri, 25 Oct 2019 15:51:45 +0200 Subject: [PATCH 6/8] [scripts/convert] Rename odmlconversion The odmlconversion cli script is renamed to odmlconvert. A deprecation notice is displayed if the previous script name 'odmlconversion' is called from the command line. --- .../{odml_conversion.py => odml_convert.py} | 18 +++++++++++++++--- setup.py | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) rename odml/scripts/{odml_conversion.py => odml_convert.py} (90%) diff --git a/odml/scripts/odml_conversion.py b/odml/scripts/odml_convert.py similarity index 90% rename from odml/scripts/odml_conversion.py rename to odml/scripts/odml_convert.py index 1222091c..d52f5a59 100644 --- a/odml/scripts/odml_conversion.py +++ b/odml/scripts/odml_convert.py @@ -1,12 +1,12 @@ -"""odmlConversion +"""odmlConvert -odmlConversion searches for odML files within a provided SEARCHDIR +odmlConvert searches for odML files within a provided SEARCHDIR and converts them to the newest odML format version. Original files will never be overwritten. New files will be written either to a new directory at the current or a specified location. -Usage: odmlconversion [-r] [-o OUT] SEARCHDIR +Usage: odmlconvert [-r] [-o OUT] SEARCHDIR Arguments: SEARCHDIR Directory to search for odML files. @@ -123,5 +123,17 @@ def main(args=None): report.close() +def dep_note(args=None): + """ + Print deprecation warning and call main function. + + :param args: Command line arguments + """ + + print("\n[DEPRECATION WARNING] 'odmlconversion' will be removed with \n" + "the next version release. Please use 'odmlconvert' instead.\n") + main(args) + + if __name__ == "__main__": main(sys.argv[1:]) diff --git a/setup.py b/setup.py index 060eba1f..5918378f 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ classifiers=CLASSIFIERS, license="BSD", entry_points={'console_scripts': ['odmltordf=odml.scripts.odml_to_rdf:main', - 'odmlconversion=odml.scripts.odml_conversion:main', + 'odmlconversion=odml.scripts.odml_convert:dep_note', + 'odmlconvert=odml.scripts.odml_convert:main', 'odmlview=odml.scripts.odml_view:main']} ) From 92b4876c110a029f4a562ba2202662ee1d99dcc3 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Fri, 25 Oct 2019 15:57:03 +0200 Subject: [PATCH 7/8] [doc] Update: rename odmlconversion The documentation in docs, README and CHANGELOG has been updated with the rename of the CLI script 'odmlconversion' to 'odmlconvert'. --- CHANGELOG.md | 3 +++ README.md | 4 ++-- docs/index.md | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f69e24d..d924697a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,9 @@ of this stylesheet will be downloaded from `templates.g-node.org` to the current directory when starting up the service. ``` +## Console script 'odmlconversion' is renamed +The console script `odmlconversion` is renamed to `odmlconvert`. For backwards compatibility the script will be available as `odmlconversion` with a deprecation notice. + ## 'pyyaml' dependency update The `pyyaml` dependency has been changed to the non-breaking beta version 4.2b4. See issue #291 for details. diff --git a/README.md b/README.md index 05915f35..106f897a 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,13 @@ pip install odml The Python installation features multiple convenience commandline scripts. -- `odmlconversion`: Converts odML files of previous file versions into the current one. +- `odmlconvert`: Converts odML files of previous file versions into the current one. - `odmltordf`: Converts odML files to the supported RDF version of odML. - `odmlview`: Render and browse local XML odML files in the webbrowser. All scripts provide detailed usage descriptions by adding the `help` flag to the command. - odmlconversion -h + odmlconvert -h odmltordf -h odmlview -h diff --git a/docs/index.md b/docs/index.md index b5e5b622..5e384b57 100644 --- a/docs/index.md +++ b/docs/index.md @@ -77,13 +77,13 @@ pip install odml The Python installation features multiple convenience commandline scripts. -- `odmlconversion`: Converts odML files of previous file versions into the current one. +- `odmlconvert`: Converts odML files of previous file versions into the current one. - `odmltordf`: Converts odML files to the supported RDF version of odML. - `odmlview`: Render and browse local XML odML files in the webbrowser. All scripts provide detailed usage descriptions by adding the `help` flag to the command. - odmlconversion -h + odmlconvert -h odmltordf -h odmlview -h From 3171ed98f03ad70b717e406efc529bc9865c5c20 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Fri, 25 Oct 2019 16:10:28 +0200 Subject: [PATCH 8/8] [doc] Add cli scripts to class ref --- doc/tools.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/tools.rst b/doc/tools.rst index 13224876..754b0afb 100644 --- a/doc/tools.rst +++ b/doc/tools.rst @@ -55,3 +55,30 @@ RDFConverter :members: :inherited-members: :undoc-members: + +.. _cli_scripts: + +Command line scripts +==================== +Several cli convenience scripts are automatically installed and are available from the command line. + +odML conversion script +---------------------- +.. automodule:: odml.scripts.odml_convert + :members: + :inherited-members: + :undoc-members: + +odML to RDF script +------------------ +.. automodule:: odml.scripts.odml_to_rdf + :members: + :inherited-members: + :undoc-members: + +odML view (browse odml files locally) +------------------------------------- +.. automodule:: odml.scripts.odml_view + :members: + :inherited-members: + :undoc-members: