Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cdgriffith/Box
/ functions
Functions
897 in github.com/cdgriffith/Box
⨍
Functions
897
◇
Types & classes
104
↳
Endpoints
8
↓ 155 callers
Method
to_dict
Turn the Box and sub Boxes back into a native python dictionary. :return: python dictionary of this Box
box/box.py:1114
↓ 71 callers
Method
get
(self, key, default=NO_DEFAULT)
box/box.py:568
↓ 62 callers
Method
from_yaml
Transform a yaml object string into a Box object. By default will use SafeLoader. :param yaml_string: string to pass to `yam
box/box.py:1416
↓ 51 callers
Method
get_comment
Return the comments of `key` as ``{"before": text, "eol": text}`` (a position without a comment is left out), or None. ``key=None`` r
box/box.py:921
↓ 45 callers
Method
append
(self, p_object)
box/box_list.py:207
↓ 45 callers
Method
pop
(self, key, *args)
box/box.py:1060
↓ 43 callers
Method
update
(self, *args, **kwargs)
box/box.py:1132
↓ 42 callers
Method
copy
(self)
box/box.py:591
↓ 42 callers
Method
to_yaml
Transform the Box object into a YAML string. :param filename: If provided will save to file :param default_flow
box/box.py:1383
↓ 37 callers
Method
set_comment
Attach a comment to an existing key. `position` is "eol" (default, on the key's line) or "before" (lines above the key, may contain n
box/box.py:929
↓ 35 callers
Method
keys
(self, dotted: bool = False)
box/box.py:536
↓ 34 callers
Method
to_list
(self)
box/box_list.py:449
↓ 31 callers
Method
merge_update
Recursively update the Box, merging nested dictionaries instead of overwriting them like the built-in ``dict.update``. The `
box/box.py:1151
↓ 25 callers
Method
items
(self, dotted: bool = False)
box/box.py:559
↓ 21 callers
Method
from_json
Transform a json object string into a Box object. If the incoming json is a list, you must use BoxList.from_json. :param jso
box/box.py:1351
↓ 18 callers
Method
setdefault
(self, item, default=None)
box/box.py:1254
↓ 17 callers
Method
set_comment
Attach a comment to an existing key. `position` is "eol" (default, on the key's line) or "before" (lines above the key, may contain n
box/box_list.py:372
↓ 16 callers
Function
_no_create_box
(**kwargs)
test/test_box.py:2163
↓ 16 callers
Method
extend
(self, iterable)
box/box_list.py:211
↓ 14 callers
Function
annotated
(**options)
test/test_audit_sync.py:31
↓ 14 callers
Method
pop
(self, index=-1)
box/box_list.py:227
↓ 14 callers
Method
to_json
Transform the Box object into a JSON string. :param filename: If provided will save to file :param encoding: File encoding
box/box.py:1332
↓ 12 callers
Method
__box_config
(self, extra_namespace: Any = NO_NAMESPACE)
box/box.py:708
↓ 12 callers
Method
get_comment
Return the comments of `key` as ``{"before": text, "eol": text}`` (a position without a comment is left out), or None. ``key=None`` r
box/box_list.py:364
↓ 11 callers
Function
_exists
(filename: str | PathLike, create: bool = False)
box/converters.py:113
↓ 11 callers
Method
popitem
(self)
box/box.py:1091
↓ 10 callers
Method
__getitem__
(self, item, _ignore_default=False)
box/box.py:781
↓ 10 callers
Method
__setitem__
(self, key, value)
test/test_update_insertion.py:71
↓ 10 callers
Method
_safe_attr
Convert a key into something that is accessible as an attribute
box/box.py:1265
↓ 10 callers
Function
check_comments
A comment, wherever it is, must be the one of the item now at that position, and every item id in `kept` must still have its comment.
test/test_audit_sync.py:42
↓ 10 callers
Method
clear
(self)
box/box.py:1084
↓ 10 callers
Method
from_toon
Transforms a TOON string or file into a Box object :param toon_string: string to pass to `toon_format.decode` :p
box/box.py:1605
↓ 9 callers
Function
_parse_box_dots
Split a box_dots key at its first "." or "[". Callers only pass keys that contain one.
box/box.py:193
↓ 9 callers
Method
insert
(self, index, p_object)
box/box_list.py:218
↓ 8 callers
Method
__setitem__
(self, key, value)
box/box.py:949
↓ 8 callers
Method
_comment_document
(self, create: bool = True)
box/box.py:871
↓ 7 callers
Method
__contains__
(self, item)
box/box.py:511
↓ 7 callers
Method
_comment_check_frozen
(self)
box/box_list.py:274
↓ 7 callers
Method
_comment_store
(self, create: bool = True)
box/box.py:865
↓ 7 callers
Function
box_from_string
Parse the provided string into a Box or BoxList object as appropriate. :param content: String to parse :param string_type: manually spec
box/from_file.py:136
↓ 7 callers
Function
check_converted
(bl, **options)
test/test_audit_sync.py:59
↓ 7 callers
Method
del_comment
Remove every comment of `key` (``None``: the document comments).
box/box.py:937
↓ 7 callers
Function
dots_box
(**options)
test/test_audit_sync.py:366
↓ 7 callers
Method
from_msgpack
Transforms msgpack bytes or file into a Box object :param msgpack_bytes: string to pass to `msgpack.unpackb` :pa
box/box.py:1548
↓ 7 callers
Method
from_toml
Transforms a toml string or file into a Box object :param toml_string: string to pass to `toml.load` :param file
box/box.py:1496
↓ 7 callers
Method
merge_update
(self, *args, **kwargs)
box/config_box.py:198
↓ 7 callers
Method
sort
(self, *, key=None, reverse=False)
box/box_list.py:249
↓ 7 callers
Method
update
(self, *args, **kwargs)
box/config_box.py:177
↓ 6 callers
Method
__contains__
(self, item)
box/config_box.py:149
↓ 6 callers
Method
__process_dotted_key
(self, item)
box/box.py:642
↓ 6 callers
Function
_camel_killer
CamelKiller, qu'est-ce que c'est? Taken from http://stackoverflow.com/a/1176023/3244542
box/box.py:75
↓ 6 callers
Function
_make_internal
()
test/test_box.py:1860
↓ 6 callers
Method
bool
Return value of key as a boolean :param item: key of value to transform :param default: value to return if item does not exi
box/config_box.py:231
↓ 6 callers
Method
int
Return value of key as an int :param item: key of value to transform :param default: value to return if item does not exist
box/config_box.py:255
↓ 6 callers
Method
items
()
test/test_box_list.py:96
↓ 6 callers
Method
reverse
(self)
box/box_list.py:243
↓ 6 callers
Method
to_json
Transform the BoxList object into a JSON string. :param filename: If provided will save to file :param encoding: File encodi
box/box_list.py:462
↓ 6 callers
Method
to_msgpack
Transform the Box object into a msgpack string. :param filename: File to write msgpack object too :param kwargs:
box/box.py:1537
↓ 6 callers
Method
to_toon
Transform the Box object into a TOON string. :param filename: File to write TOON object too :param encoding: Fil
box/box.py:1590
↓ 5 callers
Method
__dots_int_key
A segment of a box_dots path made of digits also matches the int key with that value, so "a.2" reaches {"a": {2: ...}} (#123). Only u
box/box.py:620
↓ 5 callers
Method
__getattr__
(self, item)
box/box.py:822
↓ 5 callers
Method
_comment_reindex
(self, mapping)
box/box_list.py:278
↓ 5 callers
Method
_convert
(self, p_object)
box/box_list.py:192
↓ 5 callers
Function
_exception_cause
Unwrap BoxKeyError and BoxValueError errors to their cause. Use with `raise ... from _exception_cause(err)` to avoid deeply nested stacktrac
box/box.py:65
↓ 5 callers
Function
_from_toml
( toml_string: str | None = None, filename: str | PathLike | None = None, encoding: str = "utf-8",
box/converters.py:328
↓ 5 callers
Function
box_from_file
Loads the provided file and tries to parse it into a Box or BoxList object as appropriate. :param file: Location of file :param encoding
box/from_file.py:108
↓ 5 callers
Method
remove
(self, value)
box/box_list.py:235
↓ 5 callers
Method
to_toml
Transform the Box object into a toml string. :param filename: File to write toml object too :param encoding: Fil
box/box.py:1477
↓ 4 callers
Method
__camel_destructive
camel_killer_box renames keys to snake_case unless camel_killer_box_keep_keys is set
box/box.py:638
↓ 4 callers
Method
_ci_after_write
Update the index after `key` was written or deleted through ConfigBox.
box/config_box.py:87
↓ 4 callers
Method
_ci_key
Return the stored key equal to `key` ignoring case, or None. Only str keys are matched.
box/config_box.py:58
↓ 4 callers
Method
_ci_resolve
Return the key to use for `key`: the stored spelling if one matches, `key` otherwise.
box/config_box.py:69
↓ 4 callers
Method
_comment_copy_to
(self, other, offset=0, document=True)
box/box_list.py:352
↓ 4 callers
Method
_comment_owner
(container, key) that holds the comment for `key`, following box_dots paths.
box/box.py:891
↓ 4 callers
Function
_to_toml
(obj, filename: str | PathLike | None = None, encoding: str = "utf-8", errors: str = "strict")
box/converters.py:314
↓ 4 callers
Method
list
Return value of key as a list :param item: key of value to transform :param mod: function to map against list :param
box/config_box.py:287
↓ 3 callers
Method
__delitem__
(self, key)
box/box.py:1000
↓ 3 callers
Method
__delitem__
(self, key)
box/config_box.py:170
↓ 3 callers
Method
__get_default
(self, item)
box/box.py:650
↓ 3 callers
Method
__getitem__
(self, item, _ignore_default=False)
box/box_list.py:68
↓ 3 callers
Method
__setattr__
(self, key, value)
box/box.py:980
↓ 3 callers
Method
__setitem__
(self, key, value)
box/config_box.py:155
↓ 3 callers
Method
_ci_check_frozen
(self)
box/config_box.py:110
↓ 3 callers
Method
_ci_take_over
Remove a stored key that differs from `key` only by case, so `key` replaces it. With keep_value its value is stored again under the n
box/config_box.py:114
↓ 3 callers
Method
_comment_copy_to
(self, other)
box/box.py:909
↓ 3 callers
Method
_flush_pending_parent
With `default_box_create_on_get=False` a missing key returns an ephemeral child Box that is not stored in its parent. The first time
box/box.py:842
↓ 3 callers
Function
_ruamel_to_builtin
Convert ruamel.yaml numeric and boolean scalar types to plain Python builtins. ScalarFloat/ScalarInt survive Box.to_dict() and break serializers
box/converters.py:222
↓ 3 callers
Function
_to_json
( obj, filename: str | PathLike | None = None, encoding: str = "utf-8", errors: str = "strict", **json_kwa
box/converters.py:129
↓ 3 callers
Function
_to_msgpack
(obj, filename: str | PathLike | None = None, **kwargs)
box/converters.py:345
↓ 3 callers
Function
_token_lines
Comment token text to comment lines without the "#", blank lines kept as "".
box/comments.py:42
↓ 3 callers
Method
from_csv
( cls, csv_string: str | None = None, filename: str | PathLike | None = None,
box/box_list.py:814
↓ 3 callers
Function
frozen_annotated
(**options)
test/test_audit_sync.py:38
↓ 3 callers
Method
to_csv
(self, filename: str | PathLike | None = None, encoding: str = "utf-8", errors: str = "strict")
box/box_list.py:810
↓ 3 callers
Method
to_toon
Transform the BoxList object into a TOON string. :param filename: File to write TOON object too :param encoding:
box/box_list.py:749
↓ 2 callers
Method
__copy__
(self)
box/box.py:596
↓ 2 callers
Method
__copy_internals
Carry instance-only attributes listed in `_box_internal_attrs`, and comments, over to `new`.
box/box.py:582
↓ 2 callers
Method
__init__
(self, iterable: Iterable | None = None, box_class: type[box.Box] = box.Box, **box_options)
box/box_list.py:56
↓ 2 callers
Method
__ior__
(self, other: Mapping[Any, Any])
box/box.py:459
↓ 2 callers
Method
__new_from_plain
A Box of this box's class and options (unfrozen, top level) holding a plain dict's data
box/box.py:428
↓ 2 callers
Method
__ror__
(self, other: Mapping[Any, Any])
box/box.py:450
next →
1–100 of 897, ranked by callers