In [5]:
'''
THIS CELL IS DEDICATED TO GENERATE TALK STUFF
'''
from functools import wraps
from IPython.display import Markdown
def talk_URL():
github_io = 'http://massimo-nocentini.github.io'
print(github_io + '/PhD/skku-aorc-2017/oeistools.html#/')
In [6]:
__AUTHOR__ = ('Massimo Nocentini',
'massimo.nocentini@unifi.it',
'https://github.com/massimo-nocentini/')
__ADVISOR__ = ('prof. Donatella Merlini',
'donatella.merlini@unifi.it')
__INSTITUTE__ = ('Dipartimento di Informatica, Statistica, Applicazioni',
'University of Florence, Italy')
talk_URL()
async/await Python primitives only
In [3]:
!python3.6 ../../src/crawling.py --help
In [9]:
!python3.6 ../../src/crawling.py A000045 A000108 \
--cache-dir=../../src/fetched/
In [10]:
!python3.6 ../../src/crawling.py \
--restart \
--cache-dir=../../src/fetched/
In [4]:
!python3.6 ../../src/crawling.py --cache-dir=../../src/fetched/
In [17]:
!ls ../../src/fetched/
Finally, to see raw json content of a fetched sequence
In [ ]:
!cat <SEQ_JSON_FILE> | python3.6 -m json.tool | less
data sections
In [5]:
!python3.6 ../../src/pprinting.py --help
In [6]:
!python3.6 ../../src/pprinting.py \
--id A000045 \
--cache-dir=../../src/fetched/ \
--comment-filter 'lambda i,c: "Barry" in c' \
--formula-filter 'lambda i,f: i < 5'
In [7]:
!python3.6 ../../src/pprinting.py \
--cache-dir=../../src/fetched/ \
--most-recent ACCESS \
--data-only \
--max-results 3 \
--upper-limit '{"list":10}'
In [8]:
!python3.6 ../../src/pprinting.py \
--query 'pascal triangle' \
--cache-dir=../../src/fetched/ \
--tables-only \
--data-only \
--max-results 2
In [ ]:
!<pprinter command> | less
allows us to use navigation and searching facilities for free ;)
Moreover, any redirection and filtering are allowed:
In [ ]:
!<pprinter command> > my-seq.txt
In [12]:
import pprinting
effectively request A000045 to the OEIS server
In [15]:
result = pprinting.search(id='A000045',
cache_info={'cache_dir':'../../src/fetched'})
from now on, it is possible to filter and pprint without any other delay
In [16]:
result(comment=lambda i,c: i < 4,
formula=lambda i,f: i < 4)
Out[16]:
cross ref sectionnetworkx module
In [8]:
!python3.6 ../../src/graphing.py --help
In [14]:
!python3.6 ../../src/graphing.py \
--cache-dir=../../src/fetched/ \
--graphs-dir=./ \
--layout SPRING \
graph.png
import the figure graph.png in place
In [15]:
from IPython.display import Image
Image("./graph.png")
Out[15]:
cross refs고맙습니다
In [16]:
import this
Compile your Creative Commons license at: https://creativecommons.org/choose/
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.