Skip to main content

A Python class for searching within JSON data structures

Project description

JSON Search Engine

This is a Python class named JSONSearchEngine designed to facilitate searching within JSON data structures. The class provides methods to search for specific keys or values within JSON objects, as well as the ability to find occurrences of patterns using regular expressions.

Installation

Use the package manager pip to install foobar.

pip install JsonSearchEngine

Example Package

This is a simple example package. You can use GitHub-flavored Markdown to write your content.

Usage

from jsonsearch import JSONSearchEngine

# Example JSON data
data_json = {
    "name": "John",
    "age": 30,
    "address": {
        "city": "New York",
        "zipcode": "10001"
    },
    "emails": ["john@example.com", "john.doe@gmail.com"]
}

# Initialize JSONSearchEngine with JSON data
search_engine = JSONSearchEngine(data_json)

# Search for a specific key
key_results = search_engine.search_key("age")
print("Key results:", key_results)

# Search for a specific value
value_results = search_engine.search_value("New York")
print("Value results:", value_results)

# Find all occurrences of a pattern
pattern_results = search_engine.find_all(r'\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b')
print("Pattern results:", pattern_results)

License

MIT

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

JsonSearchEngine-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

JsonSearchEngine-1.0.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file JsonSearchEngine-1.0.0.tar.gz.

File metadata

  • Download URL: JsonSearchEngine-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for JsonSearchEngine-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a70828f69526618466c0c3dc87ade3f65c45bc4154ff967df8c9efea9c403784
MD5 314cc00361fd4c1a228f48ce2eb8d730
BLAKE2b-256 39d553d34d03e5bb234d741a10770cf3f277f58208bcb3cab864f8dc6cfe91fa

See more details on using hashes here.

File details

Details for the file JsonSearchEngine-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for JsonSearchEngine-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f65eaf06d557254ae9d46e670968381c04aa5dd341e064333065f95d0bcd324b
MD5 435f22fba156b788f0c1543dc4afd1b3
BLAKE2b-256 0cddc443e3f86ef110f1a5ea60ca5aac33a6226f1b28d00ff0faa09dcc7bde29

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