TheHive-Project / TheHive-Project/Cortex-Analyzers
glom: Restructuring data, the Python way
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 490
- Forks
- 405
- Avg merge
- 2d 43m
- Merged PRs (30d)
- 8
Description
Request Type
Thoughts on using the glom library for analyzers

Description
From https://sedimental.org/
Nested data is tricky though. Reaching into deeply structured data can get you some ugly errors. Consider this simple line:
value = target.a['b']['c']
That single line can result in at least four different exceptions, each less helpful than the last:
AttributeError: 'TargetType' object has no attribute 'a'
KeyError: 'b'
TypeError: 'NoneType' object has no attribute 'getitem'
TypeError: list indices must be integers, not str
Clearly, we need our tools to catch up to our nested data.
By way of introduction, let's start off with space-age access, the classic "deep-get":
from glom import glom
target = {'galaxy': {'system': {'planet': 'jupiter'}}}
spec = 'galaxy.system.planet'
output = glom(target, spec)
# output = 'jupiter'
target is our data, be it dict, list, or any other object
spec is what we want output to be
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points; start by reviewing the analyzer implementations and how they currently access nested data. Determine which analyzer workflows would use glom and define a concrete scope and acceptance criteria before implementation; done should include an agreed integration plan and corresponding validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100