Skip to content

ped4747/pyensae

 
 

Repository files navigation

README

Links:

Description

This project contain helpers used at the ENSAE for teaching purposes. The project is hosted here on github: github/pyensae, on pypi: pypi/pyensae. It requires github/pyquickhelper.

The main function is used to download data used for my teachings at the ENSAE from the website xavierdupre.fr:

download_data("td8_velib.zip", website = "xd")

The second functionality is the ability to import a text file into a SQLite database:

import_flatfile_into_database("sqlitedb.db3", "flat_file.txt")

The last function is about getting stock prives from Yahoo Finance :

stock = StockPrices( "BNP.PA", folder = "temp" )

To draw a graph with multiple stock prices:

stocks = [ StockPrices ("BNP.PA", folder = cache),
            StockPrices ("CA.PA", folder = cache),
            StockPrices ("SAN.PA", folder = cache), ]
fig, ax, plt = StockPrices.draw(stocks)
fig.savefig("image.png")

# or 

fig, ax, plt = StockPrices.draw(stocks, begin="2010-01-01")
plt.show()  

Dependencies

For the class StockPrices <finance.astock.StockPrices>:
The ASSHClient <pyensae.remote.remote_connection.ASSClient> requires:

Contributions

Started in 2013/08.

  • First contributor: Xavier Dupré.
  • Others contributors: ENSAE's students.

Versions

  • 0.9.1 - 2014/??/??
    • add: add magic command %tail_stderr for AzureClient <pyensae.remote.azure_connection.AzureClient>
    • add: add magic command for SQLite3
  • 0.9 - 2014/11/03
    • add: Python version is now checked, ImportError is raised if it used on Python 2
    • add: option -local to %jobsubmit
    • add: add magic command and methods to enable a shell from a notebook (a kind of putty) (command %open_remove_shell, ...)
    • new: function parse_code <pyensae.languages.antlr_grammar_use.parse_code> parses a script in R, PIG, SQLite syntax and checks if there is any mistake, it requires antlr4
    • new: new class AzureClient <pyensae.remote.azure_connection.AzureClient> to handle some basic needs with Azure
    • add: add magic command and methods to handle Azure from a notebook
  • 0.8 - 2014/10/24
    • add: add method copy_to <pyensae.sql.database_main.Database.copy_to> to copy every table from a database to another one
    • fix: class Database <pyensae.sql.database_main.Database> can now handle in memory database
    • add: functions to decompress files, see decompress_helper <pyensae.decompress_helper>
    • change: function download_data <pyensae.resources.http_retrieve.download_data> now works with files .zip, .gz, .tar.gz
    • new: add class ASSHClient <pyensae.remote.remote_connection.ASSClient> to communicate with a remote SSH connection (it uses paramiko)
    • new: add magic command to use ASSHClient <pyensae.remote.remote_connection.ASSClient> in a notebook (%remote_open, ...)
  • 0.7 - 2014/08/24
    • fix: fix an unexpected zero length column in import_flatfile_into_database <pyensae.sql.database_helper.import_flatfile_into_database>
    • add: add parameter add_key to function import_flatfile_into_database <pyensae.sql.database_helper.import_flatfile_into_database> to add a primary key
    • fix: improve behavior of import_flatfile_into_database <pyensae.sql.database_helper.import_flatfile_into_database>, it is more robust to not so clean flat files

About

teaching materials in python at the ENSAE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.7%
  • ANTLR 3.1%
  • Shell 0.2%