Skip to content
Snippets Groups Projects
Commit e472c865 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

DOC: enhanced documentation

parent d9164599
No related branches found
No related tags found
2 merge requests!71REL: RElease v0.2.0,!64ENH: Using float converters on integer values
Pipeline #30541 passed
...@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### ### Changed ###
- Converters often used in dicts (DictFloatElementConverter,
DictIntegerElementConverter, ...) do now accept other StructureElements by
default. For example a DictIntegerElement is accepted by default instead of a
DictFloatElement. This behavior can be changed (see converter documentation).
**Note** This might lead to additional matches compared to previous versions.
- `_AbstractDictElementConverter` uses `re.DOTALL` for `match_value` - `_AbstractDictElementConverter` uses `re.DOTALL` for `match_value`
- The "fallback" parent, the name of the element in the cfood, is only used - The "fallback" parent, the name of the element in the cfood, is only used
when the object is created and only if there are no parents given. when the object is created and only if there are no parents given.
......
...@@ -77,13 +77,6 @@ Dict Converter ...@@ -77,13 +77,6 @@ Dict Converter
Typical Subtree converters Typical Subtree converters
-------------------------- --------------------------
- DictBooleanElementConverter
- DictFloatElementConverter
- DictTextElementConverter
- DictIntegerElementConverter
- DictListElementConverter
- DictDictElementConverter
These converters expect `match_name` and `match_value` in their definition These converters expect `match_name` and `match_value` in their definition
which allow to match the key and the value, respectively. which allow to match the key and the value, respectively.
...@@ -92,6 +85,16 @@ DictFloatElementConverter also accepts DictIntegerElements. The default ...@@ -92,6 +85,16 @@ DictFloatElementConverter also accepts DictIntegerElements. The default
behavior can be adjusted with the fields `accept_text`, `accept_int`, behavior can be adjusted with the fields `accept_text`, `accept_int`,
`accept_float`, and `accept_bool`. `accept_float`, and `accept_bool`.
The following denotes what kind of StructureElements are accepted by default
(they are defined in `src/caoscrawler/converters.py`):
- DictBooleanElementConverter: bool, int
- DictFloatElementConverter: int, float
- DictTextElementConverter: text, bool, int, float
- DictIntegerElementConverter: int
- DictListElementConverter: list
- DictDictElementConverter: dict
YAMLFileConverter YAMLFileConverter
================= =================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment