-
$ pip install haxor-news $ haxor-news haxor> hn top haxor> hn show 20
-
keyword : wrapper,extending,binding,calling,integrating,embedding,python,c++
-
$ pip install scrapy
-
$ pip install you-get $ you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
-
$ pip install --upgrade youtube-dl
-
httpie:interact-with-webserver-using-CLI
$ pip install --upgrade httpie $ http baidu.com submitting $ http -f POST example.org hello=World uploading $ http example.org < file.json downloading $ http example.org/file > file $ http --download example.org/file .....
-
$ pip install homeassistant $ pip install xml2dict $ hass --open-ui http://192.168.0.8:8123
-
import itchat itchat.auto_login() author = itchat.search_friends(nickName='田')[0] author.send('greeting, littlecoder!')
-
email
-
import gmail from gmail import Gmail g = gmail.login(username, password)
-
from mailthon import postman, email p = postman(host='smtp.outlook.com', auth=('username', 'password')) r = p.send(email( content=u'<p>Hello 世界</p>', subject='Hello world', sender='Pi<[email protected]>', receivers=['[email protected]'])) assert r.ok
-
-
import pyautogui import time pyautogui.position() while True: time.sleep(0.1) pyautogui.click(15,42)
-
Amazon
-
files with specific pattern in a folder
glob.glob(subpath_+'\\*'+pattern+'*.j*pg')
-
files including one-sub-dir or not
glob.iglob(subpath_+'\\**\\' + '*'+category+'*.j*pg', recursive=True)
-
magic-wormhole:file-send-receiver
$ pip install magic-wormhole sender$ wormhole send README.md Sending 7924 byte file named 'README.md' On the other computer, please run: wormhole receive Wormhole code is: 7-crossover-clockwork receiver$ wormhole receive Enter receive wormhole code: 7-crossover-clockwork Receiving file (7924 bytes) into: README.md ok? (y/n): y
-
$ pip install maybe
-
howdoi:programming-grammar-check
$ pip install howdoi opening vpn $ howdoi dictionary insert python $ howdoi network test bash
-
$ pip install glances $ pip install pysnmp $ glances
-
thefuck:Auto-Correcting-Command
$ pip install thefuck
-
fire:Automatically-generating-CLIs-from-any-Python-Object
import fire class Calculator(object): """A simple calculator class.""" def double(self, number): return 2 * number if __name__ == '__main__': fire.Fire(Calculator) $ python calculator.py double 10 # 20 $ python calculator.py double --number=15 # 30
-
$ pip install webkit2png webkit2png http://www.google.com/
-
[check-security-state-of-your-PC](https://github.com/chipsec/chipsec
-
speedtest-cli:internet-bandwidth-testing-cmd
$ pip install speedtest-cli $ speedtest-cli
-
pyinstaller : how2exclude : how-to-decrease-exe-size: pandas-conda2pip : pyqt5-exe-making : how-to-exclude
This is the one and only choice for tensorflow-based application distribution and works great. But, you have to install python using brew not anaconda for Mac. $ pyinstaller --onefile --windowed xxx.py # the following code help decreasing pkg size Analysis(..., excludes=['_gtkagg', '_tkagg', 'bsddb', 'curses', 'pywin.debugger', 'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl', 'Tkconstants', 'Tkinter', 'PyQt5','zmq'], ..) # the following code after Analyssi(...) help pandas works while using pyinstaller # it's better to use pip pandas than conda pandas for pkg size. conda pandas needs more than 400MB extra weight. def get_pandas_path(): import pandas pandas_path = pandas.__path__[0] return pandas_path dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"]) a.datas += dict_tree a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries) $ pyinstaller xxx.spec
-
import sys from cx_Freeze import setup, Executable build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} base = None if sys.platform == "win32": base = "Win32GUI" setup( name = "guifoo", version = "0.1", description = "My GUI application!", options = {"build_exe": build_exe_options}, executables = [Executable("guifoo.py", base=base)])
-
$ pipdeptree $ pipdeptree --reverse --packages itsdangerous,gnureadline #$ pip freeze #$ conda env list
- ChatBot
-
WeChat
-
from faker import Faker fake = Faker('en_US') fake.name() # 'Lucy Cechtelar' fake.address() # "426 Jordy Lodge # Cartwrightshire, SC 88120-6700" fake.text() # Sint velit eveniet. Rerum atque repellat voluptatem quia rerum. Numquam excepturi # beatae sint laudantium consequatur. Magni occaecati itaque sint et sit tempore. Nesciunt # amet quidem. Iusto deleniti cum autem ad quia aperiam. # A consectetur quos aliquam. In iste aliquid et aut similique suscipit. Consequatur qui # quaerat iste minus hic expedita. Consequuntur error magni et laboriosam. Aut aspernatur # voluptatem sit aliquam. Dolores voluptatum est. # Aut molestias et maxime. Fugit autem facilis quos vero. Eius quibusdam possimus est. # Ea quaerat et quisquam. Deleniti sunt quam. Adipisci consequatur id in occaecati. # Et sint et. Ut ducimus quod nemo ab voluptatum.
-
from mimesis import Personal from mimesis.enums import Gender person = Personal('en') person.full_name(gender=Gender.FEMALE) person.occupation() templates = ['U_d', 'U-d', 'l_d', 'l-d'] for template in templates: person.username(template=template) Personal('de').full_name() from mimesis import Generic from mimesis.enums import TLDType g = Generic('es') g.datetime.month() g.food.fruit() g.internet.top_level_domain(TLDType.GEOTLD)
-
from cryptography.fernet import Fernet # Put this somewhere safe! key = Fernet.generate_key() f = Fernet(key) token = f.encrypt(b"A really secret message. Not for prying eyes.") token '...' f.decrypt(token) 'A really secret message. Not for prying eyes.'
- [ ] [wsgi](http://wsgi.readthedocs.io/en/latest/frameworks.html)
-
"Django lets you write web apps in Django. TurboGears lets you write web apps in TurboGears. Web.py lets you write web apps in Python." — Adam Atlas $ pip install web.py import web urls = ( '/(.*)', 'hello') app = web.application(urls, globals()) class hello: def GET(self, name): if not name: name = 'World' return 'Hello, ' + name + '!' if __name__ == "__main__": app.run()
-
import spacy nlp = spacy.load('en') doc1 = nlp(u'the fries were gross') doc2 = nlp(u'worst fries ever') doc1.similarity(doc2)
-
newspaper:request+lxml+nltk+jieba
py3$ pip install newspaper3k py2$ pip install newspaper from newspaper import Article url = 'http://fox13now.com/2013/12/30/new-year-new-laws-obamacare-pot-guns-and-drones/' article = Article(url) article.download() article.parse() article.authors article.publish_date article.text article.top_image article.movies article.nlp() article.keywords article.summary from newspaper import fulltext html = requests.get(...).text text = fulltext(html)
-
import pandas as pd import numpy as np from fbprophet import Prophet df = pd.read_csv('../examples/example_wp_peyton_manning.csv') df['y'] = np.log(df['y']) df.head() m = Prophet() m.fit(df)