I have a record in a field in the database with this format:

```
'(1, 7.0), (2, 2.0), (3, 3.0), (4, 4.0), (5, 7.0), (6, 6.0), (7, 8.0), (8, 5.0)'

```

That comes as a string, I need to convert the 1st position to an `int` and the 2nd position to a `float`, then do something like this:

```py
OrderedDict(sorted(d.items(), key=lambda x:x[1], reverse=True))

```

and sort the results.

Any ideas on how to convert this `str` value into a `dict` so the final result looks like this?

```
OrderedDict([(7: 8.0), (5: 7.0), (1: 7.0), (6: 6.0), (8: 5.0), (4: 4.0), (3: 3.0), (2: 2.0)])

```