Live data from Hacker News

'New' Python modules of 2015

blog.rtwilson.com

71–80 of 137 posts

Re: 'New' Python modules of 2015

#71
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)

Huh, voluptuous looks pretty much exactly the same as schema. Or at least a subset of it, as it doesn't have And/Or/Use, as far as I can see.

I believe it may, perhaps analogous to its Any and All, etc.

Re: 'New' Python modules of 2015

#72
post #12

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

I found out, through reddit a couple of days ago, about Pomp: https://bitbucket.org/estin/pomp It looks like a much cleaner Scrapy-inspired spider framework, without the twisted dependency. And it's python 2+3 compatible. I'm very excited to try it out.

It looks very promising. I will give it a try.

Re: 'New' Python modules of 2015

#73
post #26

I'm feeling a lot of love for Pandas. Any (biology related) project I work on starts with multi-headered dataframes and ends in beautiful Seaborn graphs. In combination with Jupyter notebook I breeze through large data sets while leaving a perfect trail of what goes on in the data pipeline. Python is great.

I've been loving Pandas used alongside Seaborn as well. It's really just so easy to manipulate/visualize my data (and make it look gorgeous) with the combo.

Re: 'New' Python modules of 2015

#74
post #62

Earlier quoted context omitted.

Optional being an attribute of the key rather than the value is pretty bizarre to me, I've seen that patten a couple times. Feels like the wrong way to go about it

I see what you mean, but it's the key that's optional, not the value.

Ahh. That makes sense then. The value of the key being optional is indeed a different concept. Fwiw, this is one huge downside of Swagger APIs. Swagger supports the concept of optional keys but not optional values >.>

I have yet to find a validation library that supports all the sorts of things I expect it to. One place they tend to fail is the ways they can fulfill default values.

Say a field has an error and I want to just give it a default value when it's broken? That particular feature doesn't exist in any library i've found so far (for python) =/

Granted, this sort of blends into the usual "It's a validation library not a serialization library". But they all make a half-assed attempt at the other side in my experience.

Re: 'New' Python modules of 2015

#77

Obiwan pypi.python.org/pypi/obiwan/ validating JSON also: type checking on function signatures

jsonschema:

Using JSON Schema with Python to validate JSON data: http://jugad2.blogspot.in/2015/12/using-json-schema-with-pyt...

https://pypi.python.org/pypi/jsonschema

http://json-schema.org/

Re: 'New' Python modules of 2015

#78
post #63

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.

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/

Re: 'New' Python modules of 2015

#79
post #23

Earlier quoted context omitted.

It takes precedence in the path over everything...and in the last version I used (before I upgraded to OS X El Capitain and wiped out everything), things like `curl` were provided [1] ...which I completely understand for Anaconda's use case, but it caused a lot of confusing grief to me when I hadn't expected that and OpenSSL was having its rough times. I don't know if that's the case (curl being part of the package)…

> And finally...well, I have to admit it, but I use Python like a goddamned moron in that I still don't know how to use virutalenv/venv to do proper dev isolation. I was the same way for quite a while, until I bumped into pyenv-virtualenv[1]. Just install that plugin, and you can do, eg, pyenv virtualenv 3.5.1 my-project to get a virtual environment called `my-project` based off of Python 3.5.1 (assuming that you've…

Thanks for this...wrapping it up in pyenv is a lot more familiar to me. And why would you apologize for shilling for pyenv?...it's amazing :) (as is rbenv, its inspiration)

Re: 'New' Python modules of 2015

#80
post #63

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.

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)

On the binary side Construct is quite nice: https://construct.readthedocs.org

I've used it for parsing various network protocols to good effect.

Post reply on HN