Core components of NetLink tools
Project description
netlink-core
Core components of NetLink tools
This provides a small set of functionality share by my collection of tools:
Contents
- Centralized configuration using TOML
in the users home directory (subdirectory
.netlink
).
Classes
netlink.core.AttributeMapping
behaves like an immutable mapping, adding access to all items via property notation:
a['b'] == a.b
This is propagated through all levels, when parameter deep
is True
(default):
a['b']['c']['d'] == a.b.c.d
Parameter | Default | |
---|---|---|
value | mandatory | Mapping containing information. Might be deep. |
deep | True |
Items within the mapping will be copied, not referenced (implemented for Lists and Mappings). |
case_sensitive | False |
If False, ignore case when retrieving items or attributes. |
under | True |
Try dash (- ) if underscore (_ ) in name not found. |
netlink.core.Singleton
is a base class to be inherited from to make all instances of a class the same.
netlink.core.Config
is a Singleton that provides configuration information (will be initialized the first time).
Scripts
create_netlink_defaults
creates a TOML file containing all currently internal defaults in the users home directory ( subdirectory.netlink
). If the file already exist, the current file is copied as a backup with extension.001
.
Installation
Use your preferred tool to install from PyPI. I prefer Poetry.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
netlink-core-0.0.2.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for netlink_core-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cb0a520a52fbc1af67726589c2acf630d19ec4a313e4e80c20e5b7c65fdb866 |
|
MD5 | f61d207013db5be089c0efcad77b12f5 |
|
BLAKE2b-256 | 53b10b580570152af7811e67428921a7d984b5d11235be74b281dac4bf5c614e |