From 42518b638605c5a1f35e11dffe04978669d51fef Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Thu, 15 Oct 2020 14:19:12 +0200 Subject: [PATCH] Updated README, CHANGELOG and version. --- CHANGELOG.md | 3 +++ README.md | 18 ++++++++++++++++++ benedict/metadata.py | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 700e1df..bbd7a70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.22.0](https://github.com/fabiocaccamo/python-benedict/releases/tag/0.22.0) - 2020-10-15 +- Added `get_uuid` and `get_uuid_list` methods. + ## [0.21.1](https://github.com/fabiocaccamo/python-benedict/releases/tag/0.21.1) - 2020-09-30 - Fixed performance issue. #39 - Fixed `to_json` returns empty dict from generator. #38 diff --git a/README.md b/README.md index 5b164f0..a373bd8 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,8 @@ lng = loc.get_decimal('longitude') - [`get_slug_list`](#get_slug_list) - [`get_str`](#get_str) - [`get_str_list`](#get_str_list) + - [`get_uuid`](#get_uuid) + - [`get_uuid_list`](#get_uuid_list) ### Utility methods @@ -799,6 +801,22 @@ d.get_str(key, default='', choices=[]) d.get_str_list(key, default=[], separator=',') ``` +- #### get_uuid + +```python +# Get value by key or keypath trying to return it as valid uuid. +# If choices and value is in choices return value otherwise default. +d.get_uuid(key, default='', choices=[]) +``` + +- #### get_uuid_list + +```python +# Get value by key or keypath trying to return it as list of valid uuid values. +# If separator is specified and value is a string it will be splitted. +d.get_uuid_list(key, default=[], separator=',') +``` + ## Testing ```bash # create python virtual environment diff --git a/benedict/metadata.py b/benedict/metadata.py index 570a60f..3ad3922 100644 --- a/benedict/metadata.py +++ b/benedict/metadata.py @@ -6,4 +6,4 @@ __description__ = 'python-benedict is a dict subclass with keylist/keypath suppo __email__ = 'fabio.caccamo@gmail.com' __license__ = 'MIT' __title__ = 'benedict' -__version__ = '0.21.1' +__version__ = '0.22.0'