蠎加载 93

原文: Import Python Weekly Newsletter - Issue No 93 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 为 Python 开发者配置 Sublime Text sublime We have been sharing Daniel’s articles and videos from this youtube channel dedicated to Python and Sublime for a while now https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA . Today Daniel published his book on Sublime Text for Python Developers. Have a look if you use sublime text. Here is a 30% discount for all ImportPython Subscribers. (是也乎: 价值 $29 的课程 ) 用 Flask 和 SQLAlchemy 实现 “Soft Delete” 模式 flask, SQLAlchemy You can find lots of reasons to never delete records from your database. The Soft Delete pattern is one of the available options to implement deletions without actually deleting the data. It does it by adding an extra column to your database table(s) that keeps track of the deleted state of each of its rows. This sounds straightforward to implement, and strictly speaking it is, but the complications that derive from the use of soft deletes are far from trivial. In this article I will discuss some of these issues and how I avoid them in Flask and SQLAlchemy based applications. (是也乎: 简单的说, 手写 SQL 可以轻易作的事儿,在 ORM 世界中,嗯哼… ) 通过 Python 的 Data Visualization Landscape 进行动态游历(包含 ggplot 以及 Altair) data visualization Comprehensive listing of all data visualization packages with small codesnippets. 在 Django 折腾并发数据的正确姿势 django Guilherme Caminha explores the utility of using on_commit hook available from 1.9 onwards in sequencing part of a time consuming task in django view and rest offloaded to an async process. 思考一下协程 async-io Lukasz Langa uses asyncio source code to explain the event loop, blocking calls, coroutines, tasks, futures, thread pool executors, and process pool executors. (是也乎: 这是 go 的核心竞争力,其实 py 也早已有了对应的机制,只是…. ) 自动为 click 应用生成 man 说明 opensource project Click is my go to Python package for creating command line applications. click-man will generate one man page per command of your click CLI application specified in console_scripts in your setup.py. (是也乎: http://click.pocoo.org/ 对的只出精品的 pocoo 团队的 CLI 工具包 ) 当周PyDev: Bryan Van de Ven interview Bryan is a core developer of the Bokeh project, which is a visualization package for Python. He has also helped with the development of Anaconda. (是也乎: 名字有 van 的, 都是贵族后代, 同时在 Anaconda 和 数据可视化领域都有深入的强人… ) Flashlight 是分析及解决四旋翼控制问题的轻量级 Python 库. Flashlight enables you to easily solve for minimum snap trajectories that go through a sequence of waypoints, compute the required control forces along trajectories, execute the trajectories in a physics simulator, and visualize the simulation results. (是也乎: 当然,不是 DJI 开源的 ) Church opensource project Church is a library to generate fake data. It’s very useful when you need to bootstrap your database. (是也乎: 专注自动生成徦数据的库,再也不用折腾 SQL 了… ) 5 music things and Python Raspberry and Python projects/scripts. (是也乎: ) validr A simple,fast,extensible python library for data validation. (是也乎: 简单,快速,可拓展的数据校验库; 国人作品, 仅支持 Py 3.3+; 使用 tox 管理 pytest 测试案例… 私人官网果然也关注了 “新人到底需要什么” 长线讨论: Python入门指北 ) 活动 ~ Upcoming Conference / User Group Meet Santa Cruz Python Meetup Python Brasil [12] PyCon Ireland 2016 PyCon Canada 2016 PyData Cologne 2016 GeoPython 2017 项目 ~ 包/模块/库/片段… ...

2016-10-08 · 3 min · 1099 words · ZoomQuiet

蠎加载 92

原文: Import Python Weekly Newsletter - Issue No 9 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… Python 别名命令配合 virtualenv 玩的更好 Over the years, I’ve come up with my own Python aliases that play nice with virtual environments. For this post, I tried to stay as generic as possible such that any alias here can be used by every Pythonista. (是也乎: 使用 bash 中的配置别名也一样 ) 保持 Django 应用性能的详细记录. django, performance “Keep detailed records of the performance of your Django code.”. django-perf-rec is like Django’s assertNumQueries on steroids. It lets you track the individual queries and cache operations that occur in your code. This blog post explains the workings of this project https://tech.yplanapp.com/2016/09/26/introducing-django-perf-rec/ . 上周未工程师的实用 ML 分享 #pyconuk machine learning Last weekend I had the pleasure of introducing Machine Learning for Engineers (a practical walk-through, no maths) at PyConUK 2016 ( Video link on page ). My talk covered a practical guide to a 2 class classification challenge (Kaggle’s Titanic) with scikit-learn, backed by a longer Jupyter Notebook (github) and further backed by Ezzeri’s 2 hour tutorial from PyConUK 2014. Python 中的 Mocks 和 Monkeypatching testing This tutorial will help you understand why mocking is important, and show you how to mock in Python with Mock and Pytest monkeypatch. Abu Ashraf Masnun: 介绍 Django Channels Yet another introduction to Django Channels. This one is a lot more clear and step by step tutorial. If you still don’t know what Django channels is / how to get started, read this. (是也乎: 又一篇 Django Channels 的介绍, 可想是个多么复杂难言的功能点 ) Python Mocks: 温柔的介绍 - 部分1和2 testing, mock In this series of posts I am going to review the Python mock library and exemplify its use. I will not cover everything you may do with mock, obviously, but hopefully I’ll give you the information you need to start using this powerful library. Note it’s a two part series as of now, here is the second part’s url http://blog.thedigitalcatonline.com/blog/2016/09/27/python-mocks-a-gentle-introduction-part-2/#.V-ysf9HhXQo Decorators: 函式的功能 - 周末和 Trey Hunner 聊 Python webcast, video Decorators are one of those features in Python that people like to talk about. Why? Because they’re different. Because they’re a little weird. Because they’re a little mind-bending. Let’s talk about decorators: how do you make them and when should you use them? 简洁的图表和数据集 REST APIs charts The Plotly V2 API suite is a simple alternative to the Google Charts API. Make a request to a Plotly URL and get a link to a dataset or D3.js chart. Python code snippet are included on the page. (是也乎: Plot.ly 如日中天时,高调开源后,依然猛烈… ) Python 代码复审: Unplugged – 第 2 集 - Daniel Bader code review Daniel is doing a series of code review sessions with Python developers. Have a look at the accompanied video where he gives his opinion on a open source project by Milton. Python 的 C 面 c binding CPython, the primary implementation of Python used by millions, is written in C. Python core developers embraced and exposed Python’s strong C roots, taking a traditional tack on portability, contrasting with the “write once, debug everywhere” approach popularized elsewhere. The community followed suit with the core developers, developing several methods for linking to C. This has given us a lot of choices for interfacing with c, let us look at them. (是也乎: 又是 paypal 团队的分享, 看来 Py 在 paypal 家折腾的不轻… ) Django 技巧 #15 基于 Mixins 使用 Class-Based Views django General rules to use mixins to compose your own view classes with code examples. 如何设置 tab completion 来用 django-admin.py 和 manage.py ? django In this short article Mike shows us how to set auto complete for django-admin.py / manage.py arguments. Specially helpful if you have tons of management commands. M$ 中的 Python 工程 core python That’s the opening paragraph from the Python Insider blog post discussing the 2016 Python core sprint that recently took place. In the case of Microsoft’s participation in the sprint, both Steve Dower and I (Brett Cannon) were invited to participate (which meant Microsoft had one of the largest company representations at the sprint). Between the two of us we spent the week completing work on four of our own PEPs for Python 3.6: Adding a file system path protocol (PEP 519), Adding a frame evaluation API to CPython (PEP 523), Change Windows console encoding to UTF-8 (PEP 528), Change Windows filesystem encoding to UTF-8 (PEP 529). (是也乎: 发明了软件的 M$ ,好象没有哪个领域不掺合的 ) GitHub - beanbaginc/django: 非官方安全后端 Django: The Web framework for perfectionists with deadlines. security This is an unofficial fork of Django, which focuses entirely on backporting official, publicly-announced security fixes to Django 1.6.11. It does not contain any other bug fixes or features, and any branches other than security-backports/1.6.x are unlikely to be up-to-date. 活动 ~ Upcoming Conference / User Group Meet Reunión Python Valencia Sydney Python User Group PyConES - Almería Edmonton Python User Group IndyPy Monthly Meetup Python Brasil [12] Santa Cruz Python Meetup 项目 ~ 包/模块/库/片段… ...

2016-09-29 · 3 min · 1429 words · ZoomQuiet

蠎加载 91

原文: Import Python Weekly Newsletter - Issue No 91 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 俺出席在 新德里的 Pycon India 2016 importpython Hey guys, this is Ankur. Curator behind ImportPython. Will be attending PyconIndia. Happy to meet you all and discuss all things Python. Get your opinion on the newsletter, How to make it better ?. Ping me on ankur at outlook dot com or just reply to this email. I will respond back. See you there. (是也乎: Ankur 就是 ImportPython 的作者,原来是 印度人… ) 在 Quora 用 Python 和 asynq 进行异步编程 async-io asynq is a library for asynchronous programming in Python with a focus on batching requests to external services. It also provides seamless interoperability with synchronous code, support for asynchronous context managers, and tools to make writing and testing asynchronous code easier. asynq was developed at Quora and is a core component of Quora’s architecture. See the original blog post here. (是也乎: 嗯哼, 又一个没有进入 build-in 的优秀模块 其实,公司想成名, 将公司名嵌入到著名的开源模块中,一直是非常好的渠道. ) Python 包管理生态 - Nick Coghlan packaging There have been a few recent articles reflecting on the current status of the Python packaging ecosystem from an end user perspective, so it seems worthwhile for me to write-up my perspective as one of the lead architects for that ecosystem on how I characterise the overall problem space of software publication and distribution, where I think we are at the moment, and where I’d like to see us go in the future. (是也乎: 少见的长篇大论, 追根溯源 Python 包管理的的历史和发展; 这已经不是头一家从根儿上重构 py 包发行机制的尝试了. 当然, 事实也证明, 从一开始不完美的事物,往往能在其后发展出创始人也无法想象的花活儿来. 参考 JavaScript … 嗯哼, 那个连姓名都故意乱起的语言. ) 用 pkgsrc 部署现代 Python 应用到古老的基础设施上 infrastructure This team is responsible for supplying a variety of web apps built on a modern stack (mostly Celery, Django, nginx and Redis), but have almost no control over the infrastructure on which it runs, and boy, is some of that infrastructure old and stinky. We have no root access to these servers, most software configuration requires a ticket with a lead time of 48 hours plus, and the watchful eyes of a crusty old administrator and obtuse change management process. The machines are so old that many are still running on real hardware, and those that are VMs still run some ancient variety of Red Hat Linux, with, if we’re lucky, Python 2.4 installed. (是也乎: 就是上篇文章的另外一个分支, 分享 PayPal 的折腾成果. ) 创作公众可读的 Python notebooks ipython The notebook functionality of Python provides a really amazing way of analyzing data and writing reports in one place. However in the standard configuration, the pdf export of the Python notebook is somewhat ugly and unpractical. In the following I will present my choices to create almost publication ready reports from within IPython/Jupyter notebook. (是也乎: 讲真, 每次见到这么细心的一点点解决 LeTaX 和现实世界结合的分享, 就看见了20年前的 王珢 孤独的宣传 Emacs+TeX 的身影 ) SF Pybay 大会视频 Paul Bailey, “A Guide to Bad Programming”, at PyBay2016 was my fav talk amongst all. Check out the youtube channel. (是也乎: 哈! 其实烂代码指南比好代码手册,要更加有用的. ) 压缩和增强手写笔记 image processing I wrote a program to clean up scans of handwritten notes while simultaneously reducing file size. Some of my classes don’t have an assigned textbook. For these, I like to appoint weekly “student scribes” to share their lecture notes with the rest of the class, so that there’s some kind written resource for students to double-check their understanding of the material. The notes get posted to a course website as PDFs. (是也乎: ~ Left: input scan @ 300 DPI, 7.2MB PNG / 790KB JPG. Right: output @ same resolution, 121KB PNG 简单的说,经过复杂的处理,终于可以免去重新用电脑整理课堂笔记的事儿了! 大体积的扫描件经过处理,就能变成又小又清晰的 pdf 来卖了! ) Python 中的图像处理 - 教程 image processing This tutorial will show you how to transform an image with different filters and techniques to deliver different outputs. These methods are still in use and part of a process known as Computer-To-Plate (CTP), used to create a direct output from an image file to a photographic film or plate (depending on the process). Note - It’s a pretty good article that makes uses of Python 3, Pillow and is well written. (是也乎: WoW 强烈历史感的科普文, 将出版的图像处理和 python 的结合聊明白了. ) 每周聊 Python: 学习 Django 的技巧 video This is a Weekly Python Chat live video chat events. These events are hosted by Trey Hunner. This week Melanie Crutchfield and he are going to chat about things you’ll wish you knew earlier when making your first website with Django. Much watch for newbies building websites in Django. 2 步认证在 Django security If you are looking to implement 2 Factor Authentication as part of your product and don’t know where to start read this. 活动 ~ Upcoming Conference / User Group Meet PyCon DE 2016 PyCon CZ 2016 PyCon Ireland 2016 PyHPC 2016 PyData Cologne 2016 项目 ~ 包/模块/库/片段… ...

2016-09-22 · 4 min · 1550 words · ZoomQuiet

蠎加载 90

原文: Import Python Weekly Newsletter - Issue No 90 欢迎, 来 PyChina/weekly 共同翻译/增订/推荐 周刊 蠎消息 ;-) 该读 ~ 文章, Blog, 教程… 在 Python 中的实时数据流管道 streaming Motorway is a real-time data pipeline, much like Apache Storm - but made in Python :-) We use it over at Plecto and we’re really happy with it - but we’re continously developing it. The reason why we started this project was that we wanted something similar to Storm, but without Zookeeper and the need to take the pipeline down to update the topology. (是也乎: 类似 Apache Storm/Amazon SQS/Kinesis 的有界面数据流构建平台 ) 与数据流一起工作: 使用 Twitter API 捕获 tweets twitter This tutorial tries to teach event driven programming by making use of streaming API offered by twitter. 介绍 Python 生成器 generators In this guide we ’ll cover generators in depth . We ’ll talk about how and why to use them , the difference between generator functions and regular functions , the yield keyword , and provide plenty of examples.This guide assumes you have a basic knowledge of Python ( especially regular functions).Throughout this guide we are going to work towards solving a problem . (是也乎: 又一篇极简说明好文. ) Python 3.6.0 beta 1 发布! python3 Python 3.6.0b1 is the first of four planned beta releases of Python 3.6, the next major release of Python, and marks the end of the feature development phase for 3.6. There are quite many new features have a look. (是也乎: 对于 打死不用 Py3 党 成员而言, 历史模块库的不兼容, 是一个怎么也绕不过去的门槛. ) Channels 进入正式 Django 项目通道 django The Django team is pleased to announce that the Channels project is now officially part of the Django project, under our new Official Projects program. Channels is the effort to bring WebSockets, long-poll HTTP, and other non-request-response protocol and business logic handling to Django, as part of our ongoing effort to establish what makes a useful web framework in 2016. 在 Django 中测试日期 testing Django makes unit & functional testing easy (especially with WebTest). Tests on routing, permissions, database updates and emails are all straightforward to implement but how do you test dates & time? You might for example want to test regular email notifications. 介绍 Django Channels django The idea behind Channels is quite simple. To understand the concept, let’s first walk through an example scenario, let’s see how Channels would process a request. 节目 74 - Python 在 Zalando podcast, community Open source has proven its value in many ways over the years. In many companies that value is purely in terms of consuming available projects and platforms. In this episode Zalando describes their recent move to creating and releasing a number of their internal projects as open source and how that has benefited their business. We also discussed how they are leveraging Python and a couple of the libraries that they have published. (是也乎: Zalando 是又一个 Python 重度依赖公司,分享他们的折腾历史. ) 得书: 赢取 “Python 201” books To win your copy of this book, all you need to do is come up with a comment below highlighting the reason “why you would like to win this book”. Try your luck guys :) 机器学习一年记 machine learning Only people with masters degrees or Ph.D’s work with machine learning professionally isn’t true. The truth is you don’t need much maths to get started with machine learning, and you don’t need a degree to use it professionally. Here is Per Harald Borgen journey. Yes he is using Python. (是也乎: 传说机器学习得至少硕士以上学历的人才玩的了, 作者证明了,这不是真的…嗯哼. ) 在 JavaScript, Python, 和 Go 中对同一个算法的 12 个实现版本 languages I recently had to write nearly the same code in Go and Python on the same day, and I realized I had written it many times before in different languages. But it does point up some interesting language differences. This article explores many different ways to write the same code (是也乎: 简单的说, 算法优化到最后, Python 一行搞店, 其它语言, 嗯哼… ) 活动 ~ Upcoming Conference / User Group Meet ...

2016-09-15 · 3 min · 1323 words · ZoomQuiet