aspen.request_processor.typecasting

This module handles the parsing of path variables.

aspen.request_processor.typecasting.defaults = {'float': <function <lambda>>, 'int': <function <lambda>>}

Aspen’s default typecasters.

aspen.request_processor.typecasting.apply_typecasters(typecasters, path_vars, context)

Perform typecasting (in-place!).

Parameters:
  • typecasters – a dict of type names to typecast functions
  • path_vars – a Mapping of path variables
  • context – a dict passed to typecast functions as second argument
Raises:

TypecastError – if a typecast function raises an exception