# Path: openprovider/util.py
# def camel_to_snake(string):
#     """
#     Converts a camelCaseString to a snake_case_string.
# 
#     >>> camel_to_snake("fooBarBaz")
#     'foo_bar_baz'
#     """
#     return re.sub('([A-Z]+)', r'_\1', string).lower()
# 
# def snake_to_camel(value):
#     """
#     Converts a snake_case_string to a camelCaseString.
# 
#     >>> snake_to_camel("foo_bar_baz")
#     'fooBarBaz'
#     """
#     camel = "".join(word.title() for word in value.split("_"))
#     return value[:1].lower() + camel[1:]


import datetime
import lxml.etree
from openprovider.util import camel_to_snake, snake_to_camel
# coding=utf-8

"""
Wrapper classes for API models. Most of these are thin wrappers over lxml
objectified versions of API responses.
"""



class Model(object):
    """
    Superclass for all models. Delegates attribute access to a wrapped class.
    """

    def __init__(self, obj=None, **kwargs):
        self._obj = obj
        self._attrs = dict((snake_to_camel(key), value) for (key, value) in kwargs.items())

    def __dir__(self):

# Path: openprovider/util.py
# def camel_to_snake(string):
#     """
#     Converts a camelCaseString to a snake_case_string.
# 
#     >>> camel_to_snake("fooBarBaz")
#     'foo_bar_baz'
#     """
#     return re.sub('([A-Z]+)', r'_\1', string).lower()
# 
# def snake_to_camel(value):
#     """
#     Converts a snake_case_string to a camelCaseString.
# 
#     >>> snake_to_camel("foo_bar_baz")
#     'fooBarBaz'
#     """
#     camel = "".join(word.title() for word in value.split("_"))
#     return value[:1].lower() + camel[1:]


# Path: openprovider/models.py
import datetime
import lxml.etree
from openprovider.util import camel_to_snake, snake_to_camel

# coding=utf-8

"""
Wrapper classes for API models. Most of these are thin wrappers over lxml
objectified versions of API responses.
"""



class Model(object):
    """
    Superclass for all models. Delegates attribute access to a wrapped class.
    """

    def __init__(self, obj=None, **kwargs):
        self._obj = obj
        self._attrs = dict((snake_to_camel(key), value) for (key, value) in kwargs.items())

    def __dir__(self):

        attrs = set(list(self.__dict__.keys()) + [camel_to_snake(key) for key in self._attrs.keys()])