Skip to main content

This tool converts a valid value in a sequence to a hash and contains a path to a valid value in the key field

Project description

sequence2hash - Convert sequence to hash

This tool converts a valid value in a sequence to a hash and contains a path to a valid value in the key field

Features

  • Convert valid values in the sequence to hashes
  • Paths showing valid values in the key field
  • Valid values not (), [], {}, None, ''

Requirements

  • Does not require any third party libraries

Installation

pip install sequence2hash

Examples

Define the sequence variable:

parameters = {
    'queryKey': '',
    'constraints': {
        'ids': [],
        'phids': (),
        'name': 'Operating platform'
        'members': ('Bunoob', 1944, 'Google'),
        'watchers': [],
        'status': '',
        'isMilestone': True,
        'icons': [],
        'colors': ['blue', '', 'red', ''],
        'parents': [],
        'ancestors': [],
    },
    'attachments': {
        'subscribers': None
    },
    'order': 'newest',
    'before': '',
    'after': '',
    'limit': {}
}

Transfer:

import sequence2hash
for x in sequence2hash.flatten(parameters):
    print(x)

Output:

{'key': ['constraints', 'name'], 'value': 'Operating platform'}
{'key': ['constraints', 'members', '0'], 'value': 'Bunoob'}
{'key': ['constraints', 'members', '1'], 'value': 1944}
{'key': ['constraints', 'members', '2'], 'value': 'Google'}
{'key': ['constraints', 'isMilestone'], 'value': True}
{'key': ['constraints', 'colors', '0'], 'value': 'blue'}
{'key': ['constraints', 'colors', '2'], 'value': 'red'}
{'key': ['order'], 'value': 'newest'}

Credits

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

sequence2hash-1.1.2.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file sequence2hash-1.1.2.tar.gz.

File metadata

File hashes

Hashes for sequence2hash-1.1.2.tar.gz
Algorithm Hash digest
SHA256 2c78f5347cd399757ccc573a324ddba56393a0e82ba17ecd48377b11f55c21cf
MD5 4c5bc095c1362eef95d698af0f12e2bb
BLAKE2b-256 53ff0d86208752d071b610c6bd44c89ff51436ba5a4cce710d73232cfb71473f

See more details on using hashes here.

Supported by

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