Skip to content

Add new feature to allow changes/additions to the fetched and parsed JSON dict #38

Closed
@kevinjwalters

Description

@kevinjwalters

It's useful in some cases to be able to do some post processing on the returned JSON object. This could be achieved with an optional argument called something like json_transforms allowing the PyPortal object to be created with a function or a list of functions which run over the JSON dict object from the parsed HTTP response body. These could be allowed to modify or add values to the dict which could then be picked up by the usual image_json_path mechanism.

For the case of the NASA viewer code (Adafruit Learn: PyPortal NASA Image of the Day Viewer) as there is no support for video at the moment it would be useful to be able to deal with the odd occasion when this returns a YouTube video URL and turn that into a URL with a single still image. For discussion on the problem, see Adafruit Forums: Not getting actual images from NASA Image Viewer (pyportal)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions