++++++++++++++++
In celebration of becoming an official `OSGeo Community Project <https://www.osgeo.org/projects/mappyfile/>`_,
a version ``1.0.0`` release is now out!
+ **Support for Python 2.7 has now been dropped.**
See `166 <https://github.com/geographika/mappyfile/issues/166>`_ - Drop Python 2.7 support. The codebase has had all Python2 specific
code removed - see `188 <https://github.com/geographika/mappyfile/issues/188>`_.
+ **Breaking Change** - in the ``MapfileToDict`` class the parameter ``transformerClass`` has been renamed ``transformer_class``.
An example of how to fix this is shown below:
.. code-block:: python
from mappyfile.transformer import MapfileToDict
from mappyfile_colors import ColorsTransformer
m = MapfileToDict(
include_position=True,
include_comments=True,
replace the following parameter
transformerClass=ColorsTransformer,
transformer_class=ColorsTransformer,
conversion_type=None,
include_color_names=True,
)
+ **Breaking Change** - ``LAYER`` ``DATA`` has been changed in the schema from a list to a simple string.
.. code-block:: python
layer = {
'__type__': 'layer',
// pre v1 the data clause had to be in a list
// 'data': ['/path/to/data']
// in v1 this should now be a string
'data': '/path/to/data'
}
mappyfile.dumps(layer)
+ Support added for `lark_cython <https://github.com/lark-parser/lark_cython>`_ - see `#178 <https://github.com/geographika/mappyfile/issues/178>`_ - thanks erezsh.
To use ``lark_cython`` is as simple as installing the option with ``pip``:
.. code-block:: bash
pip install mappyfile[lark_cython]
+ All mappyfile dicts now have human readable output when displayed as a string:
.. code-block:: python
mf = mappyfile.open("./docs/examples/before.map")
print(mf)
previous output
DefaultOrderedDict(<class 'mappyfile.ordereddict.CaseInsensitiveOrderedDict'>, CaseInsensitiveOrderedDict([('__type__', 'map'),..
new output
{
"__type__": "map",
"layers": [
{
"__type__": "layer",
"name": "Layer1",
"type": "POLYGON"
},
+ Approach to resolving JSON references updated due to the deprecated ``jsonschema.RefResolver`` - see
`this link <https://python-jsonschema.readthedocs.io/en/v4.18.4/referencing/#resolving-references-from-the-file-system>`_,
the associated JSONSchema `pull request <https://github.com/python-jsonschema/jsonschema/pull/1049>`_
and the `migration approach <https://python-jsonschema.readthedocs.io/en/stable/referencing/#migrating-from-refresolver>`_.
Other improvements and fixes in the v1.0.0 release:
+ `196 <https://github.com/geographika/mappyfile/pull/196>`_ - Code base fixes for ``Prospector`` warnings
+ `195 <https://github.com/geographika/mappyfile/pull/195>`_ - Update test suite from latest msautotests
+ `194 <https://github.com/geographika/mappyfile/pull/194>`_ - Docs overhaul in preparation for v1 release
+ `193 <https://github.com/geographika/mappyfile/pull/193>`_ - Update to ``jsonschema`` v4 and replace deprecated ``RefResolver``
+ `191 <https://github.com/geographika/mappyfile/pull/191>`_ - Simplify processing of comments
+ `189 <https://github.com/geographika/mappyfile/pull/189>`_ - Add type hints to the code base
+ `153 <https://github.com/geographika/mappyfile/pull/153>`_ - Support querying items without the given key in
``utils.findunique()``- thanks DonQueso89 for fix
+ Schema fixes for ``grid``, ``label``, ``style``, ``leader``, add ``flatgeobuf``
+ Code reformatted using `black <https://pypi.org/project/black/>`_
Resolution of long-standing parsing issues, and all msautotest examples now pass successfully:
+ `48 <https://github.com/geographika/mappyfile/issues/48>`_ - SYMBOL ambiguity
+ `98 <https://github.com/geographika/mappyfile/issues/98>`_ - Unquoted attribute names fail to parse