蠎加载 98

原文: Import Python Weekly Newsletter - Issue No 98 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Airflow 实用介绍 video, workflow engine Airflow is a popular pipeline orchestration tool for Python that allows users to configure complex (or simple!) multi-system workflows that are executed in parallel across any number of workers. A single pipeline might contain bash, Python, and SQL operations. With dependencies specified between tasks, Airflow knows which ones it can run in parallel and which ones must run after others. Airflow is written in Python and users can add their own operators with custom functionality, doing anything Python can do. (是也乎: 今年 PyCon 上出现的仙器,多后端/Pythonic 工作流/管道管理平台 ) Python 中时间测试的乐趣和收益 debug I was preparing to push some changes a couple of days ago and as I usually do, I ran the tests. I sat back in my chair as the dots raced across the screen when suddenly I noticed that one of the dots linger. ”OS is probably running some updates in the background or something” I said to myself, and ran the tests again just to be sure. I watched closely as the dots filled the screen and there it was again?—?I have a slow test! (是也乎: Matrix-样 数据观察形式看来是正确的 ) Become a pdb power-user pdb Good Tutorial on using pdb. (是也乎: ..It is not necessary to use pdb all the time 嗯哼,作者都说的很明白,其实大家都清楚,动用 pdb 的情景都是不得不作 接盘侠 时, 面对纠结在一起的代码时,不得不进行的刺探, 因为没有自信自己在看过所有代码,将思想扭曲为当初那位崩溃的程序猿相同状态后, 是否能恢复清明… ) 教程提案还有三周可以提交 pycon Talk proposals will be due on 2017 January 3.Poster proposals will be due on 2017 January 3.Tutorial proposals are due on 2017 November 30. Yes, that’s right — tutorial proposals are due in three weeks. awesome-asyncio async-io, curated list A curated list of awesome Python asyncio frameworks, libraries, software and resources. (是也乎: 是 github 带领中国程序猿重新认识了 awesome 这词儿, 现在最高效的领域技术搜索技巧就是在 github 中搜索 awesome+ 技术名 ) Some thoughts on asynchronous API design in a post-async/await world async-io I’ve recently been exploring the exciting new world of asynchronous I/O libraries in Python 3 – specifically asyncio and curio. These two libraries make some different design choices. This is an essay that I wrote to try to explain to myself what those differences are and why I think they matter, and distill some principles for designing event loop APIs and asynchronous libraries in Python. (是也乎: Py3 中内建的 asyncio 和 curio 成为两大焦点都在进行折腾… ) django-flat-responsive django An extension for Django admin that makes interface mobile friendly. 如何在 Python 中启动 Landsat 数据处理? google cloud Cloud Dataflow provides a fully-managed, autoscaling, serverless execution environment for data pipelines written in Apache Beam. In this article Lak Lakshmanan and Matt Hancher show us how to create a monthly vegetation index from Landsat images, available as a public dataset. (是也乎: GCP 中的 Cloud Dataflow 支持 Apache Beam 可以发布无主机数据处理流程… ) 好物 ~ 包/模块/库/片段… ...

2016-11-10 · 3 min · 1226 words · ZoomQuiet

蠎加载 97

原文: Import Python Weekly Newsletter - Issue No 97 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Pyvisgraph - Python 可见性图表 visualization, opensource project This is a super cool project build by Christian. Pyvisgraph builds a visibility graph given a set of simple obstacle polygons and find the shortest path between two points. Christian uses it at work for mapping vessel voyages.( Vessel as in ships ). Here are two blog post by him talking about the algorithm behind his code https://taipanrex.github.io/2016/09/17/Distance-Tables-Part-1-Defining-the-Problem.html and https://taipanrex.github.io/2016/10/19/Distanlogce-Tables-Part-2-Lees-Visibility-Graph-Algorithm.html . (是也乎: 可见性,以往用来寻找可以看见灯塔的安全航线的技术, 现在可以自动完成了. ) Chat bots 以及如何在 Alexa 上构建 chatbots Talking to technology has taken a whole new level since Amazon has announced their voice assistant Alexa and opened up their platform for developers to build custom bots just like when Apple announced about app store for developers to create and sell apps. Here I wanted to talk about the ease of building an Alexa skill using python which could be used as information provider to a attendee for a conference. (是也乎: Amazon 的语音助理 Alexa 平台化后, 当然就可以任性的调教了… ) 6 个快速调试技巧 debugging Nick gives us quick tour of debugging in Python. print statements, logging, pdb, pdb++, Debugging from the REPL and more. (是也乎: 再多的调试技巧,也无法弥补混乱的头脑写出的代码, 所以,亲!最重要的调试技巧就是保持充分的睡眠哪! ) 俺就是整不明白 Python 的 Asyncio async-io Armin Ronacher’s creator of Flask takes at length candidly about How it’s difficult for him to grasp Asyncio , it’s shortcomings, how David Beazley’s live demo hacked up asyncio replacement is twice as fast as it. Curator’s Note - Personally I learned Asyncio from the book Fluent Python. However once I went beyond the simple examples and try building something non trivial I ended up switching to golang and getting my job done faster. One key reason is the benchmark showed my asyncio’s throughput was an order of magnitude slower, code required a lot of hand holding for a new developer. (是也乎: 创造者分享了为什么人们理解了异步都都去用 golang 了… 这真是一个悲伤的故事. ) 避免被 Python 咬屎 core python Common pitfalls to avoid when writing Python software (是也乎: py coding 时常见的错误 ) django-sql-explorer django Easily share data across your company via SQL queries. From Grove Collab. 用 Daphne 部署 Django Channels django channels Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI, and developed to power Django Channels. It supports automatic negotiation of protocols; there’s no need for URL prefixing to determine WebSocket endpoints versus HTTP endpoints. In this blog post Abu Ashraf shows us how to Deploy Django channels using Daphne. (是也乎: Channels 如此重要,又如此难用,所以, Django 创建了: ASGI 协议的专用服务器 Daphne ) 每周聊 Python: Dates 和 Times 在 Python video Let’s chat about working with dates and times in Python! We’ll talk about parsing, formatting, timezones, and date arithmetic. (是也乎: 简单的说,就是心塞,每次总感觉厂商有更加简洁的日期/时间处理手段的,,, 然而… ) Jupyter Notebook 教程 jupyter I want to share some concepts and ideas about using Jupyter Notebook that I would like to know when I started. (是也乎: medium 越来越好用了,所以,也早已被 功夫网 认证了… ) 如何在 Django 管理中追加自制按钮 - By Haki Benita django admin panel In this post Haki Benita shows us how he extended Django admin to include two Button which perform action on a record/row. It’s a well written step by step article to accomplish the task. 将媒体内容从 Linux 折腾到 Chromecast opensource project Are you searching for an easy way to stream media files from your LinuxBox to a Chromecast ? You can use Stream2chromecast, a simple Python script that makes the task of streaming media files to a Chromecast device ridiculously easy. (是也乎: WIDI 世界中,怎么可以少 Python 脚本?! ) Pandas 教程: Python 中的 DataFrames pandas Karlijn has written good article explaning what dataframes is and it’s workings. If you don’t know about Pandas and want to get a sense of what it’s ?, then have a read. 用 Kafka 来构建 Python 中的简单 Job Queue kafka, opensource project KQ (Kafka Queue) is a light-weight Python library which provides a simple API to queue and process jobs asynchronously in the background. It is backed by Apache Kafka and designed primarily for ease of use. (是也乎: KQ 一个专用模块,可以 Pythonic 化的使用 Kafka ) 从 NumPy 榨取更多性能 numpy This is the first featured recipe from the IPython Cookbook, the definitive guide to high-performance scientific computing and data science in Python. (是也乎: 来自 IPython Cookbook 的经典技巧 ) C++ vs. Python vs. PHP vs. Java vs. Others 性能评测 (2016 Q3) benchmark The benchmarks here do not try to be complete, as they are showing the performance of the languages in one aspect, and mainly: loops, dynamic arrays with numbers, basic math operations. (是也乎: 看起来 Py3 已经快过 Py2.7 了… ) Pycon Pune 2017 pycon Pycon Pune 2017 is announced. To be held on February 16-19 2017. Visit the website to know more. (是也乎: 又是一月就开始的…总结去年的当然早点开始好, 但是, PyConChian 的筹备节奏,我们只能程序猿节前后才可能折腾 ) 项目 ~ 包/模块/库/片段… ...

2016-11-05 · 4 min · 1575 words · ZoomQuiet

蠎加载 96

原文: Import Python Weekly Newsletter - Issue No 96 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 搜索所有过往文章 Import Python Newsletters. By Tag, Keywords, Issue No. importpython Hello Subscribers. If you ever want to find an article we curated and don’t rememeber the issue ?. Or you want to find all articles based on a tag/topic e.g. admin panel, PEP etc. Head to http://importpython.com/search/ . Please let us know your feedback / Bug if any. (是也乎: 蠎周刊快速积累到 96 期了,果断官方给出了关键词搜索服务 ) Python 的 iterators 和 iterables 需要相同嘛?! iterator So what are iterators and iterables, and are they distinct? They are distinct. Iterables are classes that implement the iter method, a method which returns an iterator. Iterators are classes that implement the next method (or next in Python 2), which continuously returns the next element until the end. So this begs the question, does an iterable also have to be an iterator? Or does an iterator also have to be an iterable? (是也乎: 命名是艺术也是命运,一个再好的功能,名字起错了, 除了给人留下很多的口水仗机会,对开发只能是种心碍,还是人工的… ) 检查 Django 的所有迁移点. django All of our project are setup with continuous deployment on CircleCI. An occasional source of errors has been caused by missing model migrations because the migration wasn’t committed. There’s a simple solution by adding a migration check before deploying. (是也乎: 随着 Django 的高速发展以及快速流传, 不兼容的升级行为也越来越艺术化, 得配合专门技艺…作死 ) 你有哪些不常见的心爱 projects/notebooks/modules ? opensource project Reddit Discussion where Python developers are sharing their favourite projects/modules. Lot of noise but found python-dependency-injector to be interesting. (是也乎: 挂出来的日子不长,但是 fuckit 的确值得体验…当然只是 linux/mac 党可以体验的了 ) PEP 531 – Existence checking operators PEP Inspired by PEP 505 and the related discussions, this PEP proposes the addition of two new logical operators to Python: i) Existence-checking fallback: expr1 ?else expr2 ii) Existence-checking precondition: expr1 ?and expr2. As well as the following abbreviations for common existence checking expressions and statements i) Existence-checking attribute access: obj?.attr (for obj ?and obj.attr ) ii) Existence-checking subscripting: obj?[expr] (for obj ?and obj[expr] ) iii) Existence-checking assignment: target ?= expr (是也乎: 受到动态的影响,运行时自省不足一定非常难受的, 所以,py 又接受了两种存在检验器 ) 所有 Python 包都能预安装的在线 REPL 环境 – Repl.it REPL At Repl.it, our goal is to make programming more accessible, and as part of this we aim to provide the full power of popular programming environments with no setup time. And no modern programming language is complete without third-party packages. That’s why today we’re making every Python package ever immediately available on repl.it. Just select the language (Python or Python3) and start importing packages. (是也乎: 将整个儿 PyPi 事先都加载到目录中的在线 REPL, 真心脑洞太大了… 问题是俺想基于这种零部署的环境, 发布私人应用呢!? 不过,真心是个好想法… 而且提供20+种开发语言的 REPL ) Mike Driscoll: 用Python和GooPyCharts创建图形 charts I came across an interesting plotting library called GooPyCharts which is a Python wrapper for the Google Charts API. In this article, we will spend a few minutes learning how to use this interesting package. 改进和扩展 pip 的搜索功能 pip The main reason I’m in love with Python is the elegance and beauty of the design the language holds. Why not improve a bit on pip search to match the aesthetics? That’s why I created yip. (是也乎: 已成痛点… ) Python API 客户端和 Tapioca opensource project, API Tapioca is a Python API client maker. It gathers most of the features API clients implement and puts them in an extensible core. Wrappers will then extend this core implementing only the specifics from each service (such as authentication and pagination) and get all the common API client features for free. Tapioca approach also comes in handy because regardless of the service, clients look the same in the way you interact with them. (是也乎: Tapioca 是一个致力于彻底改变 API 开发模式的服务商, 具体点,就是想接管所有互联网 API 的发布… ) 如何编写你自己的 Python 文档生成器? core python Originating from the standard library, inspect not only lets you look at lower level python frame and code objects, it also provides a number of methods for examining modules and classes, helping you find the items that may be of interest. It’s what pydoc uses to generate the help files mentioned previously. (是也乎: 给娇贵的 pydoc 生成可用文档的前置工具 ) 使用 Python Mock 来折腾你的代码 mock I want to share 2 specific use cases that I recently encountered. Case 1: Testing without calling a REST/SOAP API and Case 2: Pretend that you have imported a library. (是也乎: 很有脑洞的案例分享 ) 活动 ~ Upcoming Conference / User Group Meet ??? 进入冬歇期了? 项目 ~ 包/模块/库/片段… ...

2016-10-28 · 3 min · 1438 words · ZoomQuiet

蠎加载 95

原文: Import Python Weekly Newsletter - Issue No 95 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 用 Rust 修复 Python 性能 performance Excellent post from Armin Ronacher on tackling a CPython performance bottleneck with a custom Rust extension module. (是也乎: 简单的说就是将 py 伪装成 Rust 来跑 ~ 城会玩儿~.~ ) 在 Python 中如何创建只读属性和限制性值对象 core python There are different way to prevent setting attributes and make attributes read only on object in python. We can use any one of the following way to make attributes readonly. 1) Property Descriptor 2) Using descriptor methods get and set 3) Using slots (only restricts setting arbitary attributes). (是也乎: 使用内置的自省机制来防卫 ) 如何将 Django 应用部署到 Digital Ocean deployment In this tutorial we will be deploying https://github.com/sibtc/urban-train ,a empty Django project I created to illustrate the deployment process. (是也乎: 一个 Heroku 一个 Digital Ocean, 文档好到经常被搜索出来独立使用 ) 用 Python 进行异步抓取 Scraping is often an example of code that is embarrassingly parallel. With some slight changes, our tasks can be done asynchronously, allowing us to process more than one URL at a time. In version 3.2, Python introduced the concurrent.futures module, which is a joy to use for parallelizing tasks like scraping. The rest of this post will show how we can use the module to make our previously synchronous code asynchronous. (是也乎: 使用 Py3 内置的库折腾 ) 每周聊 Python: Class-Based Views in Django video Most Django programmers use function-based views, but some use class-based views. Why? Special guest Buddy Lindsey will be joining us this week to talk about how class-based views are different. 和俺聊 Python : #80 TinyDB: 轻便的文档数据库 podcast I’m excited to introduce you to Markus Siemens and TinyDb. This is a 100% pure python, embeddable, pip-installable document DB for Python. (是也乎: 无论怎么折腾, 目前看还没有一种 NoSQL 数据库可以简单的替代 MySQL ) 在 Django 处状态 django, finite state machine Whether you’re building up a CMS or a bespoke application, chances are that you will have to handle some states / statuses. Let’s discuss your options in Django. JIRA Sponsor IT Help Desk & Ticketing. Start a free trial of JIRA Service Desk and get your free Konami Code shirt. (是也乎: 其它赞助商俺是不知道的, 这个非常赞的 ) 升级 Django - Never Clever django General Guidelines when upgrading Django. (是也乎: 人艰不拆,宁可另外起用个新网站,来替换部分接口,也别… 啊,多么也痛的领悟…) Yoda on python dependency humor Check the tweet :) (是也乎: 程序猿的幽默只有翻越后感知的到 ) lptrace opensource project lptrace is strace for Python programs. It lets you see in real-time what functions a Python program is running. It’s particularly useful to debug weird issues on production. (是也乎: 又一个观察活体 Python 运行时变量情况的调试工具, 不过… ) Python 的静态类型,嚓 my(py)! mypy In this post, I’ll explain how mypy works, the benefits and pain points we’ve seen in using mypy, and share a detailed guide for adopting mypy in a large production codebase (including how to find and fix dozens of issues in a large project in the first few days of using mypy!). sanic web server Python 3.5+ web server that’s written to go fast 活动 ~ Upcoming Conference / User Group Meet Inland Empire Pyladies PyKla Monthly meetup PyCon CZ 2016 PyCon Finland 2016 PyCon Ireland 2016 PyCon Canada 2016 PyHPC 2016 PyCon Jamaica 2016 项目 ~ 包/模块/库/片段… ...

2016-10-23 · 3 min · 1028 words · ZoomQuiet