蠎加载 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

蠎加载 79

原文: Import Python Weekly Newsletter - Issue No 79 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 2016 年启动的10大最美 Django 项目 django One of the cornerstones of Django is that there’s a solid core that others can extend and share their extensions. So it’s good to celebrate the best of those. Here’s my list derived from this query on Github for projects started this year. Not sure about top but useful projects that one can use in personal or work projects/products. Have a look. (是也乎: 各种轮子,,, ) Python 编程幽默 humour Conversation with Tech Support. (是也乎: 关乎技术支持 ) Django 生产力增压 django These design patterns also solidified a mentality within our team that there is an internal standard of handling models and views. We can extend our base classes to tackle any business requirement. Our codebase is constantly evolving, both in new features and how we model the world. Django has proven to be a valuable tool that lets us aim big and iterate often. Some might call this an anti-pattern nevertheless a novel approach. (是也乎: 模式与反模式 ) 结合 Python Celery + RabbitMQ 分发任务 celery In this tutorial, we are going to have an introduction to basic concepts of Celery with RabbitMQ and then set up Celery for a small demo project. At the end of this tutorial, you will be able to setup a Celery web console monitoring your tasks. Python 为孩纸的项目 - 书评 book review That’s it :) … Go read the review. (是也乎: 亮点都在评论树中了… ) Python 2.7.12 发布 release The Python 2.7.x series has a new bugfix release, Python 2.7.12, available for download. Djangorecipe: 简单的测试覆盖率报告 django Code coverage reports help you see which parts of your code are still untested. Yes, it doesn’t say anything about the quality of your tests, but at the least it tells you which parts of your code have absolute the worst kind of tests: those that are absent :-) 你的 Django 故事: 遇见 Anna Makarudze interview Anna Makarudze lives in Harare, Zimbabwe, and was born and raised in Masvingo. She is an an ICT consultant as well as a Python/Django developer. anymail/django-anymail: Django的邮件后端以及 webhooks 接入 Mailgun, Postmark, SendGrid, SparkPost 等等 django Anymail integrates several transactional email service providers (ESPs) into Django, with a consistent API that lets you use ESP-added features without locking your code to a particular ESP. It currently fully supports Mailgun, Postmark, SendGrid, and SparkPost, and has limited support for Mandrill. 专注挖掘Twitter数据的七大系列文章 twitter Note these articles were published a year back, currently trending on social media. Curating it because it’s pretty interesting and fun. 用 Python 探索 NFL Draft sport analysis After reading a couple of posts by Michael Lopez about the NFL draft, I decided to recreate some of his analysis using Python (instead of R). Post being - https://statsbylopez.com/2016/05/02/the-nfl-draft-where-we-stand-in-2016/ (是也乎: 没用 R ;-) ) 文本分析,马尔可夫链和圣经引用生成器. machine learning Text analysis and patterns are very interesting topics for me. I think every author has their own unique, distinctive pattern. The way they build sentences and phrases, not only in terms of tone, but the subconscious choices of word pairings and sequences. How their sentences begin and end, and what they put in the middle; they leave their cerebral fingerprints on paper, blog posts or even FaceBook status updates. I think it is a very achievable, having enough base data, to identify the author Note - It’s a trivial example but a good starting point for someone looking to learn/explore Markov chains. (是也乎: ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-07-02 · 3 min · 1021 words · ZoomQuiet