Recent Releases of yatiml
yatiml - Release 0.11.1
YAtiML
YAML-based file formats can be very handy, as YAML is easy to write by humans, and parsing support for it is widely available. Just read your YAML file into a document structure (a tree of nested dicts and lists), and manipulate that in your code.
As long as that YAML file contains exactly what you expect, that works fine. But if it contains a mistake, then you're likely to crash the program with a cryptic error message, or worse (especially if the YAML file was loaded from the Internet) it may do something unexpected.
To avoid that, you can validate your YAML using various schema checkers. You write a description of what your YAML file must look like, then feed that to a library which checks the incoming file against the description. That gives you a better error message, but it's a lot of work.
YAtiML takes a different approach. Instead of a schema, you write a Python class. You probably already know how to do that, so no need to learn anything. YAtiML then generates loading and dumping functions for you, which convert between YAML and Python objects. If needed, you can add some extra code to make the YAML look nicer or implement special features.
0.11.1
Fixes
The switch to PyYAML in the previous release also switched us back to YAML
1.1, which has some formatting rules that are arguably just broken. The
first two fixes here add work-arounds that get us partially back up to YAML
1.2 and less surprising syntax rules.
- Switch back to YAML 1.2 floats
- Switch back to YAML 1.2 booleans
- Make enum values matching boolean constants work correctly
- Python
Published by LourensVeen about 2 years ago
yatiml - Release 0.11.0
YAtiML
YAML-based file formats can be very handy, as YAML is easy to write by humans, and parsing support for it is widely available. Just read your YAML file into a document structure (a tree of nested dicts and lists), and manipulate that in your code.
As long as that YAML file contains exactly what you expect, that works fine. But if it contains a mistake, then you're likely to crash the program with a cryptic error message, or worse (especially if the YAML file was loaded from the Internet) it may do something unexpected.
To avoid that, you can validate your YAML using various schema checkers. You write a description of what your YAML file must look like, then feed that to a library which checks the incoming file against the description. That gives you a better error message, but it's a lot of work.
YAtiML takes a different approach. Instead of a schema, you write a Python class. You probably already know how to do that, so no need to learn anything. YAtiML then generates loading and dumping functions for you, which convert between YAML and Python objects. If needed, you can add some extra code to make the YAML look nicer or implement special features.
0.11.0
New functionality
- Support for Python 3.12
- Improved error messages
Fixes
- Now uses PyYAML rather than ruamel.yaml (fixes deprecation warnings)
- Python
Published by LourensVeen about 2 years ago
yatiml - Release 0.10.0
YAtiML
YAML-based file formats can be very handy, as YAML is easy to write by humans, and parsing support for it is widely available. Just read your YAML file into a document structure (a tree of nested dicts and lists), and manipulate that in your code.
As long as that YAML file contains exactly what you expect, that works fine. But if it contains a mistake, then you're likely to crash the program with a cryptic error message, or worse (especially if the YAML file was loaded from the Internet) it may do something unexpected.
To avoid that, you can validate your YAML using various schema checkers. You write a description of what your YAML file must look like, then feed that to a library which checks the incoming file against the description. That gives you a better error message, but it's a lot of work.
YAtiML takes a different approach. Instead of a schema, you write a Python class. You probably already know how to do that, so no need to learn anything. YAtiML then generates loading and dumping functions for you, which convert between YAML and Python objects. If needed, you can add some extra code to make the YAML look nicer or implement special features.
0.10.0
Incompatible changes
- Ignore abstract base classes (abc.ABC and/or abstractmethod)
New functionality
- Easier-to-understand error messages
- Installation via Conda (already worked, now documented)
- Small documentation improvements
- Python 3.11 support
- Compatibility with ruamel.yaml 0.17
Fixes
- Bug in mapattributeto_index
Removed
- Support for Python 3.6
- Python
Published by LourensVeen over 3 years ago
yatiml - Release 0.9.0
YAtiML
YAML-based file formats can be very handy, as YAML is easy to write by humans, and parsing support for it is widely available. Just read your YAML file into a document structure (a tree of nested dicts and lists), and manipulate that in your code.
As long as that YAML file contains exactly what you expect, that works fine. But if it contains a mistake, then you're likely to crash the program with a cryptic error message, or worse (especially if the YAML file was loaded from the Internet) it may do something unexpected.
To avoid that, you can validate your YAML using various schema checkers. You write a description of what your YAML file must look like, then feed that to a library which checks the incoming file against the description. That gives you a better error message, but it's a lot of work.
YAtiML takes a different approach. Instead of a schema, you write a Python class. You probably already know how to do that, so no need to learn anything. YAtiML then generates loading and dumping functions for you, which convert between YAML and Python objects. If needed, you can add some extra code to make the YAML look nicer or implement special features.
0.9.0
New functionality
- Support for Python 3.10 (worked fine already, now official)
- Error messages now quote attribute names, making them easier to read.
Fixes
map_attribute_to_index()caused load failure for dictionaries indexed by a user-defined string class.- All examples in the documentation now use the new
_yatiml_*function names, instead of the old ones without the leading underscore.
Removed
- Loader and Dumper classes, which were deprecated and broken in 0.8.0. Please
use the new
load_function,dump_functionanddumps_functionfunctions instead.
- Python
Published by LourensVeen about 4 years ago
yatiml - Release 0.8.0
YAtiML
YAML-based file formats can be very handy, as YAML is easy to write by humans, and parsing support for it is widely available. Just read your YAML file into a document structure (a tree of nested dicts and lists), and manipulate that in your code.
As long as that YAML file contains exactly what you expect, that works fine. But if it contains a mistake, then you're likely to crash the program with a cryptic error message, or worse (especially if the YAML file was loaded from the Internet) it may do something unexpected.
To avoid that, you can validate your YAML using various schema checkers. You write a description of what your YAML file must look like, then feed that to a library which checks the incoming file against the description. That gives you a better error message, but it's a lot of work.
YAtiML takes a different approach. Instead of a schema, you write a Python class. You probably already know how to do that, so no need to learn anything. YAtiML then generates loading and dumping functions for you, which convert between YAML and Python objects. If needed, you can add some extra code to make the YAML look nicer or implement special features.
0.8.0
Incompatible changes
- Accept explicit tags only if compatible with the recognised type(s)
New functionality
- Support for untyped documents and attributes
- Support for Any-typed documents and attributes
- Support for Python dataclasses
Fixes
- Dumping of OrderedDict to a file (but not to a string) produced a stray !!omap.
- Various fixes and improvements to development infrastructure
Removed
- Official support for Python 3.5, which is no longer supported upstream. It will probably still work, but getting anything to install on 3.5 is getting to be pretty difficult so it's probably time to upgrade.
- Python
Published by LourensVeen over 4 years ago
yatiml - Release 0.7.0
YAtiML
YAtiML is a small Python library that works with ruamel.yaml, adding functions for automatic type recognition to it. YAtiML is not a schema language like XSD and Relax-NG are for XML, or JSON Schema is for JSON. YAtiML is also not an Object/YAML mapper (YAML is already an object serialisation system, so you don't need an extra library for that). However, YAtiML does solve the same kind of problems, and more, so if you are looking for a schema language for YAML, YAtiML may actually be what you need.
Instructions on how to install and use YAtiML can be found in the YAtiML documentation.
Release 0.7.0
Incompatible changes
- Use seasoning functions only on the class they're defined on
New functionality
- New yatiml.String to mark string-like classes
- User-defined strings may now be used as dictionary keys
- Support for index mappings
- Support for latest ruamel.yaml
- Documentation improvements
- Python
Published by LourensVeen about 5 years ago
yatiml - Release 0.6.1
Incompatible changes
- Use datetime.date instead of datetime.datetime
New functionality
- Support for loading and dumping pathlib.Path objects
- Support for Python 3.9
- Python
Published by LourensVeen over 5 years ago
yatiml - Release 0.6.0
New functionality
- New makeloader and makedumper functions improve ease-of-use
- JSON support
- Support for Mapping and Sequence types
- UnknownNode.requireattributevalue_not() function
- Node.removeattributeswithdefaultvalues() function
- Recipe for seasoning Enums
Fixes
- Various documentation improvements
- Better error message if constructor raises
- Python
Published by LourensVeen over 5 years ago
yatiml - Release 0.5.1
Fixes
- Fixed support for Python 3.5.1 (again, sorry)
- Python
Published by LourensVeen almost 6 years ago
yatiml - Release 0.5.0
Incompatible changes
- yatiml* methods should now be called _yatiml*
- Dropped support for Python 3.4, which is end-of-life
Fixes
- Savourised classes in lists and dicts now load correctly
- Fixed compatibility with the latest versions of ruamel.yaml
- Fixed support for Python 3.5.1
- Python
Published by LourensVeen about 6 years ago
yatiml - Release 0.1.0
- Initial release with basic functionality
- Python
Published by LourensVeen over 7 years ago
yatiml - Release 0.2.0
New functionality
- Support for enumerations
- Support for user-defined string types
Fixes
- Various small tooling fixes
- Some refactoring
- Python
Published by LourensVeen over 7 years ago
yatiml - Release 0.3.0
New functionality
- Support for classes that are represented by a string in the YAML file
- New unified yatiml.Node interface (API change)
Fixes
- Small improvements to documentation
- Miscellaneous small fixes
- Python
Published by LourensVeen over 7 years ago
yatiml - Release 0.4.0
New functionality
- Extended maptoseq seasoning
- Support for YAML timestamp / Python datetime
- Support for YAML keys with dashes
Fixes
- Much improved error messages
- Python
Published by LourensVeen over 7 years ago