蠎加载 83

原文: Import Python Weekly Newsletter - Issue No 83 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Raymond Hettinger - 并发的思考 (Pycon RU 2016) video Walk through two examples of threading and multiprocessing to illustrate rules and best practices for taking advantage of concurrency. Documentation and code from the presentation is here - https://dl.dropboxusercontent.com/u/3967849/pyru/_build/html/index.html (是也乎: 俄国PyCon! ) 又一个 Python 来搞掂的故事 ~ 用类定义构建 DSL core python We didn’t invent a new DSL, we merely adapted Python’s existing syntax to our needs. A simple class structure and a metaclass definition gave us everything we needed to build the configuration parameter files we needed. 用 Python 构建 slackbot 从而帮助自己找到 SF 的公寓 bot Scrapes listings from Craigslist. Filter out listings that don’t match our criteria. Post the listings to Slack, a team chat tool, so we can discuss and rate them. Wrap the whole process into a persistent loop and deploy it to a server (so it would run continuously). Built by Vik Paruchuri - https://twitter.com/vikparuchuri (是也乎: 其实还是对 Craigslist 进行搜索,只是控制界面变成了 Slack; 嗯哼?! 为了上班不被人发现在刷房源?! ) 每天 mypy. 第三部分 mypy Earlier this year PEP-484 was accepted, the typing module was added to Python 3.5, and mypy moved into the umbrella of official python projects. Since it was a visible topic at the last Pycon.us, I decided to get some experience with it and see how it feels to use it. I decided I’d take a working, mature, open-source project that wasn’t written by me and “convert” it to mypy. Note this is a 3 part series with a follow up. Have a look at the latest post here - http://www.machinalis.com/blog/writing-type-stubs-for-numpy/ (是也乎: 细思恐极, PEP-484 已被接受?! 意思是 py3 为了性能,已经放弃动态语言这一特性了!? ) 登记开始: Django Under the Hood 2016 ! conference Based on the videos I have watched this is a must Go ( if you can that’s ) Django Conference. A. Jesse Jiryu Davis 对话 “撰写一个优秀的编程 Blog” podcast Michael Kennedy ( guy behind the TalkPython Podcast ) and I talked about writing about programming. What kind of writing is most valuable, how do you choose a topic, improve your writing, find an audience, and find the time to write? Listen to the podcast on the Talk Python To Me site. Django 页面加速速度 django Django and Python tips and tricks on how to improve website page load times by optimizing images. words2map: 用 word2vec, t-SNE 以及 HDBSCAN 构建的推荐框架来加强 overlap.ai At overlap.ai we’re building artificial intelligence to unite people through their overlapping passions, and here we introduce a framework we call words2map for considering what our users love, like these personal passions of ours. Github repo - https://github.com/overlap-ai/words2map (是也乎: 又一个推荐服务的框架 ) 用 Python 进行 Pizza 计数 security I’m a full time nerd, even when I’m ordering pizza online I can’t stop myself from investigating how the websites I’m ordering from work. My latest investigation was Dominoes where I found a neat way to count the number of orders that they process throughout the day. This post is supposed to highlight potential dangers when exposing integer ID’s, and how they can allow someone motivated (or sad) enough to track data you might not want to share. Simple Python Code to find it out has been shared. (是也乎: 对电商的又一个私人研究实践… ) 用 Django 和 D3 构建仪表盘 — dreisbach.us django, Django Rest Framework, d3 My workplace recently collaborated with several police departments to build a dashboard showing 911 (also known as Call for Service) data, allowing users to drill down into that data. When I started on the project, there was a prototype written in dc.js, a JavaScript framework for building dynamic dashboards with all the data on the frontend, built around records from Tampa, FL. I needed to take this and make it capable of handling much more data – millions of records. I took on the task of building this using Django and D3. Along the way, I found a set of tools that worked for me. 当周 PyDev 之星 : Nicholas Tollervey interview This week we welcome Nicholas Tollervey (@ntoll) as our PyDev of the Week. He is the author of the Python in Education booklet and the co-author of Learning jQuery Deferreds: Taming Callback Hell with Deferreds and Promises. He was one of the co-founders of the London Python Code Dojo. You should check out his website to see what he’s up to. Let’s spend some time learning more about our fellow Pythonista! (是也乎: 伦敦 Python Code Dojo, 代码道场! ) 基本 Django 的 uWSGI 配置 django Here are two basic examples of almost the same uWSGI configuration to run a Django project; one is configured via an ini configuration file and the other is configured via a command line argument. This does not represent a production-ready example, but can be used as a starting point for the configuration. 活动 ~ Upcoming Conference / User Group Meet ...

2016-07-29 · 3 min · 1310 words · ZoomQuiet

蠎加载 82

原文: Import Python Weekly Newsletter - Issue No 82 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 对100万酒店进行机械学习后有趣的发现 On this tutorial we learned how to scrape millions of reviews, analyze them with pre-trained classifiers within MonkeyLearn, indexed the results with Elasticsearch and visualize them using Kibana. Machine learning makes sense when you want to analyze big volumes of data in a cost effective way. The code repository is here - https://github.com/monkeylearn/hotel-review-analysis (是也乎: 以 tripadvisor 为数据源! 也就是说这世界上部分信息早已经开放了… ) Mike Driscoll: Python 进阶: 介绍 mock The unittest module now includes a mock submodule as of Python 3.3. It will allow you to replace portions of the system that you are testing with mock objects as well as make assertions about how they were used. A mock object is used for simulating system resources that aren’t available in your test environment. In other words, you will find times when you want to test some part of your code in isolation from the rest of it or you will need to test some code in isolation from outside services. (是也乎: 除非实在难以架构, 否则尽可能使用真实测试对象吧 ) Altair: 声明式 Python 统计可视化库, 基于 Vega-Lite pep8 Altair is a declarative statistical visualization library for Python. (是也乎: 基于 Pandas 的数据表 ) 又7个 Django Web 开发应知应会 django Set up Persistent Database Connections, Turn Cached Loading on, Store the Sessions in Cache, Keep the Application and Libraries Separate, Store All Templates in One Place, Install HTML5 Boilerplate, Monitor and Control Processes using Supervisor. (是也乎: 随着 Django 的高速发展, 这类最佳实践将是永无止境的 ) DSF 发布开发行为守则 community Today we’re proud to open source the documentation that describes how the Django Code of Conduct committee enforces our Code of Conduct. This documentation covers the structure of Code of Conduct committee membership, the process of handling Code of Conduct violations, our decision making process, record keeping, and transparency. 为毛 Python 中有些行为函式就是不用下刬线? 比如: setdefault, makedirs, isinstance? discussion I always wondered that. Here is a reddit discussion on the same. (是也乎: 因为作者当初睡着了… ) 如何用Python 写一个能写 Python 的 AI AI This post is about creating a machine that writes its own code. More or less. Introducing GlaDoS Skynet Spynet. More specifically, we are going to train a character level Long Short Term Memory neural network to write code itself by feeding it Python source code. The training will run on a GPU instance on EC2, using Theano and Lasagne. If some of the words here sound obscure to you, I will do my best to explain what is happening. (是也乎: 简单的说, 这就是 西乔 的 beta cat 的构建方法 ) 用 Flask-RESTful 写个 API REST This article will go over the details of how to create a RESTful API with Flask and Flask-RESTful. In Part 1 we will go over the API basics and how to implement a simple API. In Part 2 we will expand into advanced use cases powered by Flask-RESTful. All code that will be show is readily available on this repository. (是也乎: 虽然 Flask 比 Django 轻便很多倍,但是,依然… ) SciPy 2016 视频已经放 video Running Python Apps in the Browser by Almar Klein was a pretty interesting talk for me. See what interest you. Youtube channel. (是也乎: 如何在 浏览器 中运行 Py 应用!?这个视频值得关注. ) 如何构建自制 Django Middleware django In a nutshell, a Middleware is a regular Python class that hooks into Django’s request/response life cycle. Those classes holds pieces of code that are processed upon every request/response your Django application handles. Mike Driscoll: 介绍 coverage.py coverage Coverage.py is a 3rd party tool for Python that is used for measuring your code coverage. It was originally created by Ned Batchelder. The term “coverage” in programming circles is typically used to describe the effectiveness of your tests and how much of your code is actually covered by tests. You can use coverage.py with Python 2.6 up to the current version of Python 3 as well as with PyPy. (是也乎: 虽然没收入官方内建库, 但 coverage.py 已经是事实上最常用的覆盖测试模块 ) Django 的 Ajax 网站教程 django In this tutorial we’ll see a trivial example of how to do a ajax website with django. Good for students looking to learn the basics of Django/Ajax and see how it works. 订阅 Gitter 上 Python & Django 频道吧. community Gitter is like slack for developers. They have active Python, Django channels. Have a look. 介绍 Zipline Python has emerged as one of the most popular language for programmers in financial trading, due to its ease of availability, user-friendliness and presence of sufficient scientific libraries like Pandas, NumPy, PyAlgoTrade, Pybacktest and more. Zipline is a Python library for trading applications that powers the Quantopian service mentioned above. It is an event-driven system that supports both backtesting and live-trading. In this article we will learn how to install Zipline and then how to implement Moving Average Crossover strategy and calculate P&L, Portfolio value etc. (是也乎: 可能是最好的股票交易管理平台 ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-07-22 · 4 min · 1536 words · ZoomQuiet

蠎加载 81

原文: Import Python Weekly Newsletter - Issue No 81 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… AWS 无服务微框架 Python 版本预览 aws Serverless computing is one of the most talked-about subjects among AWS customers. The AWS serverless offerings, AWS Lambda and Amazon API Gateway, make it possible for developers to create and run API applications with built-in, virtually unlimited scalability without managing any servers. Today the AWS Developer Tools team is excited to announce the preview of the Python Serverless Microframework for AWS. You can read Martin Fowler talking about the benefits of Serverless architecture http://martinfowler.com/articles/serverless.html#benefits (是也乎: Google 推出了 firebase, AWS 当然要加强 Lambda 的概念. 果断给出了更加易用的 无服务微框架 ) Python 的逆向调试 pypy The PyPy team is pleased to give you “RevPDB”, a reverse-debugger similar to rr but for Python. (是也乎: PyPy 团队赛高 ) Facebook 笑话机械人的 django 教程 chatbots I have decided to try to develop a chat bot which does only one thing. Send a random joke like the below one without an image irrespective of what the user types 书评: “探挖两勺 Django: Django 1.8 的最佳实践” book review The book can be used as a reference of best practices and a cover-to-cover guide to best practices. I’ve done both and found it to be enjoyable, accessible, and educational when read cover-to-cover and a valuable reference when setting up a new Django project or doing general Django development. It covers a huge range of material. 再推 Spectrum - 独立日志服务器. Review Spectrum is a standalone logging server plus log viewer with filtering capabilities. It scales to multiple logging streams with endpoint being a file residing on filesystem, REST API endpoint, Syslog, UDPStream, WebSocketStream. 构建第一个 Django 应用 tutorial Decent tutorial to get people started with Python and Django. 用 Docker 构建异步 Py3 无服务应用 serverless I will show you a simple way to build a “serverless” application and test it via Docker. When I refer to “serverless” I’m referring to the idea that the application is a short lived app, does its job, stops – just like AWS Lambda. I will create two applications each in their own project folders: serverless-app and serverless-web The serverless-app piece is the actual “serverless” piece of this, the web app will run as long as we want. I just gave them similar names to make it easier to keep the projects named closely but different enough to know what does what. (是也乎: AWS 配套软文, 好在入华了, 可用,只是北京节点不一定有. ) djangobot: 通过 Channels 桥接 Slack 和 Django bot Djangobot is a bridge between Slack and a Channels-enabled Django app. Specifically, it is a protocol server that produces and consumes messages for channels-based apps. It is built atop autobahn and twisted. 可视化 Python 包间关系 pypi I extracted co-occurence of top 3500 python packages in github repos using the the github data on BigQuery. I implemented the visualization force layout in d3 via the velocity verlet integration. I also clustered the graph using algorithms from python-igraph and updated it to http://graphistry.com/. (是也乎: Why not 类型小工程,将 github 中能抓到的 3500 个 Py 包的关系绘制了出来! ) 用 Py 在 PNG 文件中当众隐藏有效数据 security How could I store files online, in plain sight, for free. Because who doesn’t like a good ‘ol game of hide and seek. But with files. On the internet. Hide files in plain sight. Allow them to be distributed via free public channels. E.g Twitter, Reddit, imgur. (是也乎: 公开的图床一样可以走秘密数据; 代码在: Don’t be a punk, punk 居然能不影响 MD5 ! ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-07-15 · 3 min · 1302 words · ZoomQuiet

蠎加载 80

原文: Import Python Weekly Newsletter - Issue No 80 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Spectrum 使用 - Python 构建的独立日志服务. Review on Import Python Blog. importpython Spectrum is to logging what sqlite3 is to databases. It’s a standalone logging server plus log viewer with filtering capabilities. It scales to multiple logging streams with endpoint being a file residing on filesystem, REST API endpoint, Syslog, UDPStream, WebSocketStream. This blogpost shows how to use spectrum and wraps up with pros and cons. Have a read. (是也乎: 能接入当前所有主要日志后端的独立服务, 内置过滤器. ) Django 开发者快讯 - Djangoweekly.com Launched. django Djangoweekly.com is a weekly newsletter dedicated to Django. The first issue is already out. Have a look. Python 为毛慢 ? benchmark In case you missed it, Marius recently wrote a post on the Pyston blog about our baseline JIT tier. Our baseline JIT sits between our interpreter tier and our LLVM JIT tier, providing better speed than the interpreter tier but lower startup overhead than the LLVM tier. There’s been some discussion over on Hacker News, and the discussion turned to a commonly mentioned question: if LuaJIT can have a fast interpreter, why can’t we use their ideas and make Python fast? This is related to a number of other questions, such as “why can’t Python be as fast as JavaScript or Lua”, or “why don’t you just run Python on a preexisting VM such as the JVM or the CLR”. Since these questions are pretty common I thought I’d try to write a blog post about it. (是也乎: 又一篇从 JIT 环境角度来分析的文章. 问题是, 明白了, 并不能改变 Py 平台的现状,,, ) 在 Py 中构建自己的 Shell core python I’m curious to know how a shell (like bash, csh, etc.) works internally. So, I implemented one called yosh (Your Own SHell) in Python to answer my own curiosity. The concept I explain in this article can be applied to other languages as well. Note from curator - After graduating from college I interviewed with Yahoo and they had asked me to create one during interview. It’s a good exercise for any computer science student/professional. (是也乎: yosh 作者的心灵自述, 推荐所有计算机专业的学生都来造一把好轮子. ) MongoFrames - 轻快而不招摇的 MongoDB ODM mongodb A five minute walk-through of MongoFrames’ key features and how to start using them. 科学 Python 介绍– Pandas pandas Pandas allows us to deal with data in a way that us humans can understand it; with labelled columns and indexes. It allows us to effortlessly import data from files such as csvs, allows us to quickly apply complex transformations and filters to our data and much more. It’s absolutely brilliant. This is the third post in this series on scientific Python and take a look at Pandas. Don’t forget to check out the other posts if you haven’t yet! (是也乎: 数据科学领域 Python 是一重镇, Pandas 则是其中无法忽视的不将 ) 教程: 用 Docker Swarm 复用部署 Py3 应用 docker Today, I want to show you how to use Docker Swarm and then deploy a simple Python Falcon REST app. Although I won’t be using dockerrun or the serverless capabilities I think you might be surprised how easy it is to deploy (replicated) Python applications (actually any sort of application: Java, Go, etc.) with Docker Swarm. (是也乎: 一个具体的 Falcon REST 应用, 通过 Docker 如何快速部署运行, 其实相同的操作可以用以部署 JAVA/Go/… 等等任何语言应用系统 ) Allen Downey - 让 贝叶斯 统计更加简单 - PyCon 2016 statistics An introduction to Bayesian statistics using Python. Bayesian statistics are usually presented mathematically, but many of the ideas are easier to understand computationally. People who know Python can get started quickly and use Bayesian analysis to solve real problems. This tutorial is based on material and case studies from Think Bayes (O’Reilly Media). Say What ? api This script listens to meetings I’m supposed to be paying attention to and pings me on hipchat when my name is mentioned. It sends me a transcript of what was said in the minute before my name was mentioned and some time after. It also plays an audio file out loud 15 seconds after my name was mentioned which is a recording of me saying, “Sorry, I didn’t realize my mic was on mute there.” Uses IBM’s Speech to Text Watson API for the audio-to-text. (是也乎: 基于 IBM Watson 的接口,完成的 hipchat 插件, 可以监听所有关于自己的语音事件. ) Pendulum - Python datetimes made easy Handle datetimes, timedeltas and timezones in a more natural fashion. Pendulum provides a cleaner and more easy to use API while still relying on the standard library. So it’s still datetime but better. (是也乎: 又一个人性化的时间/日期处理模块 ) EuroPython 2016: 最后一天可以获得定款门票了 pycon We will be switching to the on-desk rates for tickets tomorrow, so today is your last chance to get tickets at the regular rate, which is about 30% less than the on-desk rate. The Python/Django 社区超赞! ? community Experience with the Djangogirls community. 活动 ~ Upcoming Conference / User Group Meet ...

2016-07-08 · 3 min · 1350 words · ZoomQuiet