python - Advices on what kind of structure to use in Python to store music informations
问题描述
I'm working on a Music project, and I'm retrieving informations about artists, but I don't know what shoul be the best structure to use to store the data. I was thinking about a simple DataFrame, but I want to insert informations like number of albums, and for everyone of them, other infos like number of song, genre, year, lyrics of the songs and so on...
My last idea was to work with json, and that's the proposal:
jsondic = {
'artist': 'name',
'genre': 'rock',
'link': 'linksite',
'year': 0000,
'n_album': 10,
'album': {
'title': 'titalbum',
'release': 'releaseyear',
'tracks': {
'id': 1,
'title': 'songtitle',
'lyrics':'boby content of songs'
}
}
}
is that a good idea? can you suggest better ways? maybe faster also in terms of computation capacity, because I estimate to store 10,000 artists (with all the songs and the lyrics)
thank you!
解决方案
- Looks good at the first glance.
- Add code to populate the structure. (this will enable us to test it)
- Add one code to print the structure.
- 10000 is not (assuming you are not string musics). Repeat one single example 10000 times to get initial of perfo? 5.Mobile or desktop app?
推荐阅读
- cucumber - Citrus Framework - 可以从响应中分配 API 调用变量吗?
- javascript - 数字的 toString 存储在哪里?
- angular - 角度ngrx存储错误无法读取未定义的属性“计划”
- data-binding - 使用 DataTable 中的值(整数)在 Datagridview 上显示字符串
- php - 在 PHP 中使用 PUT 请求上传文件
- angular - “可观察”类型上不存在属性“catchError”
>' - javascript - 将一个 div 元素包含在另一个 div 元素中会破坏视差效果
- laravel - 使用 Laravel API 资源对加载的关系进行分页
- tfs - TFS 构建代理更新
- f# - 您如何使用 Seq. 在 F# 中按函数平均以平均一行中的数据,按另一行中的数据分组?