Sometimes when you're coding you want to quickly group some data together without creating an entire class, which keeping your code easy to read. A good way to do this is collections.nametuple.

import collections 
 
Book = collections.namedtuple('Book', ('title', 'price')) 
Coffee = collections.namedtuple('Coffee', ['roast', 'price']) 
Notebook = collections.namedtuple('Notebook', 'type price')

Namedtuples consist of a name and names for attributes, which can be listed in (among other ways) a List, Tuple, or even a String separated by spaces! Their use is simple.

In [2]: b = Book('48 Laws of Power', 24.99)                                     

In [3]: b                                                                       
Out[3]: Book(title='48 Laws of Power', price=24.99)

In [4]: b.title                                                                 
Out[4]: '48 Laws of Power'

In [5]: b.price                                                                 
Out[5]: 24.99

Like other objects in python, namedtuples can be created with a dict.

arguments = {'type': 'moleskin', 'price': 10.00}
In [17]: n = Notebook(**arguments)                                              

In [18]: n                                                                      
Out[18]: Notebook(type='moleskin', price=10.0)