Live data from Hacker News

'New' Python modules of 2015

blog.rtwilson.com

101–110 of 137 posts

Re: 'New' Python modules of 2015

#101
post #91

This is a tangent, but the most annoying change in the latest Python versions is you can no longer write print "foo". Now it has to be print("foo"). Damn kids ruining my language.

I switched to Python three a few months ago. And it still gets me and I end up typing "print variable", only to have Python complain. It's probably stuck with me because of it's simplicity, though I do understand why they've removed it. It's an aberration in the syntax, for lack of a better way of putting it.

Re: 'New' Python modules of 2015

#103
post #63

Earlier quoted context omitted.

For those of us more dictionary oriented, there is https://pypi.python.org/pypi/voluptuous (which is OK for the most part, as long as you are only trying to do validation, and nothing too crazy)

Similar, I've used this library with a lot of success: https://marshmallow.readthedocs.org/en/latest/

Looks extremely similar to https://github.com/schematics/schematics . Always good to see two projects approach the problem the same way independently - higher chance that the solution is right :)

Schematics has a very useful feature in "roles" - i.e. a good way of hiding certain fields in certain situations (e.g. admin views vs self vs other vs anonymous). Does marshmallow have something similar?

Re: 'New' Python modules of 2015

#104
post #91

This is a tangent, but the most annoying change in the latest Python versions is you can no longer write print "foo". Now it has to be print("foo"). Damn kids ruining my language.

> This is a tangent, but the most annoying change in the latest Python versions is you can no longer write print "foo". Now it has to be print("foo").

The statement-to-function migration for print is, IMO, generally an improvement, but in any case its not a change in the latest versions of python, except with an unusually broad interpretation of latest; its a change in Python 3.0, which was released a little over 7 years ago.

Re: 'New' Python modules of 2015

#106
post #63

Earlier quoted context omitted.

For those of us more dictionary oriented, there is https://pypi.python.org/pypi/voluptuous (which is OK for the most part, as long as you are only trying to do validation, and nothing too crazy)

Similar, I've used this library with a lot of success: https://marshmallow.readthedocs.org/en/latest/

+1 for marshmallow - most of the serialization libraries are 80% there, but marshmallow has it 95% down - all the weird corner cases about nested models and lists of nested models and all that. Plus the dev is very helpful and courteous on github.

Re: 'New' Python modules of 2015

#107
Pyrasite. When you have a running python app that is behaving oddly and you can't replicate the bug elsewhere, you can run python code inside the running process - without any preparation beforehand - to display stack trace, output vars,...

Re: 'New' Python modules of 2015

#108

Hands down, my favorite new library is schema: https://pypi.python.org/pypi/schema Here's a schema I use in production, see how readable it makes the parameters of the API and how quick all the validation and normalization is: https://www.pastery.net/mhwwnv/ At the end, you get an object called data, and you can do data.title, data.language, etc, and be sure that everything is as you expect.

[deleted]

Re: 'New' Python modules of 2015

#109
post #12

I am using Scrapy a lot. http://scrapy.org/ It is very well designed web crawling library.

Just seeing this for the first time. Got a proof-of-concept demo working in no time (after fussing with install requirements...). Looks like a great tool for non-devs like me who still need to scrape things occasionally for data collection and analysis.
Post reply on HN