jmespath / jmespath/jmespath.py

Help: Searching the region name if it contains a city name in geoname.org JSON files

Open
#200 0 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.