🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

mapping-to-namedtuple

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapping-to-namedtuple

Converts Python Mapping to namedtuple recursively

0.1
Maintainers
1

Convertor of Python Mappings to namedtuples

This project contains a function that converts a Python Mapping or dict to a namedtuple. The conversion works recursively and the input can contain other mappings or lists.

Usage

from mapping_to_namedtuple import mapping_to_named_tuple

mapping = {"a": "b", "c": "d", "e": [1, 2]}

namedtuple = mapping_to_named_tuple(mapping, "test_tuple")

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts