ImportError: No module named 'medleydb.sql'
Also the command :
pip install -e .[sql]
gives the following:
medleydb 1.2.9 does not provide the extra 'sql'
although the medleydb gets installed fine by this command and medleydb can be imported without any error. Further the command
medleydb-export
gives the following error:
bash: medleydb-export: command not found
My OS is Centos 6.4 and Python version is 3.5.2.
@Kaustubhk12 thanks for reporting this. I deprecated the sql submodule. Where did you see it in the current version of the api? Is it in the docs somewhere?
It is there in conftest.py
import medleydb.sql as m
def session(medleydb): _session = m.session(ephemeral=True) m.from_medleydb(_session, limit=2) return _session
Also if the existing code uses session as follows:
session = medleydb.sql.session() stems = session.query(medleydb.sql.model.Stem).all()
then exactly how can it be done now without medleydb.sql ?
Or could you please make medleydb.sql module available, may be with a deprecation warning, so that those who want to use that module for existing code can use it.
Any solutions regarding how can I find medleydb.sql and use medleydb.sql.session(). Or any alternatives to medleydb.sql.session() ?
Hey @Kaustubhk12 sorry for the delay.
There's no easy way to bring back the sql api without doing a fairly big rewrite. If you need it you can roll back to the version of the code where it existed. In general though, all of the search capabilities of the sql submodule can be done in python through the current api. Is there functionality missing from the current api that was in the sql api?
Could you please explain in short how each functionality of medleydb.sql API can be performed in the new medleydb API? For example, how to retrieve all the stems. That guidance from your side would be very helpful. Please reply at your earliest convenience.
On Tue, May 30, 2017 at 8:57 PM, Rachel Bittner [email protected] wrote:
Hey @Kaustubhk12 https://github.com/kaustubhk12 sorry for the delay.
There's no easy way to bring back the sql api without doing a fairly big rewrite. If you need it you can roll back to the version of the code where it existed. In general though, all of the search capabilities of the sql submodule can be done in python through the current api. Is there functionality missing from the current api that was in the sql api?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/marl/medleydb/issues/77#issuecomment-304914963, or mute the thread https://github.com/notifications/unsubscribe-auth/AXenY6QZRYH4IHNUtmF6UdSwEjNlYPJBks5r_DVIgaJpZM4NBdo7 .
In general you can refer to the documentation. For example to retrieve all the stems for a given multitrack and print their instrument you can do:
import medleydb as mdb
mtrack = mdb.MultiTrack('MusicDelta_Beethoven')
for key, stem in mtrack.stems.items():
print("This is stem # {}".format(key))
print(stem.instrument)