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

Access to a nested element from a "Path" #287

Open
yellowbean opened this issue Dec 13, 2023 · 0 comments
Open

Access to a nested element from a "Path" #287

yellowbean opened this issue Dec 13, 2023 · 0 comments

Comments

@yellowbean
Copy link

yellowbean commented Dec 13, 2023

There is a Path-alike : ['articles', ny, 'content'] in the transform function.

very_short_news = news_paper.transform(['articles', ny, 'content'], lambda c: c[:15] + '...' if len(c) > 15 else c)

Could we have something Path-alike to Query elements

news_paper.query(['articles', ny, 'author']) == ['Sara', 'Steve']

the list can be easily built and compose to other type of path points to elements of interest

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