Kuha Common Changelog

0.9.1 (2019-04-03)

0.9.0 (2019-03-14)

0.8.0 (2018-12-18)

  • Refactor kuha_common.server.
    • kuha_common.server.serve() replaces run_server() function. It takes the web-application as a parameter and does not handle application settings. Setting up the application should be handled by the caller who instantiates the application and knows what settings the application needs in order to operate.
  • Add kuha_common.testing.MockCoro to help mocking out coroutine functions.

0.7.1 (2018-11-20)

  • kuha_common.document_store.mappings.xmlbase.XMLParserBase._get_study_number_from_study_unit_element() Change priority of elements when looking up Study.study_number:
    1. a:Archive/a:ArchiveSpecific/a:Collection/a:CallNumber
    2. a:Archive/a:ArchiveSpecific/a:Item/a:CallNumber
    3. s:StudyUnit/r:UserID

0.7.0 (2018-11-19)

0.6.0 (2018-07-18)

  • Add methods to kuha_common.testing.testcases
  • Add support for parsing StudyGroups from DDI 1.2.2. in kuha_common.document_store.mappings.ddi_122_nesstar.DDI122RecordParser.p_study_groups() (Implements #20)
  • Omit logging of request body to request log if the body is larger than kuha_common.server.REQUEST_LOG_BODY_MAXLEN. (Implements #22)
  • Fix possible JSONDecodeError in kuha_common.server.log_request() (Fixes #23)

0.5.1 (2018-07-11)

  • Declare testing.testcases.KuhaUnitTestCase.gen_id() as a classmethod, since it uses class’s method.

0.5.0 (2018-07-10)

0.4.1 (2018-07-04)

  • kuha_common.document_store.mappings.xmlbase.XMLMapper._values_from_parent() resets the state of the attribute mapper if it needs to manipulate the mapper. (Fixes #19)

0.4.0 (2018-07-03)

  • Relax record schema by decreasing the number of mandatory attributes. It should be possible to populate an element with attributes but have no value. (Implements #7)
  • Relax DDI-C mappings: allow record field’s value to be None, if there are attributes for the field. (Implements #8)
  • Add support for DDI from Nesstar Publisher. (Implements #9)
    • New mapping file ddi_122_nesstar.py to kuha_common.document_store.mappings package.
    • Refactor document_store/mappings/ddi_c.py and separate common XML classes & functions to a new module: xmlbase.py.
      • kuha_common.document_store.mappings.xmlbase.Value.from_element() converts empty string values to None.
  • Correctly handle mapping from DDI-C if Codebook instance contains multiple series separated by ID. (Fixes #10)
  • Fix DDI-C mapping for localized codelists for variables. (Fixes #11)
  • DDI-C mapping for Question now removes extra whitepace around research_instruments.
  • Fix fetching multiple parent elements for mapped parameters which have no main element. (Fixes #18)

Known Issues

  • Mapping is unable to handle DDI-XML (DDI 2.5 and DDI 1.2.2 Nesstar) which contains inconsistent use of conceptual elements. See issue #17. For instance the following structure for anlyUnit:

    <anlyUnit>Description for analysis unit.
    <anlyUnit>Description for another analysis unit.</anlyUnit>

    Will be interpreted as:

    [{'analysis_unit': 'concept.of.analysis.unit',
     'description': 'Description for analysis unit.',
     'language': 'en'}]

0.3.1 (2018-04-19)

0.3.0 (2018-03-06)

  • Move ddi_c.py mapping module (DDI-C -> Document Store records) from kuha_document_store to kuha_common.document_store.mappings package.
  • Forward keyword arguments from Settings.load_parser to configargparse.get_arg_parser in cli_setup.py.
  • Make JSONStreamClient._get_request a public method JSONStreamClient.get_request
  • Forward keyword arguments from JSONStreamClient.get_request to DocumentStoreClient.streaming_query_request to support more options specifically more HTTP-methods than POST.
  • Assert _log_request() in server.py will not raise UnicodeDecodeError if request.body is not utf-8 encoded.
  • Add Study.document_uris
  • Add abbreviation-attribute to Study.publishers.
  • Add DDI-C mappings to Study.document_uris and Study.publishers.attr_abbreviation.

0.2.3 (2018-01-26)

  • Implement support for non-localizable containerized elements.
  • Add more fields to Study record.
  • Add more unit & integration tests.

0.2.2 (2017-11-10)

  • Update documentation

0.2.1 (2017-11-09)

  • Fix referring variables to questions. Variable may refer multiple questions.
  • Fix server.py log_request function. Call RequestHandler.CONTENT_TYPE_JSON, rather than handler-object.
  • Partial support for coroutine callbacks in QueryController

0.2.0 (2017-11-01)

  • Support referring variables to questions and vice versa.
  • Add tox.ini to support running tests with tox.

0.1.0 (2017-10-25)

  • Initial release