mirror of
https://github.com/josephmisiti/awesome-machine-learning.git
synced 2025-01-01 22:23:19 +03:00
Merge pull request #113 from bohemia420/master
automating + pip install at once + writing package names to a text file
This commit is contained in:
commit
c156bfaf2a
@ -7,10 +7,11 @@
|
||||
|
||||
from pyquery import PyQuery as pq
|
||||
import urllib
|
||||
import codecs
|
||||
|
||||
|
||||
text_file = codecs.open("Packages.txt",encoding='utf-8',mode="w")
|
||||
d = pq(url='http://cran.r-project.org/web/views/MachineLearning.html',opener=lambda url, **kw: urllib.urlopen(url).read())
|
||||
index = 0
|
||||
|
||||
for e in d("li").items():
|
||||
package_name = e("a").html()
|
||||
package_link = e("a")[0].attrib['href']
|
||||
@ -18,6 +19,7 @@ for e in d("li").items():
|
||||
package_link = package_link.replace("..",'http://cran.r-project.org/web')
|
||||
dd = pq(url=package_link,opener=lambda url, **kw: urllib.urlopen(url).read())
|
||||
package_description = dd("h2").html()
|
||||
print "* [%s](%s) - %s" % (package_name,package_link,package_description)
|
||||
text_file.write(" [%s](%s) - %s \n" % (package_name,package_link,package_description))
|
||||
# print "* [%s](%s) - %s" % (package_name,package_link,package_description)
|
||||
|
||||
index += 1
|
||||
index += 1
|
||||
|
3
scripts/requirements.txt
Normal file
3
scripts/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
pyquery
|
||||
urllib3
|
||||
codecs
|
Loading…
Reference in New Issue
Block a user