Skip to main content

A super simple string searching library for complex list/dict structures

Project description

fynd

PyPI Build Status

fynd makes it super simple to search for strings in complex list/dict (JSON like) data structures. It returns a list of paths from root of the data structure to the found strings.

Installation

pip install fynd

Usage

from fynd import Fynd as fynd

COLLECTION = {
    'blogposts': [
        {
            'title': 'Lorem Ipsum',
            'text': 'Dolor Sit Amet Blah Blah Blah'
        },
        {
            'title': 'Brown Fox',
            'text': 'The quick brown fox jumps over blah'
        }
    ]
}

# default usage:
RESULT = fynd('blah').inside(COLLECTION)
# ^ will return,
# [
#    ['blogposts', 0, 'text'], 
#    ^ COLLECTION['blogposts'][0]['text'] == 'Dolor Sit ... Blah'
#    ['blogposts', 1, 'text']
#    ^ COLLECTION['blogposts'][1]['text'] == 'The quick ... blah'
# ]

# case sensitive usage:
RESULT = fynd('blah').case_sensitive().inside(COLLECTION)
# ^ will return,
# [
#    ['blogposts', 1, 'text']
#    ^ COLLECTION['blogposts'][1]['text'] == 'The quick ... blah'
# ]

# not found case:
RESULT = fynd('hulalala').inside(COLLECTION)
# ^ will return,
# [] an empty list

Meta

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

fynd-1.3.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

fynd-1.3.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file fynd-1.3.0.tar.gz.

File metadata

  • Download URL: fynd-1.3.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fynd-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ecb50cb6e6e108b7af33bb6bbda83519f3c08d3f6fb14048c63e5f8fd21d84f4
MD5 8c8080317ad0fda5971dc1657acf8303
BLAKE2b-256 dd473c718cc8ba2a36b386eb4f42115e8f0f8a0949fa27604eed1f041f5ace41

See more details on using hashes here.

File details

Details for the file fynd-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fynd-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7183484f4464c21e6131b8573d6f19cc5d0b4a10bca36c6d7feb2e74116e17
MD5 c2f2af9a1fb01aecda6782aa784bf63d
BLAKE2b-256 591b125f6d21db8576c17afd0f9851643edef6375d746f7f6645ad47649eb01f

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