Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bizarre Behavior #102

Open
jobdiogenes opened this issue Feb 16, 2023 · 0 comments
Open

Bizarre Behavior #102

jobdiogenes opened this issue Feb 16, 2023 · 0 comments

Comments

@jobdiogenes
Copy link

data = {'put-code': 125041690,
 'created-date': {'value': 1671562796453},
 'last-modified-date': {'value': 1671562796453},
 'source': {'source-orcid': None,
  'source-client-id': {'uri': 'https://orcid.org/client/0000-0001-9884-1913',
   'path': '0000-0001-9884-1913',
   'host': 'orcid.org'},
  'source-name': {'value': 'Crossref'},
  'assertion-origin-orcid': None,
  'assertion-origin-client-id': None,
  'assertion-origin-name': None},
 'title': {'title': {'value': 'Ecological traits and range size determine the occurrence of non-native fish species in a Neotropical floodplain'},
  'subtitle': None,
  'translated-title': None},
 'external-ids': {'external-id': [{'external-id-type': 'doi',
    'external-id-value': '10.1007/s10530-022-02974-5',
    'external-id-normalized': {'value': '10.1007/s10530-022-02974-5',
     'transient': True},
    'external-id-normalized-error': None,
    'external-id-url': {'value': 'https://doi.org/10.1007/s10530-022-02974-5'},
    'external-id-relationship': 'self'}]},
 'url': {'value': 'https://doi.org/10.1007/s10530-022-02974-5'},
 'type': 'journal-article',
 'publication-date': {'year': {'value': '2022'},
  'month': {'value': '12'},
  'day': {'value': '20'}},
 'journal-title': {'value': 'Biological Invasions'},
 'visibility': 'public',
 'path': '/0000-0002-2109-9738/work/125041690',
 'display-index': '0'}

import jsonpath_rw as jpr

jpr.parse("$..'host'").find(data).value
# return 'orcid.org'

but

jpr.parse("$..'source-client-id'").find(data).value
## nothing return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant