Skip to main content

kyops Python library for performing operations on data structures in python

Project description

KyOps python library

[[TOC]]

Overview

KyOps is a python library for performing operations on data structures in python. It provides a set of functions to manipulate structures such as a dict.

Installation

KyOps is a Python3 library that you can install via pip

pip install kyops

Usage

To date, the functionality it offers is the ability to update a nested dictionary from another dictionary. Example:

my_dict_to_update = {
    "client" : {
        "zip": "3500",
        "username" : "toto",
        "password" : "secret",
        "contacts" : {
            "tel" : "000000",
            "email" : "<default_email>"
        }
    }
}
new_values = {
    "client" : {
        "zip": {
            "Dep":"35",
            "code": "0000"
        },
        "password" : "confidenti@lP@ssword",
        "contacts" : {
            "email" : "email@gmail.com"
        }
    }
}

from kyops import Ndict
n_dict = Ndict(my_dict_to_update)
n_dict.update(new_values)

# Now my_dict.data contains updated datas

It possible to use merge_nested_dict static method:

kyops.merge_nested_dict(my_dict_to_update, new_values)
print(my_dict_to_update)

#Output
# {
#     "client": {
#         "zip": {
#             "Dep": "35",
#             "code": "0000"
#         },
#         "username": "toto",
#         "password": "confidenti@lP@ssword",
#         "contacts": {
#             "tel": "000000",
#             "email": "email@gmail.com"
#         }
#     }
# }

Contributing

You want to contribute to the project? Too cool, you're welcome. Please submit a pull request. Or write all your questions by opening an issue.

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

kyops-0.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kyops-0.1.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file kyops-0.1.1.tar.gz.

File metadata

  • Download URL: kyops-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kyops-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bc2328bba7dcf2712326eaf8c5f917719665e5a5a7e42d8d09d44f17bca13c99
MD5 f0b2b469fbd0319de58d9e9eb934310e
BLAKE2b-256 1d52492c6da831fef79f7a43d793ddcadd34b093cfa9c72c62a12c577a4a3997

See more details on using hashes here.

File details

Details for the file kyops-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kyops-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for kyops-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4f9bbbda48a8080aebc5f0027df01c592150effba118e03373275441b3cc245
MD5 bffcde69916456125ba4d885251d5b2d
BLAKE2b-256 50268e6115b55cbf384e79d20f7e910a026993b6d920bdcb83b90faece342d94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page