sdkagent

traitlets API reference

116 public APIs from traitlets (ipython/traitlets) — 48 classes, 19 functions, 49 methods. Signatures extracted by static analysis of the actual source.

Repository: ipython/traitlets

KindCount
Classes48
Functions19
Methods49

API list

classtraitlets.config.application.Application
A singleton application with full configuration support.
methodtraitlets.config.application.Application.emit_alias_help() -> t.Generator[str, None, None]
Yield the lines for alias part of the help.
methodtraitlets.config.application.Application.emit_description() -> t.Generator[str, None, None]
Yield lines with the application description.
methodtraitlets.config.application.Application.emit_examples() -> t.Generator[str, None, None]
Yield lines with the usage and examples.
methodtraitlets.config.application.Application.emit_flag_help() -> t.Generator[str, None, None]
Yield the lines for the flag part of the help.
methodtraitlets.config.application.Application.emit_help_epilogue(classes:bool) -> t.Generator[str, None, None]
Yield the very bottom lines of the help message.
methodtraitlets.config.application.Application.generate_config_file(classes:ClassesType | None=None) -> str
generate default config file from Configurables
methodtraitlets.config.application.Application.get_default_logging_config() -> StrDict
Return the base logging configuration.
methodtraitlets.config.application.Application.initialize(argv:ArgvType=None) -> None
Do the basic steps to configure me.
methodtraitlets.config.application.Application.initialize_subcommand(subc:str, argv:ArgvType=None) -> None
Initialize a subcommand with argv.
methodtraitlets.config.application.Application.load_config_environ() -> None
Load config files by environment.
methodtraitlets.config.application.Application.load_config_file(filename:str, path:str | t.Sequence[str | None] | None=None) -> None
Load config files by filename and path.
methodtraitlets.config.application.Application.loaded_config_files() -> list[str]
Currently loaded configuration files
methodtraitlets.config.application.Application.parse_command_line(argv:ArgvType=None) -> None
Parse the command line arguments.
methodtraitlets.config.application.Application.print_alias_help() -> None
Print the alias parts of the help.
methodtraitlets.config.application.Application.print_description() -> None
Print the application description.
methodtraitlets.config.application.Application.print_examples() -> None
Print usage and examples (see `emit_examples()`).
methodtraitlets.config.application.Application.print_flag_help() -> None
Print the flag part of the help.
methodtraitlets.config.application.Application.print_help(classes:bool=False) -> None
Print the help for each Configurable class in self.classes.
methodtraitlets.config.application.Application.print_options() -> None
Print the options part of the help.
methodtraitlets.config.application.Application.print_subcommands() -> None
Print the subcommand part of the help.
methodtraitlets.config.application.Application.print_version() -> None
Print the version string.
methodtraitlets.config.application.Application.start() -> None
Start the app mainloop.
methodtraitlets.config.application.Application.start_show_config() -> None
start function used when show_config is True
functraitlets.config.application.boolean_flag(name:str, configurable:str, set_help:str='', unset_help:str='') -> StrDict
Helper for building basic --trait, --no-trait flags.
functraitlets.config.configurable.Configurable.c(s:str) -> str
return a commented, wrapped block.
methodtraitlets.config.configurable.Configurable.class_config_section(classes:t.Sequence[type[HasTraits]] | None=None) -> str
Get the config section for this class.
methodtraitlets.config.configurable.Configurable.class_get_help(inst:HasTraits | None=None) -> str
Get the help string for this class in ReST format.
methodtraitlets.config.configurable.Configurable.class_get_trait_help(trait:TraitType[t.Any, t.Any], inst:HasTraits | None=None, helptext:str | None=None) -> str
Get the helptext string for a single trait.
methodtraitlets.config.configurable.Configurable.class_print_help(inst:HasTraits | None=None) -> None
Get the help string for a single trait and print it.
functraitlets.config.configurable.Configurable.notice_config_override(change:Bunch) -> None
Record traits set by both config and kwargs.
methodtraitlets.config.configurable.Configurable.section_names() -> list[str]
return section names as a list
methodtraitlets.config.configurable.Configurable.update_config(config:Config) -> None
Update config and load the new values
classtraitlets.config.configurable.LoggingConfigurable
A parent class for Configurables that log.
classtraitlets.config.configurable.SingletonConfigurable
A configurable that only allows one instance.
methodtraitlets.config.configurable.SingletonConfigurable.initialized() -> bool
Has an instance been created?
methodtraitlets.config.configurable.SingletonConfigurable.instance(*args:t.Any, **kwargs:t.Any) -> Self
Returns a global instance of this class.
classtraitlets.config.loader.CommandLineConfigLoader
A config loader for command line arguments.
classtraitlets.config.loader.Config
An attribute-based dict that can do smart merges.
methodtraitlets.config.loader.Config.collisions(other:Config) -> dict[str, t.Any]
Check for collisions between two config objects.
methodtraitlets.config.loader.Config.merge(other:t.Any) -> None
merge another config object into this one
classtraitlets.config.loader.ConfigLoader
A object for loading configurations from just about anywhere.
classtraitlets.config.loader.DeferredConfig
Class for deferred-evaluation of config from CLI
classtraitlets.config.loader.FileConfigLoader
A base class for file based configurations.
classtraitlets.config.loader.KeyValueConfigLoader
Deprecated in traitlets 5.0 Use KVArgParseConfigLoader
classtraitlets.config.loader.PyFileConfigLoader
A config loader for pure python files.
methodtraitlets.config.loader.PyFileConfigLoader.load_subconfig(fname:str, path:str | None=None) -> None
Injected into config file namespace as load_subconfig
functraitlets.config.manager.recursive_update(target:dict[Any, Any], new:dict[Any, Any]) -> None
Recursively update one dictionary using another.
functraitlets.log.get_logger() -> logging.Logger | logging.LoggerAdapter[Any]
Grab the global logger instance.
classtraitlets.traitlets.Any
A trait which allows any value.
classtraitlets.traitlets.Bool
A boolean (True, False) trait.
methodtraitlets.traitlets.Bool.argcompleter(**kwargs:t.Any) -> list[str]
Completion hints for argcomplete
classtraitlets.traitlets.Bytes
A trait for byte strings.
classtraitlets.traitlets.CBool
A casting version of the boolean trait.
classtraitlets.traitlets.CBytes
A casting version of the byte string trait.
classtraitlets.traitlets.CComplex
A casting version of the complex number trait.
classtraitlets.traitlets.CFloat
A casting version of the float trait.
classtraitlets.traitlets.CInt
A casting version of the int trait.
classtraitlets.traitlets.CLong
A deprecated alias for :class:`CInt`.
classtraitlets.traitlets.CRegExp
A casting compiled regular expression trait.
classtraitlets.traitlets.CUnicode
A casting version of the unicode trait.
classtraitlets.traitlets.Callable
A trait which is callable.
classtraitlets.traitlets.CaselessStrEnum
An enum of strings where the case should be ignored.
classtraitlets.traitlets.Complex
A trait for complex numbers.
methodtraitlets.traitlets.Container.from_string(s:str) -> T | None
Load value from a single string
classtraitlets.traitlets.Dict
An instance of a Python dict.
methodtraitlets.traitlets.Dict.from_string(s:str) -> dict[K, V] | None
Load value from a single string
methodtraitlets.traitlets.Dict.from_string_list(s_list:list[str]) -> t.Any
Return a dict from a list of config strings.
methodtraitlets.traitlets.Dict.item_from_string(s:str) -> dict[K, V]
Cast a single-key dict from a string.
classtraitlets.traitlets.Enum
An enum whose value must be in a given sequence.
methodtraitlets.traitlets.Enum.argcompleter(**kwargs:t.Any) -> list[str]
Completion hints for argcomplete
classtraitlets.traitlets.Float
A float trait.
classtraitlets.traitlets.ForwardDeclaredInstance
Forward-declared version of Instance.
classtraitlets.traitlets.ForwardDeclaredMixin
Mixin for forward-declared versions of Instance and Type.
classtraitlets.traitlets.ForwardDeclaredType
Forward-declared version of Type.
classtraitlets.traitlets.HasDescriptors
The base class for all classes that have descriptors.
methodtraitlets.traitlets.HasDescriptors.setup_instance(*args:t.Any, **kwargs:t.Any) -> None
This is called **before** self.__init__ is called.
functraitlets.traitlets.HasTraits.compress(past_changes:list[Bunch] | None, change:Bunch) -> list[Bunch]
Merges the provided change with the last if possible.
classtraitlets.traitlets.Instance
A trait whose value must be an instance of a specified class.
classtraitlets.traitlets.Int
An integer trait.
classtraitlets.traitlets.List
An instance of a Python list.
classtraitlets.traitlets.Long
A deprecated alias for :class:`Integer`.
classtraitlets.traitlets.MetaHasDescriptors
A metaclass for HasDescriptors.
classtraitlets.traitlets.MetaHasTraits
A metaclass for HasTraits.
classtraitlets.traitlets.Path
A trait for filesystem paths.
classtraitlets.traitlets.Set
An instance of a Python set.
classtraitlets.traitlets.TCPAddress
A trait for an (ip, port) tuple.
classtraitlets.traitlets.This
A trait for instances of the class containing this trait.
classtraitlets.traitlets.TraitType
A base class for all trait types.
methodtraitlets.traitlets.TraitType.get_metadata(key:str, default:t.Any=None) -> t.Any
DEPRECATED: Get a metadata value.
methodtraitlets.traitlets.TraitType.init_default_value(obj:t.Any) -> G | None
DEPRECATED: Set the static default value for the trait type.
methodtraitlets.traitlets.TraitType.set_metadata(key:str, value:t.Any) -> None
DEPRECATED: Set a metadata key/value.
methodtraitlets.traitlets.TraitType.tag(**metadata:t.Any) -> Self
Sets metadata and returns self.
classtraitlets.traitlets.Tuple
An instance of a Python tuple.
classtraitlets.traitlets.Type
A trait whose value must be a subclass of a specified class.
methodtraitlets.traitlets.Type.info() -> str
Returns a description of the trait.
methodtraitlets.traitlets.Type.validate(obj:t.Any, value:t.Any) -> G
Validates that the value is a valid object instance.
classtraitlets.traitlets.Unicode
A trait for unicode strings.
classtraitlets.traitlets.Union
A trait type representing a Union type.
classtraitlets.traitlets.UseEnum
Use a Enum class as model for the data type description.
methodtraitlets.traitlets.UseEnum.select_by_name(value:str, default:t.Any=Undefined) -> t.Any
Selects enum-value by using its name or scoped-name.
methodtraitlets.traitlets.UseEnum.select_by_number(value:int, default:t.Any=Undefined) -> t.Any
Selects enum-value by using its number-constant.
functraitlets.traitlets.is_trait(t:t.Any) -> bool
Returns whether the given value is an instance or subclass of TraitType.
functraitlets.traitlets.observe(*type:str='change', *names:Sentinel | str) -> ObserveHandler
A decorator which can be used to observe Traits on a class.
functraitlets.traitlets.parse_notifier_name(names:Sentinel | str | t.Collection[Sentinel | str]) -> t.Iterable[t.Any]
Convert the name argument to a list of names.
classtraitlets.utils.bunch.Bunch
A dict with attribute-access
functraitlets.utils.descriptions.add_article(name:str, definite:bool=False, capital:bool=False) -> str
Returns the string with a prepended article.
functraitlets.utils.descriptions.class_of(value:Any) -> Any
Returns a string of the value's type with an indefinite article.
functraitlets.utils.filefind(filename:str, path_dirs:Sequence[str] | None=None) -> str
Find a file by looking through a sequence of paths.
functraitlets.utils.getargspec.getargspec(func:Any) -> inspect.FullArgSpec
Like inspect.getargspec but supports functools.partial as well.
functraitlets.utils.importstring.import_item(name:str) -> Any
Import and return ``bar`` given the string ``foo.bar``.
functraitlets.utils.nested_update.nested_update(this:dict[Any, Any], that:dict[Any, Any]) -> dict[Any, Any]
Merge two nested dictionaries.
functraitlets.utils.text.wrap_paragraphs(text:str, ncols:int=80) -> list[str]
Wrap multiple paragraphs to fit a specified width.
functraitlets.utils.warnings.deprecated_method(method:t.Any, cls:t.Any, method_name:str, msg:str) -> None
Show deprecation warning about a magic method definition.
functraitlets.utils.warnings.should_warn(key:t.Any) -> bool
Add our own checks for too many deprecation warnings.
functraitlets.utils.warnings.warn(msg:str, category:t.Any, *stacklevel:int, *source:t.Any=None) -> None
Like warnings.warn(), but category and stacklevel are required.

About this data

These signatures were extracted from the public source of ipython/traitlets using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries