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

Implement pretty printing for complex objects #104

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alin23
Copy link

@alin23 alin23 commented Dec 9, 2017

Transforms outputs like this:

message:   Keeping your Saturday going!
playlists: {"href": "https://api.spotify.com/v1/browse/featured-playlists?timestamp=2017-12-09T19%3A51%3A44&offset=0&limit=1", "items": [{"collaborative": false, "external_urls": {"spotify": "https://open.spotify.com/user/spotify/playlist/37i9dQZF1DX0A8zVl7p82B"}, "href": "https://api.spotify.com/v1/users/spotify/playlists/37i9dQZF1DX0A8zVl7p82B", "id": "37i9dQZF1DX0A8zVl7p82B", "images": [{"height": 300, "url": "https://i.scdn.co/image/b34e37ba62e27a53694016f5fe48ae22043e12f6", "width": 300}], "name": "Christmas Pop", "owner": {"display_name": "Spotify", "external_urls": {"spotify": "https://open.spotify.com/user/spotify"}, "href": "https://api.spotify.com/v1/users/spotify", "id": "spotify", "type": "user", "uri": "spotify:user:spotify"}, "public": null, "snapshot_id": "/5WhdLgOW3hFx5rlzQWguGsDmkZXoOrBkUwxN3HZ2HMolz7/rTFHZHxxFP+5Gn0VCH1TtLTY5M8=", "tracks": {"href": "https://api.spotify.com/v1/users/spotify/playlists/37i9dQZF1DX0A8zVl7p82B/tracks", "total": 120}, "type": "playlist", "uri": "spotify:user:spotify:playlist:37i9dQZF1DX0A8zVl7p82B"}], "limit": 1, "next": "https://api.spotify.com/v1/browse/featured-playlists?timestamp=2017-12-09T19%3A51%3A44&offset=1&limit=1", "offset": 0, "previous": null, "total": 24}

into this:

message:   Keeping your Saturday going!
playlists: 
  href:     https://api.spotify.com/v1/browse/featured-playlists?timestamp=2017-12-09T19%3A52%3A35&offset=0&limit=1
  items:    
    
      collaborative: False
      external_urls: 
        spotify: https://open.spotify.com/user/spotify/playlist/37i9dQZF1DX0A8zVl7p82B
      href:          https://api.spotify.com/v1/users/spotify/playlists/37i9dQZF1DX0A8zVl7p82B
      id:            37i9dQZF1DX0A8zVl7p82B
      images:        [{"height": 300, "url": "https://i.scdn.co/image/b34e37ba62e27a53694016f5fe48ae22043e12f6", "width": 300}]
      name:          Christmas Pop
      owner:         
        display_name:  Spotify
        external_urls: 
          spotify: https://open.spotify.com/user/spotify
        href:          https://api.spotify.com/v1/users/spotify
        id:            spotify
        type:          user
        uri:           spotify:user:spotify
      public:        None
      snapshot_id:   /5WhdLgOW3hFx5rlzQWguGsDmkZXoOrBkUwxN3HZ2HMolz7/rTFHZHxxFP+5Gn0VCH1TtLTY5M8=
      tracks:        
        href:  https://api.spotify.com/v1/users/spotify/playlists/37i9dQZF1DX0A8zVl7p82B/tracks
        total: 120
      type:          playlist
      uri:           spotify:user:spotify:playlist:37i9dQZF1DX0A8zVl7p82B
  limit:    1
  next:     https://api.spotify.com/v1/browse/featured-playlists?timestamp=2017-12-09T19%3A52%3A35&offset=1&limit=1
  offset:   0
  previous: None
  total:    24

@dbieber
Copy link
Member

dbieber commented Dec 11, 2017

Thanks for your contribution. I'll post back here once I've had a chance to look in more detail.
For now, I notice the travis checks are failing for Python 2.7, 3.4, and 3.5 (but passing for 3.6).

@alin23
Copy link
Author

alin23 commented Dec 12, 2017

Thanks for looking into it @dbieber !
I fixed the tests and the linting errors.

@dzimine
Copy link

dzimine commented Apr 4, 2018

@dbieber or other Fire lovers, can you please take this in? Looking for it.

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

Successfully merging this pull request may close these issues.

3 participants