Skip to main content
Version: 0.5.4

common.normalizers.naming.naming

NamingConvention Objects

class NamingConvention(ABC)

[view_source]

normalize_identifier

@abstractmethod
def normalize_identifier(identifier: str) -> str

[view_source]

Normalizes and shortens the identifier according to naming convention in this function code

normalize_table_identifier

def normalize_table_identifier(identifier: str) -> str

[view_source]

Normalizes and shortens identifier that will function as a dataset, table or schema name, defaults to normalize_identifier

make_path

@abstractmethod
def make_path(*identifiers: str) -> str

[view_source]

Builds path out of identifiers. Identifiers are neither normalized nor shortened

break_path

@abstractmethod
def break_path(path: str) -> Sequence[str]

[view_source]

Breaks path into sequence of identifiers

normalize_path

def normalize_path(path: str) -> str

[view_source]

Breaks path into identifiers, normalizes components, reconstitutes and shortens the path

normalize_tables_path

def normalize_tables_path(path: str) -> str

[view_source]

Breaks path of table identifiers, normalizes components, reconstitutes and shortens the path

shorten_fragments

def shorten_fragments(*normalized_idents: str) -> str

[view_source]

Reconstitutes and shortens the path of normalized identifiers

shorten_identifier

@staticmethod
@lru_cache(maxsize=None)
def shorten_identifier(normalized_ident: str,
identifier: str,
max_length: int,
collision_prob: float = _DEFAULT_COLLISION_PROB) -> str

[view_source]

Shortens the name to max_length and adds a tag to it to make it unique. Tag may be placed in the middle or at the end

SupportsNamingConvention Objects

class SupportsNamingConvention(Protocol)

[view_source]

Expected of modules defining naming convention

NamingConvention

A class with a name NamingConvention deriving from normalizers.naming.NamingConvention

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.