Skip to content

Some workout columns should be float, not text #12

@simonw

Description

@simonw

Columns duration, totalDistance and totalEnergyBurned should be converted to float.

def workout_to_db(workout, db, zipfile=None):
record = dict(workout.attrib)
# add metadata entry items as extra keys
for el in workout.findall("MetadataEntry"):
record["metadata_" + el.attrib["key"]] = el.attrib["value"]
# Dump any WorkoutEvent in a nested list for the moment
record["workout_events"] = [el.attrib for el in workout.findall("WorkoutEvent")]
pk = db["workouts"].insert(record, alter=True, hash_id="id").last_pk

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions