Utility Functions & Classes
Project description
Klein Util
Module to contain some basic utility components
klein_util.dict
traverse_dict()
- function for traversing nested dicts using a list of keys
Example: get a field from a mongo doc
using dot notation:
from klein_util.dict import traverse_dict
property = 'ner.chemicalentities.found'
entities_found = traverse_dict(doc, property.split('.'))
Tests
To run tests, run the following command in the project root directory:
python -m pytest
License
This project is licensed under the terms of the Apache 2 license, which can be found in the repository as LICENSE.txt
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
klein_util-1.0.8.tar.gz
(6.8 kB
view details)
Built Distribution
File details
Details for the file klein_util-1.0.8.tar.gz
.
File metadata
- Download URL: klein_util-1.0.8.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62490c79e04ebd2320c825a2177f065e1751a5a490181935941a19255d43ef63 |
|
MD5 | 9e8dfd39b8d576ea00dec180e822ab39 |
|
BLAKE2b-256 | 490095f56ef00cb61f19a8dd5caeeb1524965683694dc5c97f60e4e4c282c00a |
File details
Details for the file klein_util-1.0.8-py3-none-any.whl
.
File metadata
- Download URL: klein_util-1.0.8-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c25580aba071d87710cc20d52ead20f78cc211966ab5722266470cfb40a35f71 |
|
MD5 | 4de51e3732bee3a7ecd9f0826378b5da |
|
BLAKE2b-256 | 15def1a645aacec61c137e49ff4c8e4aaee03146c6b4dd8eef8b69ba41c28bbe |