Giter VIP home page Giter VIP logo

lgr-core's Introduction

LGR Core library

Core library and LGR data structure used to manipulate an LGR.

This version conforms to the specification RFC7940.

Acknowledgment

This toolset was implemented by Viagenie (Audric Schiltknecht, Julien Bernard, David Drouin and Marc Blanchet) and Wil Tan on an ICANN contract.

License

Copyright (c) 2015-2016 Internet Corporation for Assigned Names and Numbers (“ICANN”). All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.

* Neither the name of the ICANN nor the names of its contributors
  may be used to endorse or promote products derived from this
  software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ICANN AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ICANN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Pre-requisites

  • Python 2.7
  • LibXML2 [MIT License] used by the lxml Python bindings
  • LXML for XML parsing/serializing [BSD License]
  • language-tags [MIT License]
  • picu [MIT/X license]
  • munidata for Unicode-related properties access [BSD License]

For testing:

For documentation generation:

Virtual Environment setup

If your distribution does not package the required dependencies, the easiest way to get a working environment in no-time is to use Python's virtual environments.

  • Install virtualenv

  • Create a python virtualenv:

      $ virtualenv venv
    
  • Activate the environment:

      $ source ./venv/bin/activate
    
  • Download dependencies:

      (venv) $ pip install -r requirements.txt
    

Tools

The tools directory contains some tools to exercise the library.

  • xml_dump.py parses an XML LGR file, creates the LGR structure, and convert it back to XML.
  • make_idna_repertoire.py generates the IDNA2008 starting repertoire, by parsing the IDNA2008 table registry available on IANA website, and collecting all PVALID, CONTEXTO and CONTEXTJ characters.
  • lgr_cli.py parsed an XML LGR file, and validate it against configured MSR and Unicode version.
  • rfcXXXX_dump.py parses inputs in RFC XXXX format, and generate an XML LGR.
  • one_per_line_dump.py parses input in the "one per line" format, and generate an XML LGR.

Other tools are available to manipulate LGR files and labels:

  • lgr_annotate.py takes an LGR and a list of labels and output the list of labels with their respective disposition.
  • lgr_collision.py takes an LGR and a list of labels and check for collision(s) between the labels/variants.
  • lgr_compare.py is used to compare 2 LGR (output textual diff, merge, intersection).
  • lgr_diff_collision.py takes 2 LGR and one set of labels, and test for collisions between labels and generated variants from the 2 LGR.
  • lgr_merge_set.py takes some LGRs and create a merged LGR from the provided set.
  • lgr_check_harmonized checks that variants code points from a list of LGRs are symmetric and transitive in each LGR, and lsit missing variants from one LGR to another.

Testing and coverage

Tests and coverage report can be run as follows:

(venv) $ pip install pytest pytest-cov
(venv) $ ./runtests.sh

Open htmlcov/index.html in a web browser for the coverage report.

Documentation

To generate the documentation, go to the doc directory and run the following command:

(venv) $ make html

The generated documentation is available in doc/_build/html/index.html.

lgr-core's People

Contributors

audricschiltknecht avatar j-bernard avatar kjd avatar ptudor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.