Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2@file 

3@brief Example of databases 

4""" 

5from .data_helper import any_local_file 

6 

7 

8def anyfile(name, local=True, cache_folder="."): 

9 """ 

10 Returns any file in sub folder 

11 `data_sql <https://github.com/sdpython/ensae_teaching_cs/tree/master/src/ensae_teaching_cs/data/data_sql>`_. 

12 

13 @param name file to download 

14 @param local local data or web 

15 @param cache_folder where to cache the data if downloaded a second time 

16 @return text content (str) 

17 """ 

18 return any_local_file(name, "data_sql", cache_folder=cache_folder, filename=True) 

19 

20 

21def simple_database(name="World.db3", local=True, cache_folder="."): 

22 """ 

23 Returns a simple database. 

24 See :func:`ensae_teaching_cs.data.datasql.anyfile` to 

25 directly download it. 

26 

27 @param name filename 

28 @param local local data or web 

29 @param cache_folder where to cache the data if downloaded a second time 

30 @return text content (str) 

31 """ 

32 return anyfile(name, local=local, cache_folder=cache_folder)