pynwb package

Module contents

This ackage will contain functions, classes, and objects for reading and writing data in NWB format

pynwb.available_namespaces()
Returns:a tuple of the available namespaces
Return type:tuple
pynwb.get_build_manager(type_map=None)
Parameters:type_map (TypeMap) – the path to the YAML with the namespace definition
pynwb.get_class(neurodata_type, namespace)

Get the class object of the NWBContainer subclass corresponding to a given neurdata_type.

Parameters:
  • neurodata_type (str) – the neurodata_type to get the NWBConatiner class for
  • namespace (str) – the namespace the neurodata_type is defined in
pynwb.get_global_type_map()
pynwb.get_type_map()
pynwb.load_namespaces(namespace_path)

Load namespaces from file

Parameters:namespace_path (str) – the path to the YAML with the namespace definition
Returns:the namespaces loaded from the given file
Return type:tuple
pynwb.register_class(neurodata_type, namespace, container_cls=None)
Register an NWBContainer class to use for reading and writing a neurodata_type from a specification
If container_cls is not specified, returns a decorator for registering an NWBContainer subclass as the class for neurodata_type in namespace.
Parameters:
  • neurodata_type (str) – the neurodata_type to get the spec for
  • namespace (str) – the name of the namespace
  • container_cls (type) – the class to map to the specified neurodata_type
pynwb.register_map(container_cls, mapper_cls=None)
Register an ObjectMapper to use for a Container class type
If mapper_cls is not specified, returns a decorator for registering an ObjectMapper class as the mapper for container_cls. If mapper_cls specified, register the class as the mapper for container_cls
Parameters:
  • container_cls (type) – the Container class for which the given ObjectMapper class gets used for
  • mapper_cls (type) – the ObjectMapper class to use to map
pynwb.validate(io, namespace=core)

Validate an NWB file against a namespace

Parameters:
  • io (FORMIO) – the FORMIO object to read from
  • namespace (str) – the namespace to validate against
Returns:

errors in the file

Return type:

list