Metadata-Version: 2.4
Name: bagof-converters
Version: 0.1
Summary: Hint-based runtime converters.
Author-email: Yael Balbastre <yael.balbastre@gmail.com>
Maintainer-email: Yael Balbastre <yael.balbastre@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/bagofseeds/bagof-converters
Project-URL: Documentation, https://github.com/bagofseeds/bagof-converters#readme
Project-URL: Issues, https://github.com/bagofseeds/bagof-converters/issues
Project-URL: Repository, https://github.com/bagofseeds/bagof-converters
Keywords: bagof,converters,python
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typing_extensions>=4.13
Requires-Dist: bagof-hints~=0.1
Requires-Dist: bagof-core-magic~=0.1
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# bagof-converters

Hint-based converters that operate at runtime.

## Example

```pycon
>>> from bagof.converters import get_converter
>>> convert = get_converter(list[int])
>>> convert(range(3))
[0, 1, 2]
>>> convert(1)
ValueConversionError: ToSequence(list[int]): Invalid value.
|> value = 1
>>> convert(["a", "b", "c"])
ValueConversionError: ToNumber(<class 'int'>): Invalid value.
|> value = 'a'
The above exception was the direct cause of the following exception:
ValueConversionError: ToSequence(list[int]): Invalid value.
|> value = 'a'
The above exception was the direct cause of the following exception:
ValueConversionError: ToSequence(list[int]): Invalid value.
|> value = <map object at 0x72fb38570cd0>
```
