Saravanan666/pypi-org huggingface dataset:
Package: ipython2cwlmosorio
IPython2CWLIPython2CWL is a tool for convertingIPythonJupyter Notebooks toCWL (Common Workflow Language)Command Line Tools by simply providing typing annotation.fromipython2cwl.iotypesimportCWLFilePathInput,CWLFilePathOutputimportcsvinput_filename:'CWLFilePathInput'='data.csv'withopen(input_filename)asf:csv_reader=csv.reader(f)data=[lineforlineincsv_reader]number_of_lines=len(data)result_file:'CWLFilePathOutput'='number_of_lines.txt'withopen(result_file,'w')asf:f.write(str(number_of_lines))IPython2CWL is based onrepo2docker, the same tool
used bymybinder. Now, by writing Jupyter Notebook and publishing them, including repo2docker
configuration, the community can not only execute the notebooks remotely but also to use them as steps in scientific
workflows.Installpip install ipython2cwlExamplejupyter repo2cwl https://github.com/giannisdoukas/cwl-annotated-jupyter-notebook.git -o .Docshttps://ipython2cwl.readthedocs.io/Demohttps://github.com/giannisdoukas/ipython2cwl-demo
Package: ipython-agnoster
IPython Agnoster (aka IPster) is a hipster theme for the IPython REPL.
It was designed to provide a consistent terminal experience aroundAgnoster Zsh themefork.IPster is optimized for people who use:Solarized colorscheme;Unicode-compatible fonts.For GNOME GNU/Linux users, I highly recommend GNOME Terminal + Solarized dark + DejaVu Sans Mono Nerd.For KDE GNU/Linux users, I highly recommend Konsole +Solarized Dark+ DejaVu Sans Mono Nerd.For Mac users, I highly recommend iTerm 2 + Solarized Dark.With some extra hassle this theme works on Windows too.InstallationForIPython>=5.0install the package:pip install -U pip setuptools  # update environment markers support
pip install ipython-agnosterForIPython>=0.11,<5.0clone the repository and copy theipstermodule to the extensions directory (deprecated):git clone --depth=1 https://github.com/i5ar/ipster.git
cd ipster
cp -r ipster "$HOME/.ipython/extensions"ConfigurationOnce the module is installed you need to configure it.Edit your configuration file~/.ipython/profile_default/ipython_config.py:## Use 24bit colors instead of 256 colors in prompt highlighting.
c.TerminalInteractiveShell.true_color = True

## Set the color scheme (NoColor, Neutral, Linux, or LightBG).
c.InteractiveShell.colors = 'Linux'

##
c.InteractiveShell.separate_in = ''ForIPython>=5.0only add the following lines:from ipster.since_5 import IPsterPrompts, IPsterStyle

c.TerminalInteractiveShell.prompts_class = IPsterPrompts

highlighting_ipstyle = IPsterStyle().overrides_linux()
c.TerminalInteractiveShell.highlighting_style_overrides = highlighting_ipstyleForIPython>=0.11,<5.0only add the following lines (deprecated):from pygments.token import Token

# Define prompt colors
style_overrides_linux = {
    Token.IPsterPromptVirtualenv: 'bg:#859900 #073642',
    Token.IPsterPowerlinePromptVirtualenv: 'bg:#073642 #859900',
    Token.Prompt: 'bg:#073642 #839496',
    Token.PromptNum: 'bg:#073642 #859900 bold',
    Token.OutPrompt: 'bg:#073642 #839496',
    Token.OutPromptNum: 'bg:#073642 #dc322f bold',
    Token.IPsterPowerlinePrompt: '#073642',
    Token.IPsterPromptSpace: '#839496',
}

# Override prompt colors
c.TerminalInteractiveShell.highlighting_style_overrides = style_overrides_linux

# Load extension
c.InteractiveShellApp.extensions = [
    'ipster.post_0_11'
]CompatibilityTmuxTrue color support must be enabled in the configuration file~/.tmux.conffor Solarized colorscheme to work properly:# Override screen 256 color with true color
set-option -ga terminal-overrides ",xterm-256color:Tc"If this fix doesn’t work your version of Tmux is probably too old.RoadmapWhen usingIPython
shortcutsfor Vi mode, the current mode indication might be very helpful. It would
be great if IPster could show in a right prompt the Vi mode.ContributeSuggestions and pull requests are welcome.ExtrasIf you already use Powerline for IPython, install the IPster theme under
theextrasdirectory, please.TODOVi mode detection in theright
prompt;
Package: ipython-animated-array
render animated array on ipython-notebook (jupyter)Installpip installipython-animated-arrayDocumentModuleipython_animated_arrayClassipython_animated_array.AnimateArrayconstructor__init__(viz_list,cmap='cool')viz_list: list of animating array(1d or 2d).cmap=’cool’:color map
nameAnimateArray Instance Methodanimate_array.show(refresh=1000)Show animate array.refresh=1000refresh animation duration(ms).Exampleopenexample
directoryvia your ipython-notebook (or jupyter-notebook).LicenseMIT
Package: ipython-autoimport
Automagically import missing modules in IPython: instead ofIn [1]: plt.plot([1, 2], [3, 4])
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-994ba2bf13c0> in <module>()
----> 1 plt.plot([1, 2], [3, 4])

NameError: name 'plt' is not defined

In [2]: from matplotlib import pyplot as plt

In [3]: plt.plot([1, 2], [3, 4])
Out[3]: [<matplotlib.lines.Line2D at 0x7f73f0179198>]do what I mean:In [1]: plt.plot([1, 2], [3, 4])
Autoimport: from matplotlib import pyplot as plt
Out[1]: [<matplotlib.lines.Line2D at 0x7f7e253552b0>]Inspired from @OrangeFlash81’sversion, with many
improvements:Does not rely on re-execution, but instead hooks the user namespace; thus,
safe even in the presence of side effects, and works for tab completion and
magics too.Learns your preferred aliases from the history –pltis not hardcoded to
aliasmatplotlib.pyplot, just found because you previously importedpyplotunder this alias.Suppresses irrelevant chained tracebacks.Auto-imports submodules.pip-installable.To see auto imports from the current session:%autoimport-lTo clear the cache for a symbol with multiple possible imports:%autoimport-cSYMBOLInstallationAs usual, install using pip:$pipinstallipython-autoimport# from PyPI$pipinstallgit+https://github.com/anntzer/ipython-autoimport# from GithubThen, append the output ofpython-mipython_autoimportto theipython_config.pyfile in the directory printed byipython profile locate(typically~/.ipython/profile_default/).If you don’t have such a file at all, you can useipython profile create.Run tests withpytest.LimitationsConstructs such asclass C:
   auto_imported_valuewill not work, because they are run using the class locals (rather than the
patched locals); patching globals would not work becauseLOAD_NAMEqueries
globals usingPyDict_GetItemexactly (note that it queries locals usingPyObject_GetItem; also,LOAD_GLOBALSqueriesbothglobals and
builtins usingPyObject_GetItemso we could possibly get away with patching
the builtins dict instead, but that seems a bit too invasive…).When using Jedi autocompletion (the default if Jedi is installed as of IPython
7.2), trying to tab-complete not-yet-imported global names to trigger an import
fails, because Jedi purposefully converts the global dict to a namespace
object and looks up attributes usinggetattr_static.  Jedi can be disabled
by addingc.Completer.use_jedi = Falseto theipython_config.pyfile.
Package: ipython-autotime
ipython-autotimeTime everything in IPythonInstallation:$pipinstallipython-autotimeExamplesIn[1]:%load_extautotimetime:264µs(started:2020-12-1511:44:36+01:00)In[2]:x=1time:416µs(started:2020-12-1511:44:45+01:00)In[3]:x/0---------------------------------------------------------------------------ZeroDivisionErrorTraceback(mostrecentcalllast)<ipython-input-3-034eb0c6102b>in<module>---->1x/0ZeroDivisionError:divisionbyzerotime:88.7ms(started:2020-12-1511:44:53+01:00)Want to turn it off?In[4]:%unload_extautotime
Package: ipython-autotime-pst
ipython-autotime-pstTime everything in IPythonInstallation:$pipinstall-ihttps://pypi.org/projectipython-autotime-pstExamplesIn[1]:%load_extautotimetime:264µs(started:2020-12-1511:44:36+07:00)In[2]:x=1time:416µs(started:2020-12-1511:44:45+07:00)In[3]:x/0---------------------------------------------------------------------------ZeroDivisionErrorTraceback(mostrecentcalllast)<ipython-input-3-034eb0c6102b>in<module>---->1x/0ZeroDivisionError:divisionbyzerotime:88.7ms(started:2020-12-1511:44:53+07:00)Want to turn it off?In[4]:%unload_extautotime
Package: ipython-beautifulsoup
IPython-BeautifulSoupIPython-BeautifulSoup is an IPython extension for displaying
BeautifulSoup HTML/XML objects as prettified and syntax highlighted HTML
blocks in IPython notebook and qtconsole.Syntax highlighting is accomplished withPygments.InstallSimply run:pip install "ipython-beautifulsoup[bs4]"Installing IPython NotebookSee theIPython installation
docsfor
details.To install IPython notebook or qtconsole as well, appendnotebookand/orqtconsoleto the extras specifier after “bs4” separated by a
“,”, like this:pip install "ipython-beautifulsoup[bs4,notebook,qtconsole]"On Ubuntu LTS, if you want to installIPython notebook, you’ll need
to do this before:sudo apt-get install python-dev g++(usepython3-devif you’re using Python 3)For theqtconsoledo this (if you do this in a virtualenv) (WARNING:
it’s slow):sudo apt-get install make cmake qt4-qmake libqt4-dev
pip install pysideUsageIn IPython notebook or qtconsole, run:%load_extsoupThis will push a series of callables into your current context, as well
as a monkey-patchedBeautifulSoupandrequests.You can now use BeautifulSoup like you would if it was imported from the
corresponding module.There is great chances that you’ll want to configure the output by usingconfigure_ipython_beautifulsoup, for example like this (just after
the%load_ext):configure_ipython_beautifulsoup(show_html=True, show_css=True, show_js=False)To seeconfigure_ipython_beautifulsoupdocumentation just do (in any
interface of IPython):configure_ipython_beautifulsoup?This also loads a shortcut function calledp(for Parse) defined as
follows:defp(url):ifrequestsisnotNone:returnBeautifulSoup(requests.get(url).contents)returnBeautifulSoup(urlopen(url).read())A note on securityWARNINGBy nature of including external HTML, JS, and CSS, this extension is
inherently unsafe if you choose to render the html by setting
show_html to True when calling``configure_ipython_beautifulsoup``.By default,<script>,<link>, and<style>tags are
removed but this isn’t a 100% guarantee that this is secure if you
choose to render the html, use at your own risk.The safest option is to set all options ofconfigure_ipython_beautifulsouptoFalse(the default).ScreenshotsIPython Notebook.find:.find_all:ContributorsIn chronological order:Astalaseven- pull request:#1westurner- pull request:#3MattDMo- pull request:#5Don’t hesitate to add yourself.Changelog0.3 (2014-08-26)python 3 compatibilityclassifiers in the setup.pyand a series of small fixesalso: wheel!mainly the work of Matt Morrison, seehttps://github.com/Psycojoker/ipython-beautifulsoup/pull/50.2 (2014-01-06)security improvement (configure_ipython_beautifulsoup)tests!mostly the work of westurner, seehttps://github.com/Psycojoker/ipython-beautifulsoup/pull/30.1.1 (2014-01-04)bug fixes0.1 (2014-01-04)Init
Package: ipython-bg
ipython-bgUse%bgto run line in backgroundUse%%bgto run cell in backgroundUse%jobsto view all background jobsUse%killto try to kill a thread - only works if thread runs python codeHow to load extensionIn [1]: %load_ext ipython_bg%bg - run line in backgroundIn [2]: %bg run_this_command_in_background = 1
[1] running in background

[job completed] run_this_command_...%%bg - run cell in backgroundIn [3]: %%bg 
   ...: run_this_cell_in_background = 1 
   ...: more_lines = "yes, more lines." 
   ...:  
   ...:

[2] running in background

[job completed] run_this_cell_in_...%jobs - view all background jobsIn [4]: %jobs
jobs:
[1] start=22:49:50, code=run_this_command_..., completed, finished=22:49:50, took=0:0
[2] start=22:50:13, code=run_this_cell_in_..., completed, finished=22:50:13, took=0:0

In [5]: print(run_this_command_in_background, run_this_cell_in_background, more_lines)
1 1 yes, more lines.%kill - try to kill a threadIn [6]: %%bg 
   ...: import time 
   ...: time.sleep(5) 
   ...: print("this won't be printed :(") 
   ...: time.sleep(100000) 
   ...:

[3] running in background

In [7]: %kill 3
[job killed] import time...
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/Users/drorspei/.pyenv/versions/3.6.10/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Users/drorspei/.pyenv/versions/3.6.10/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/drorspei/src/ipython-bg/ipython_bg/__init__.py", line 19, in runjob
    exec(code, ipython.user_ns)
  File "<string>", line 2, in <module>
KeyboardInterrupt
Package: ipythonblocks
ipythonblocksis a teaching tool for use with theIPythonNotebook.
It provides aBlockGridobject whose representation is an HTML table.
Individual table cells are represented byBlockobjects that have.red,.green, and.blueattributes by which the color of that cell can be
specified.ipythonblocksallows students to experiment with Python flow control concepts
and immediately see the effects of their code represented in a colorful,
attractive way.BlockGridobjects can be indexed and sliced like 2D NumPy
arrays making them good practice for learning how to access arrays.See these demo notebooks for more on usingipythonblocks:Practicing with RGBBasic usagewith explanationsFun examplesAnimationImageGridGoing from aJPEG to BlockGridand textA programaticfirework animationUsing ipythonblocks.orgInstallipythonblockscan be installed withpip:pip install ipythonblocksHowever, the package is contained in a single.pyfile and if you prefer
you can just grabipythonblocks.pyand copy it to wherever you
want to use it (useful for packaging with other teaching materials).DependenciesRequired dependencies:Python>= 2.7IPythonOptional dependencies:requests>= 1.0 (for posting and getting to/fromipythonblocks.org)Pillow(for creating images)Testing dependencies:pytest>= 2.3, (for the test suite, see below)responses>= 0.1mock(dependency of responses)Demo dependencies:PIL(forstarry_night_to_text.ipynb)TestingThe test suite is written usingpytest, so you can run the test suite
with:py.test
Package: ipython-cells
ipython-cellsIPython extension for executing cells Jupyter-style in .py files.  Supports Jupyter and Spyder cell syntax.Brings the advantages of linear, selective-execution during development to IPython without the bloat of Jupyter.QuickstartInstall the extensionpip install ipython-cellsIn IPython:>>>%load_extipython_cells>>>%load_fileexample.py>>>%cell_run1hello>>>%cell_run2worldexample.py# %% cell1print('hello')# %% cell2print('world')Other Features%load_fileexample.py# list available cells for running%list_cells['__first','cell1','cell2']# run all cells from beginning of file to cell2 (inclusive)%cell_run^cell21011# run all cells from cell1 (inclusive) to end of file%cell_runcell1$1213Automatically Load ExtensionTo load extension on IPython start, add this to~/.ipython/profile_default/ipython_config.pyc.InteractiveShellApp.extensions=['ipython_cells']Autoreloading# load example.py with autoreloading%load_fileexample.py%cell_runcell110# example.py is modified by an external editor (e.g. `a = 10`  ->  `a = 20`)# File change is detected and automatically reloaded%cell_runcell120Auto reloading can be disabled with%load_file example.py --noreloadCell Delimiter SyntaxCells are delimited by special comments.  Both Jupyter and Spyder style cells are supported.  Below are different variations of a cell calledfoobar_cell.# %% foobar_cell# In[foobar_cell]# %% foobar_cell some extra text# In[foobar_cell] some extra textRunning Exported Jupyter NotebooksThis extension can run exported Jupyter notebooks. (File > Download As > python (.py)).Be sure to run all cells before exporting so they are assigned an index. (Cell > Run All).Testscd tests
ipython3 tests.py
Package: ipython-cluster-helper
Quickly and easily parallelize Python functions using IPython on a
cluster, supporting multiple schedulers. Optimizes IPython defaults to
handle larger clusters and simultaneous processes.ExampleLets say you wrote a program that takes several files in as arguments
and performs some kind of long running computation on them. Your
original implementation used a loop but it was way too slowfromyourmoduleimportlong_running_functionimportsysif__name__=="__main__":forfinsys.argv[1:]:long_running_function(f)If you have access to one of the supported schedulers you can easily
parallelize your program across 5 nodes with ipython-cluster-helperfromcluster_helper.clusterimportcluster_viewfromyourmoduleimportlong_running_functionimportsysif__name__=="__main__":withcluster_view(scheduler="lsf",queue="hsph",num_jobs=5)asview:view.map(long_running_function,sys.argv[1:])That’s it! No setup required.To run a local cluster for testing purposes passrun_localas an extra
parameter to the cluster_view functionwithcluster_view(scheduler=None,queue=None,num_jobs=5,extra_params={"run_local":True})asview:view.map(long_running_function,sys.argv[1:])How it worksipython-cluster-helper creates a throwaway parallel IPython profile,
launches a cluster and returns a view. On program exit it shuts the
cluster down and deletes the throwaway profile.Supported schedulersPlatform LSF (“lsf”), Sun Grid Engine (“sge”), Torque (“torque”), SLURM (“slurm”).CreditsThe cool parts of this were ripped frombcbio-nextgen.ContributorsBrad Chapman (@chapmanb)Mario Giovacchini (@mariogiov)Valentine Svensson (@vals)Roman Valls (@brainstorm)Rory Kirchner (@roryk)Luca Beltrame (@lbeltrame)James Porter (@porterjamesj)Billy Ziege (@billyziege)ink1 (@ink1)@mjdellwo@matthias-kAndrew Oler (@oleraj)Alain Péteut (@peteut)Matt De Both (@mdeboth)Vlad Saveliev (@vladsaveliev)
Package: ipython-ctrlr-fzf
Add fzf-powered ctrl+r to ipythonAdd fzf-powered ctrl+r to ipython. It's nice.InstallationYou must have fzf installed for this to work:# macosbrewinstallfzf# linuxapt-getinstallfzfI'd also recommend installingbatfor syntax highlighting. It's detected and an advanced preview is shown when available.Then, install the extension:pipinstallipython-ctrlr-fzfAnd in ipython, load the extension:%load_extipython_ctrlr_fzfAlternatively, you can add the output of the following to youripython_config.py:python-mipython_ctrlr_fzfInspirationhttps://stackoverflow.com/questions/48203949/backward-search-in-ipython-via-fzfhttps://github.com/anntzer/ipython-autoimportTODOunderstand when prompt toolkit is not used in ipython
Package: ipython-cypher
Author:Javier de la Rosa,http://versae.esIntroduces a%cypher(and%%cypher) magic for Neo4j in IPython.
Inspired by Catherine Devlin’sipython-sql.Connect to a graph database, usingneo4jrestclient_driver, then issue Cypher
commands within IPython or IPython Notebook. Seeexamples.InstallAs easy as usual:pip install ipython-cypherUsageInside IPython, load the extension:%load_ext cypherAnd then you are reay to go by using the%cypherline magic:%cypher MATCH (a)-[]-(b) RETURN a, bSome Cypher queries can be very long, in those cases the the cell magic,%%cyphercomes in handy:%%cypher
create
    // Nodes
    (Neo:Crew {name:'Neo'}),
    (Morpheus:Crew {name: 'Morpheus'}),
    (Trinity:Crew {name: 'Trinity'}),
    // Relationships
    (Neo)-[:KNOWS]->(Morpheus),
    (Neo)-[:LOVES]->(Trinity),Note that by defaultipython-cypherwill connect tohttp://localhost:7474/db/data.Queries results can be stored in a variable and then converted to a PandasDataFrame:results = %cypher MATCH (a)-[]-(b) RETURN a, b
results.get_dataframe()Or to a NetworkXMultiDiGraph:results.get_graph()For more detailed descriptions, please visit the officialdocumentation.News0.2.6Release date: 25-Mar-2018Fix issue with handling of connections aliases.Fix issue with NetworkX 2.x new syntax (node and edge properties, drawing).0.2.5Release date: 20-Dec-2017Fix issue with newer versions of NetworkX.0.2.4Release date: 10-Dec-2016Update imports.0.2.3Release date: 22-Sep-2015Bugfixes for Python 3.0.2.2Release date: 22-Apr-2015Fixed error withconnwhen executing Cypher outside of IPython.0.2.0Release date: 20-Feb-2015Added documentation.Added option to run Cypher queries outside IPythonAdded a better graph plot algorithm for matplotlib.0.1.0Release date: 17-Nov-2014First public release ofipython-cypher
Package: ipython-dawet-sql
Ipython ODBC SQL MagicIPython Magic untuk menjalankan SQL menggunakan ODBC secara langsung pada notebook cell.Pemasangan$pip3installipython-dawet-sqlPenggunaanLoad EkstensiUntuk dapat menggunakan, ekstensi harus diloadterlebih dahulu ke notebook yang sedang digunakan.In [ ]: %load_ext dawetsqlDatabase ConnectionMembuka KoneksiIn [ ]: %dawetsqlSetelah line magic dieksekusi, selanjutnya isi form sesuai dengan konfigurasi ODBC. Username dan password optional jika sudah diset di konfigurasi ODBC sistem.Untuk me-restart koneksi, cukup klikconnect,dawetsqlakan otomatis menutup koneksi terlebih dahulu sebelum membuka koneksi baru lagi.Menutup KoneksiIn [ ]: %dawetsqlcloseMenjalankan SQLIn [ ]: %%dawetsql
        SELECT * FROM tables
        WHERE somecolumn = 'somevalue'Preview hasil query ditampilkan menggunakanpandas.DataFramedengan default limit 10 baris.Available argumentsArgumentsTypeDefaultDescriptions-l --limitInteger10Set limit query untuk preview-o --outputString_Nama output hasil query.Contoh PenggunaanMenyimpan Hasil query ke Python VariableIn [ ]: %%dawetsql --ouput variablename
        SELECT * FROM tables
        WHERE somecolumn = 'somevalue'Menyimpan Hasil Query ke FileCell Magic%%dawetsqlakan otomatis menyimpan hasil query kedalam file jika nama output memiliki ekstensi.csv,.pkl, dan.xlsxIn [ ]: %%dawetsql --output filename.csv
        SELECT * FROM tables
        WHERE somecolumn = 'somevalue'Akses Python Variable dari SQL QueryUntuk mengakses variable dari local namespace, gunakan format?namavariablesebagai placeholder pada SQL Query. Tanda petik (') akan otomatis ditambahkan jika tipe variable bukanintataufloat.In [1]: low = 1
        high = 100
        other_column_name = "something"pada magic cellIn [2]: %%dawetsql
        SELECT 
            *
        FROM
            TABLE
        WHERE
            SOME_COLUMN BETWEEN ?low AND ?high
            AND OTHER_COLUMN = ?other_column_nameSQL Query akan dikonversi menjadiSELECT 
    *
FROM
    TABLE
WHERE
    SOME_COLUMN BETWEEN 1 AND 100
    AND OTHER_COLUMN = 'something'WidgetsSchema Explorer WidgetWidget ini digunakan untuk meng-explore skema, tabel, kolom, dan tipe kolom pada database.%explorer [-f --force]Table DetailQuery BuilderTable Data PreviewSettingsFile konfigurasidawetsqltersimpan pada direktori~/.dawetsql.Lain-lainSQL AutocompleteCell magic%%dawetsqlmendukung SQL Autocomplete. Fitur ini masih bersifat eksperimental. Autocomplete untuk nama tabel dan kolom tersedia setelah pengguna menjalankan magic%explore. Untuk pengguna lama, jalankan%explorer -f, lalu restart notebook.LegalPackage ini dirilis di bawah lisensi MIT.
Package: ipython-db
idbipython [db.py](https://github.com/yhat/db.py) shell extension.Databases Supported
===PostgreSQLMySQLSQLiteRedshiftMS SQL ServerOracleInstalluse github:In [1]: %install_exthttps://raw.githubusercontent.com/dongweiming/idb/master/idb.pyIn [2]: %load_ext idbgit clonehttps://github.com/dongweiming/idbcd idb
python setup.py installuse pip:pip install ipython-db
In [1]: %load_ext idbUsageYou can see this example ipynb:http://nbviewer.ipython.org/github/dongweiming/idb/blob/master/examples/db-example.ipynb