antares.apps.core.utils package

Submodules

antares.apps.core.utils.date_utils module

class antares.apps.core.utils.date_utils.DateUtils

Bases: object

classmethod convert_days_to_time_unit(days, time_unit=None)

Converts an amount of days to the specified time unit, as the ORM returns differences in days.

antares.apps.core.utils.string_utils module

class antares.apps.core.utils.string_utils.StringUtils

Bases: object

A series of methods to help on the management of strings.

static camel_to_snake(s)

Used to convert the string in camelCase to snake case https://gist.github.com/jaytaylor/3660565

Parameters

s – String to convert.

static choice_adapter(enumtype)

provides an adapter to use enums (as included in Python 3.4) as field choices.

Parameters

enumType – the enum to adapt.

antares.apps.core.utils.version_utils module

based on the excelent DJANGO schema

class antares.apps.core.utils.version_utils.VersionUtils

Bases: object

classmethod get_complete_version(version=None)

Return a tuple of the version. If version argument is non-empty, check for correctness of the tuple provided.

classmethod get_docs_version(version=None)
classmethod get_git_changeset()

Return a numeric identifier of the latest git changeset. The result is the UTC timestamp of the changeset in YYYYMMDDHHMMSS format. This value isn’t guaranteed to be unique, but collisions are very unlikely, so it’s sufficient for generating the development version numbers.

classmethod get_last_git_hash()

Return a string identifier of the latest git commit. This value is unique enough to generate the development version numbers.

classmethod get_main_version(version=None)

Return main version (X.Y[.Z]) from VERSION.

classmethod get_version(version=None)

Return a PEP 440-compliant version number from VERSION.

Module contents