Skip to content

Instantly share code, notes, and snippets.

View ischurov's full-sized avatar

Ilya V. Schurov ischurov

View GitHub Profile
@ischurov
ischurov / getnames.py
Last active December 12, 2015 09:07
Get all page titles for pages in some category in Wikipedia (presently, names of all personalias are requested from ruwiki)
import requests
url = "https://ru.wikipedia.org/w/api.php"
query = {'action':'query',
'list':'categorymembers',
'cmtitle':'Категория: Персоналии по алфавиту',
'cmstartsortkeyprefix':'А',
'format':'json',
'cmlimit':500
}
@ischurov
ischurov / ruarticle.tplx
Last active August 29, 2015 14:15
Template for creating pdfs from ipynb (based on latex_article.tplx). Depends on hse-coursedata.sty which contains data about the particular course
%custom IPython Notebook / NBConvert template
%based on latex_article.tplx from ipython notebook
%modified by Ilya V. Schurov <ilya at schurov.com>
%license: BSD-like (see http://ipython.org/ipython-doc/stable/about/license_and_copyright.html for details)
% Default to the notebook output style
((* if not cell_style is defined *))
((* set cell_style = 'style_ipython.tplx' *))
((* endif *))
@ischurov
ischurov / mkmk-ipynb.py
Created February 8, 2015 12:21
creates a makefile to convert all ipynb-files to html and pdf
import glob
import re
import os.path
import sys
published_dir=sys.argv[1] if len(sys.argv)>1 else "published"
ipynb=glob.glob("*.ipynb")
bns=map(lambda f: os.path.splitext(f)[0], ipynb)