drepr.models.parsers.v1.resource_parser#

Classes

ResourceParser()

resources has two possible schemas

class ResourceParser[source]#

Bases: object

resources has two possible schemas

  1. Shorthand when you have only one resource (resource_id is default): resources: <resource_type>

  2. When you have multiple resources:

    ``` resources:

    <resource_id>: <resource_conf> # .. other resources ..

    ```

    The <resource_conf> can either be: a. <resource_type>, when other resource properties are all options b. a dictionary as follows, when some properties require to define explicitly

    ```

    <type>: <resource_type> # .. other attributes ..

    ```

DEFAULT_RESOURCE_ID = 'default'#
RESOURCE_TYPES = {'container', 'csv', 'geotiff', 'json', 'netcdf3', 'netcdf4', 'np-dict', 'shapefile', 'spreadsheet', 'xml'}#
classmethod parse(resources: Union[str, dict]) List[Resource][source]#
Parameters:

resources (Union[str, dict]) –

Return type:

List[Resource]