Experimental loaders for the enopy library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
enopy_exploaders
tests
.gitignore
CHANGELOG.md
LICENSE
MANIFEST.in
Makefile
README.md
requirements-dev.txt
setup.cfg
setup.py

README.md

enopy-exploaders

Experimental loaders for the enopy library

Installation

pip install enopy-exploaders

Currently available loaders

These loaders are currently available in the experimental track:

  • enum (generate with enum_factory(choices), accepts any of choices, returns the value unaltered or raises an error)

Example

You can use the loaders with enopy as demonstrated in this example.

>>> from enopy import parse
>>> from enopy_exploaders import enum_factory

>>> beach_item = enum_factory(['beach ball', 'sunscreen', 'shovel'])

>>> input = """
...   good-choice: sunscreen
...   bad-choice: motor oil
... """

>>> document = parse(input)

>>> document.field('good-choice', beach_item)
'sunscreen'
>>> document.field('bad-choice', beach_item)
ValidationError: 'bad-choice' must be one of 'beach ball', 'sunscreen', 'shovel'.

Purpose

Trying out new, innovative, cool and stupid loader ideas and seeing how they fit into real life usecases. Based on the findings they might be repackaged, integrated into the enopy core, or something else entirely.

Questions to explored

Translations

There could be a considerable amount of useful loaders, which all will require one or multiple error messages each - how can the translations for this be managed, versioned, updated, etc.?

From the insights gained with the core eno libraries it is safe to say that if there is to be some form of a shared translation repository, it should probably be shared by all (exp)loaders packages across different programming languages.

Categorization

How should the loaders be categorized? Types (numbers, strings, ...)? Fields (IT, Communication, Geography)? Countries (International, country specific)?

API

How are the loaders imported, accessed and used in applications?

Scope

What kinds of loaders are actually sensible and useful to bundle for everyone, and where do we reach the limit of including too much bloat?