Skip to content

Instantly share code, notes, and snippets.

@hansonkd
Last active January 16, 2017 15:15
Show Gist options
  • Save hansonkd/2ba2b5921f05f26d9aa2bd4db4abdc15 to your computer and use it in GitHub Desktop.
Save hansonkd/2ba2b5921f05f26d9aa2bd4db4abdc15 to your computer and use it in GitHub Desktop.
books = get_book_row_generator_from_csv('mybooks.csv')
formatted_books = (
conduit(books)
.map(Book.from_row)
.filter(lambda book: book.year >= 1950)
.sort(lambda book: (book.year, book.author_name.lower()))
.map('{0.title} | {0.author} ({0.year})'.format)
.to_list()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment