Languages
This section contains the reference for the implementation of tokei's Languages
struct.
Languages ¶
A class representing a list of languages counted in the provided directory.
See LanguageType.list
Examples¶
```python
>>> from pytokei import Languages
>>> langs = Languages()
>>> langs
Languages()
```
References¶
__getitem__ ¶
Implements the same functionality as in tokei to access the contents of a given languages object by a key.
Corresponds to let rust = &languages[&LanguageType::Rust];
in python
files ¶
Total number of files in the value, corresponding to the language name key.
get_languages ¶
Exposes the inner struct from rust to the classes defined in python.
get_languages_plain ¶
The same method as get_languages
but in python builtin objects.
get_statistics ¶
Populates the Languages struct with statistics about languages provided by Language.
Takes a list of of paths (as str) to recursively traverse, paths can be relative,
absolute or glob paths.
A second list of paths (as str) to ignore, these strings use the .gitignore
syntax,
such as target
or **/*.bk
.
Parameters¶
paths : list[str]
List of files to traverse. It may be a single directory.
ignored : list[str]
List of files to ignore. If you don't want anything ignored, just pass `["ignored"]`.
config : Config
Config instance. If you dont have any preferences, just pass `Config`.
language_names ¶
Returns the list of language names, if any was found.
report_compact_plain ¶
Returns the information as the default command from tokei. Computes the statistics per language.