jmespath / jmespath/jmespath.py
Help: Searching the region name if it contains a city name in geoname.org JSON files
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
Hello there, I am using jmespath for python 3.x. I am trying to create a query that would return the array of name attribute of `region` if it contains a specific 'city'. Here is the schema of the JSON.
```
{
country-name
country-code
regions[
{
region-name
region-code
cities[
{city-name, city-lat, city-long},
{city-name, city-lat, city-long},
]
},
{
region-name
region-code
cities[
{city-name, city-lat, city-long},
{city-name, city-lat, city-long},
]
}
]
}
```
[IN.json.txt](https://github.com/jmespath/jmespath.py/files/4464250/IN.json.txt)
Attaching a sample JSON from [Geonames.org](www.geonames.org) for `country=India, city=Rampur`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.