.. _magiccommandsaboutfilesrst: ========================== Magic commands about files ========================== .. only:: html **Links:** :download:`notebook `, :downloadlink:`html `, :download:`PDF `, :download:`python `, :downloadlink:`slides `, :githublink:`GitHub|_doc/notebooks/magic_commands_about_files.ipynb|*` Use of magic commands implemented by *pyensae*. .. code:: ipython3 %load_ext pyensae from pyensae.sql import Database .. code:: ipython3 %lsr .*[.]ipynb .. raw:: html
directory last_modified name size
0 False 2016-11-09 23:35:42.656229 .\azure_blob_storage.ipynb 33.91 Kb
1 False 2016-11-09 23:35:42.667238 .\example_corrplot.ipynb 203.16 Kb
2 False 2016-11-09 23:35:42.683248 .\example_of_ssh_client_communication.ipynb 199.06 Kb
3 False 2016-11-09 23:35:42.695257 .\folium_map.ipynb 17.60 Kb
4 False 2017-01-07 18:38:26.725089 .\magic_commands_about_files.ipynb 15.37 Kb
5 False 2016-12-28 23:04:00.646329 .\pyensae_flat2db3.ipynb 72.66 Kb
6 False 2016-12-28 23:04:00.681589 .\pyensae_sql_magic.ipynb 71.64 Kb
7 False 2016-11-09 23:35:42.728279 .\pyensae_StockPrices.ipynb 488.76 Kb
8 False 2016-12-28 23:04:00.747517 .\pyensae_text2table.ipynb 25.68 Kb
9 False 2016-11-09 23:35:42.770842 .\pyensae_velib.ipynb 300.54 Kb
10 False 2016-11-09 23:35:42.778852 .\python_hadoop_pig.ipynb 57.73 Kb
11 False 2016-11-09 23:35:42.784856 .\using_qgrid_with_jsdf.ipynb 6.71 Kb
12 False 2016-12-28 23:04:00.827547 .\view_differences.ipynb 49.39 Kb
13 False 2016-12-28 23:04:00.838553 .\.ipynb_checkpoints\magic_commands_about_file... 26.17 Kb
14 False 2016-12-28 23:04:00.915596 .\.ipynb_checkpoints\pyensae_flat2db3-checkpoi... 72.66 Kb
15 False 2016-12-28 23:04:00.931221 .\.ipynb_checkpoints\pyensae_sql_magic-checkpo... 71.64 Kb
16 False 2016-12-28 23:04:00.961358 .\.ipynb_checkpoints\pyensae_text2table-checkp... 25.68 Kb
17 False 2016-12-28 23:04:00.984509 .\.ipynb_checkpoints\view_differences-checkpoi... 49.39 Kb
.. code:: ipython3 %head --help .. parsed-literal:: usage: head [-h] [-n N] [-r] [-e ENCODING] [-s ERRORS] f display the first lines of a text file positional arguments: f filename optional arguments: -h, --help show this help message and exit -n N, --n N number of lines to display -r, --raw display raw text instead of HTML -e ENCODING, --encoding ENCODING file encoding -s ERRORS, --errors ERRORS What about errors: "", strict, replace, surrogateescape, xmlcharrefreplace, backslashreplace, namereplace usage: head [-h] [-n N] [-r] [-e ENCODING] [-s ERRORS] f .. code:: ipython3 %hhelp Database.__init__ .. raw:: html

constructor

param dbfile:
 

database file (use :memory: to avoid creating a file and using only memory) it can also contain several files separated by ;:

name_file ; nickname,second_file ; ...
    
param engine:
 

SQLite or MySQL (if it is installed)

param user:
 

user if needed

param password:
 

password if needed

param host:
 

to connect to a MSSQL database

param LOG:

LOG function

param attach:
 

dictionary: { nickname: filename }, list of database to attach

Warning

If the folder does not exist, it will be created

.. code:: ipython3 %hhelp -f text Database.__init__ .. parsed-literal:: constructor @param dbfile database file (use ``:memory:`` to avoid creating a file and using only memory) it can also contain several files separated by ; @code name_file ; nickname,second_file ; ... @endcode @param engine SQLite or MySQL (if it is installed) @param user user if needed @param password password if needed @param host to connect to a MSSQL database @param LOG LOG function @param attach dictionary: { nickname: filename }, list of database to attach @warning If the folder does not exist, it will be created .. code:: ipython3 %encoding pyensae_sql_magic.ipynb .. parsed-literal:: "{'confidence': 1.0, 'encoding': 'ascii'}"