Skip to content

base_model

Module to define the PyDantic base model used in PyCelonis.

This module defines the PyDantic base model used in PyCelonis as well as all required encoding and conversion functions.

Typical usage example:

```python
class PyCelonisModel(PyCelonisBaseModel):
    pass
```

PyCelonisBaseModel

Bases: BaseModel

Base Model for any PyCelonis object.

PyCelonisBaseEnum

Bases: str, Enum

Base class for any PyCelonis enum.

to_camel

to_camel(string)

Converts snake case string to camel case.

Parameters:

  • string (str) –

    Snake case string to convert.

Returns:

  • str

    A string in camel case.

to_unix_timestamp_ms

to_unix_timestamp_ms(timestamp)

Returns datetime in milliseconds since epoch.

Parameters:

  • timestamp (datetime) –

    timestamp to convert to millisecond since epoch.

Returns:

  • int

    An int representing the milliseconds since epoch.