
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
A versatile Python package for data extraction from JSON-like structures with user-defined format keys, enhanced with synonym retrieval capabilities.
Complex Parser is a powerful Python package designed to streamline the process of data extraction from JSON-like structures while also enriching the extracted data with synonym retrieval capabilities. Whether you're working with complex nested JSON data or simple dictionaries, this package provides a flexible and intuitive solution for extracting specific data elements based on user-defined format keys, all while expanding the semantic richness of your data through synonym retrieval.
You can install Complex Parser via pip:
pip install complex-parser
Here's a simple example demonstrating how to use the package
from complex_parser import extract_data
# Example data
data = {
"people":[
{
"name": "John",
"age": 30,
"address": {
"road": "123 Main St",
"city": "Anytown"
}
},
{
"name": "Joshua",
"age": 3100,
"address": {
"road": "657 Loud St",
"city": "Basictown",
"landmark": "Town Square"
}
},
{
"name": "John",
"age": 30,
"location": {
"road": "8474 Main St",
"city": "None"
}
},
{
"fullname": "Job",
"age": 27,
"destination": {
"road": "8474 John's St",
"city": "London"
}
},
{
"unknown": "Job",
"age": 27,
"destination": {
"road": "8474 John's St",
"city": "London"
}
}
]
}
format_keys = ["name", "address"]
load_lists= {
"address":[
"location"
],
"name": [
"fullname"
]
}
# Extract data with specified format keys
extracted_data = extract_data(data=data, format_keys=format_keys,load_lists=load_lists)
print(extracted_data)
results:
[{'name': 'John', 'age': 30, 'address': {'road': '123 Main St', 'city': 'Anytown'}}, {'name': 'Joshua', 'age': 3100, 'address': {'road': '657 Loud St', 'city': 'Basictown', 'landmark': 'Town Square'}}, {'name': 'John', 'age': 30, 'location': {'road': '8474 Main St', 'city': 'None'}}, {'fullname': 'Job', 'age': 27, 'destination': {'road': "8474 John's St", 'city': 'London'}}]
This project is licensed under the Mozilla Public License Version 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit bug reports, feature requests, or pull requests on the GitHub repository.
FAQs
A versatile Python package for data extraction from JSON-like structures with user-defined format keys, enhanced with synonym retrieval capabilities.
We found that complex-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.