abacusai.api_class.abstract — AbacusAI documentation

# `abacusai.api_class.abstract`

## Module Contents

### Classes

`ApiClass` | Helper class that provides a standard way to create an ABC using
`_ApiClassFactory` | Helper class that provides a standard way to create an ABC using

### Functions

`camel_case`(value) |
`upper_snake_case`(value) |
`snake_case`(value) |
`get_clean_function_source_code`(func) |

### Attributes

`FIRST_CAP_RE` |
`ALL_CAP_RE` |

abacusai.api_class.abstract.FIRST_CAP_RE

abacusai.api_class.abstract.ALL_CAP_RE

abacusai.api_class.abstract.camel_case(value)

abacusai.api_class.abstract.upper_snake_case(value)

abacusai.api_class.abstract.snake_case(value)

abacusai.api_class.abstract.get_clean_function_source_code(func)
  Parameters:

    func (Callable)

class abacusai.api_class.abstract.ApiClass

  Bases: `abc.ABC`

  Helper class that provides a standard way to create an ABC using inheritance.

  _upper_snake_case_keys: bool
  _support_kwargs: bool
  __post_init__()
  classmethod _get_builder()
  __str__()

    Return str(self).

  _repr_html_()
  __getitem__(item)
    Parameters:

      item (str)

  __setitem__(item, value)
    Parameters:

      - item (str)

      - value (Any)

  _unset_item(item)
    Parameters:

      item (str)

  get(item, default=None)
    Parameters:

      - item (str)

      - default (Any)

  pop(item, default=NotImplemented)
    Parameters:

      - item (str)

      - default (Any)

  to_dict()

    Standardizes converting an ApiClass to dictionary. Keys of response dictionary are converted to camel case. This also validates the fields ( type, value, etc ) received in the dictionary.

  classmethod from_dict(input_dict)
    Parameters:

      input_dict (dict)

class abacusai.api_class.abstract._ApiClassFactory

  Bases: `abc.ABC`

  Helper class that provides a standard way to create an ABC using inheritance.

  config_abstract_class
  config_class_key
  config_class_map
  classmethod from_dict(config)
    Parameters:

      config (dict)

    Return type:

      ApiClass