Your Python project companion
Project description
This package adds functionality to core Python container classes and provides functions for common tasks.
Mappings
Dictionary
: drop-in replacement for a python dict with anadd
method for a default mechanism of adding data, adelete
method for a default mechanism of deleting data, and asubset
method for returning a subset of the key/value pairs in a newDictionary
.Catalog
: wildcard-accepting dict which is intended for storing different options and strategies. It also returns lists of matches if a list of keys is provided.Library
: a dictionary that automatically supplies key names for stored items. The 'overwrite' argument determines if a unique key should always be created or whether entries may be overwritten.
Sequences
Listing
: drop-in replacement for a python list with anadd
method for a default mechanism of adding data, adelete
method for a default mechanism of deleting data, and asubset
method for returning a subset of the key/value pairs in a newListing
.Hybrid
: iterable with both dict and list interfaces. Stored items must be hashable or have aname
attribute.
Passthrough
Proxy
: transparently wraps an object and directs access methods to access the wrapped object when appropriate (under construction for edge cases).
Converters
instancify
: converts a class to an instance or adds kwargs to a passed instance as attributes.listify
: converts passed item to a list.namify
: returns hashable name for passed item.numify
: attempts to convert passed item to a numerical type.pathlibify
: converts a str to a pathlib object or leaves it as a pathlib object.stringify
:tuplify
: converts a passed item to a tuple.typify
: converts a str type to other common types, if possible.windowify
:to_dict
:to_index
:str_to_index
:to_int
:str_to_int
:float_to_int
:to_list
:str_to_list
:to_float
:int_to_float
:str_to_float
:to_path
:str_to_path
:to_str
:int_to_str
:float_to_str
:list_to_str
:none_to_str
:path_to_str
:datetime_to_str
:
Modifiers
- Adders:
add_prefix
: adds a str prefix to item.add_slots
: adds__slots__
to a dataclass.add_suffix
: adds a str suffix to item.
- Dividers:
cleave
: divides an item into 2 parts based ondivider
argument.separate
: divides an item into n+1 parts based ondivider
argument.
- Subtractors:
deduplicate
: removes duplicate data from an item.drop_dunders
: drops strings from a list if they start and end with double underscores.drop_prefix
: removes a str prefix from an item.drop_prefix_from_dict
drop_prefix_from_list
drop_prefix_from_set
drop_prefix_from_str
drop_prefix_from_tuple
drop_privates
drop_substring
: removes a substring from an item.drop_suffix
: removes a str suffix from an item.drop_suffix_from_dict
drop_suffix_from_list
drop_suffix_from_set
drop_suffix_from_str
drop_suffix_from_tuple
- Other:
capitalify
: converts a snake case str to capital case.snakify
: converts a capital case str to snake case.uniquify
: returns a unique key for a dict.
camina supports a wide range of coding styles. You can create complex multiple inheritance structures with mixins galore or simpler, compositional objects. Even though the data structures are necessarily object-oriented, all of the tools to modify them are also available as functions, for those who prefer a more funcitonal approaching to programming.
The project is also highly internally documented so that users and developers can easily make camina work with their projects. It is designed for Python coders at all levels. Beginners should be able to follow the readable code and internal documentation to understand how it works. More advanced users should find complex and tricky problems addressed through efficient code.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file camina-0.1.16.tar.gz
.
File metadata
- Download URL: camina-0.1.16.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.9.2 Linux/5.10.0-21-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9082f54f7d043ce7a04b4c35275fb55d19a9fddb2dfee6d38141c48836f2a06 |
|
MD5 | ab3161c064f86dc3aad98d0f35d8bb4c |
|
BLAKE2b-256 | 945af78a2d389bf17f3336e02b6ff2a4802d1daa0af04ff7a7b9d5f2132ff7ae |
File details
Details for the file camina-0.1.16-py3-none-any.whl
.
File metadata
- Download URL: camina-0.1.16-py3-none-any.whl
- Upload date:
- Size: 34.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.9.2 Linux/5.10.0-21-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 342ef041fd3bd37b00ebc655d8ada48de9e017006166d73b73fce69fbcab4f13 |
|
MD5 | 7993c2ac7d58bcb0205529b271215120 |
|
BLAKE2b-256 | bd2294291e68a0c388bfed32646a0de227a809a2a9dec296e3ac5031a90b4fd9 |