\hypertarget{namespacekeynames}{}\doxysection{keynames Namespace Reference}
\label{namespacekeynames}\index{keynames@{keynames}}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \mbox{\hyperlink{classkeynames_1_1Namespace}{Namespace}}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Tuple\mbox{[}bool, Optional\mbox{[}str\mbox{]}\mbox{]} \mbox{\hyperlink{namespacekeynames_af1ac93de72b70978b543459822239c1e}{check\+\_\+array\+\_\+part}} (str part)
\item 
str \mbox{\hyperlink{namespacekeynames_afd32e71fdf1da7a79bde2b7118b495e7}{canonicalize}} (str name, str prefix=\char`\"{}\char`\"{}, bool verbose=False)
\item 
Tuple\mbox{[}\mbox{\hyperlink{classkeynames_1_1Namespace}{Namespace}}, Iterator\mbox{[}str\mbox{]}\mbox{]} \mbox{\hyperlink{namespacekeynames_a863e5284234ae79790bed52f7edf421f}{unescape}} (str canonical, bool verbose=False)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\begin{DoxyVerb}This file contains a reference implementation of Elektra's Key Name processing.

It contains commented functions for:
  - Checking, whether a string is a valid Key Name and if so turning it into its canonical form.
  - Splitting (canonical) Key Names into a Namespace and a list of (unescaped) Key Name Parts.

In addition, we provide a command line interface to experiment with the implementation.
Execute the file with the argument '--help' to find out more about the CLI.
\end{DoxyVerb}
 

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{namespacekeynames_afd32e71fdf1da7a79bde2b7118b495e7}\label{namespacekeynames_afd32e71fdf1da7a79bde2b7118b495e7}} 
\index{keynames@{keynames}!canonicalize@{canonicalize}}
\index{canonicalize@{canonicalize}!keynames@{keynames}}
\doxysubsubsection{\texorpdfstring{canonicalize()}{canonicalize()}}
{\footnotesize\ttfamily  str keynames.\+canonicalize (\begin{DoxyParamCaption}\item[{str}]{name,  }\item[{str }]{prefix = {\ttfamily \char`\"{}\char`\"{}},  }\item[{bool }]{verbose = {\ttfamily False} }\end{DoxyParamCaption})}

\begin{DoxyVerb}Returns the canonical version of the Key Name `name`.
If `name` is not a valid Key Name, a `KeyNameException` will be raised.

If `prefix` is not empty, `name` is canonicalized under the assumption that it is being appended to the existing Key Name `prefix`.
It is similar to (but not necessarily the same as) calling `canonicalize (name + "/" + prefix)`.

If `verbose` is set to `True`, additional information about the procedure is printed to `sys.stderr`.
\end{DoxyVerb}
 \mbox{\Hypertarget{namespacekeynames_af1ac93de72b70978b543459822239c1e}\label{namespacekeynames_af1ac93de72b70978b543459822239c1e}} 
\index{keynames@{keynames}!check\_array\_part@{check\_array\_part}}
\index{check\_array\_part@{check\_array\_part}!keynames@{keynames}}
\doxysubsubsection{\texorpdfstring{check\_array\_part()}{check\_array\_part()}}
{\footnotesize\ttfamily  Tuple\mbox{[}bool, Optional\mbox{[}str\mbox{]}\mbox{]} keynames.\+check\+\_\+array\+\_\+part (\begin{DoxyParamCaption}\item[{str}]{part }\end{DoxyParamCaption})}

\begin{DoxyVerb}Checks whether `part` is a valid Array Part.

If so, the tuple `(True, digits)` is returned where `digits` is a string
containing the digits part of the Array Part, i.e. the part after the `#` and any `_`.
Otherwise the tuple `(False, None)` is returned.
\end{DoxyVerb}
 \mbox{\Hypertarget{namespacekeynames_a863e5284234ae79790bed52f7edf421f}\label{namespacekeynames_a863e5284234ae79790bed52f7edf421f}} 
\index{keynames@{keynames}!unescape@{unescape}}
\index{unescape@{unescape}!keynames@{keynames}}
\doxysubsubsection{\texorpdfstring{unescape()}{unescape()}}
{\footnotesize\ttfamily  Tuple\mbox{[}\mbox{\hyperlink{classkeynames_1_1Namespace}{Namespace}}, Iterator\mbox{[}str\mbox{]}\mbox{]} keynames.\+unescape (\begin{DoxyParamCaption}\item[{str}]{canonical,  }\item[{bool }]{verbose = {\ttfamily False} }\end{DoxyParamCaption})}

\begin{DoxyVerb}Returns the Namespace enum value and list of Key Name Parts for a given canonical Key Name.

`canonical` MUST be a canonical Key Name. If you are not sure about this, call `canonicalize` first.
\end{DoxyVerb}
 