Possible?: Dynamically read CSV files in a folder into unique object variables for checkbox app use

Hey all,

Originally I posted this as a reply to another thread I had but I feel this is more of a new topic.

Some progress was made with my check-box multi-line time series app but I thought I’d ask a question. As Khalid (KK) posted in a previous example, there is a way to make multi-linbe time series plots with toggling check-boxes. SEE: http://stackoverflow.com/questions/30720511/checkboxes-to-show-hide-lines-in-bokeh-stock-data-moving-average. Is there a way to make this work for n-amount of CSV files in a folder? Each CSV file will have the same data structure but the number of CSV files will be changing so we want to make this as dynamic as possible.

EXAMPLE: Let’s say I have 8 CSV files in a folder and I want to create a bokeh-server app that creates 8 respective check-boxes which plots the respective CSV data in the time series figure window. Currently in KK’s code, it looks like a static number of check-box names exist, e.g. [“Closes”,“MVA_1”,“MVA_2”]. There are also a static number of obj.source variables (e.g. obj.source, obj.source2, obj.source3). I assume each check-box will be associated with one of these object variables.

My question and issue is, unlike KK’s code, how can we make these object variables dynamic so that each respective source variable is associated with a respective CSV file name? I was thinking of using dictionaries but I am afraid this wont satisfy the need for unique object variables within the create(cls) function.

Thanks for any help,

Let me know of any questions you have,

Cheers