Live data from Hacker News

'New' Python modules of 2015

blog.rtwilson.com

81–90 of 137 posts

Re: 'New' Python modules of 2015

#81
post #79

Earlier quoted context omitted.

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

You're very welcome.

And ehhh, I've been downvoted and bitched at about evangelizing pyenv before. Just thought I'd preempt that. But yes, it's an amazing piece of software. :)

FYI, I've put together a bash function for my .bash_profile that adds an indicator to my prompt showing the current Python version/virtualenv in use[1]. That's saved me a bit of frustration when going into a directory where a local pyenv version overrides the global version.

[1]: https://github.com/jackmaney/bash-profile/blob/ddb57091aab44...

Re: 'New' Python modules of 2015

#82
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.

For those interested, you can also get nice styles with just matplotlib (including seaborn style) using stylesheets: http://matplotlib.org/users/style_sheets.html

I had no idea it existed, very useful, thanks!

Re: 'New' Python modules of 2015

#83
post #64

I haven't used Python in a while, but I shall once more look into it. Python was always fun. Guess I'll do that over christmas, see where it takes me. I might even get around to learning Python 3 after only ... what? seven-or-so years?

I have been a bit 'off Python' for a while, but this list article prompted me to take a renewed look at it because of Jupyter Notebook, and I have to say I'm quite impressed .. this is a really nice way of working on code, wow .. especially using folium this way is very cool.

Re: 'New' Python modules of 2015

#84
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/

I've tried truckloads of Python serialisation libs over the last few years and marshmallow is the one that finally makes me feel like I don't need to look for another one.

Re: 'New' Python modules of 2015

#85

Interesting list. I love Anaconda! A few years ago I tried to set up a Mac with a scientific computing stack and it took me days to hack my way through all the various dependencies and incompatible versions. Anaconda now lets me do that in a minutes.

Anaconda is very underrated, I use it both on my linux and mac systems. Also check out: Simple, Clean Python Deploys with Anaconda http://blog.stuart.axelbrooke.com/deployment-with-anaconda

I love it on Windows but I wonder why you use it on Linux. What does it do better than the alternative (native packages and pip)?

Re: 'New' Python modules of 2015

#86
Anaconda has been a lifesaver, because it can be installed and managed quite easily without root privileges (it even installs pip). Some of the sysadmins where I work are slower than molasses when it comes to installing python packages (as in, it takes months of repeated emails from multiple people to get anything done), and what is installed is often years out of date.

Re: 'New' Python modules of 2015

#87

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.

There is also JSON-Schema protocol: http://json-schema.org/implementations.html curious how schema may be superior :).

Re: 'New' Python modules of 2015

#88
post #84

Earlier quoted context omitted.

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

I've tried truckloads of Python serialisation libs over the last few years and marshmallow is the one that finally makes me feel like I don't need to look for another one.

It's very easy and does everything I've needed it to!

Re: 'New' Python modules of 2015

#89
post #85

Earlier quoted context omitted.

Anaconda is very underrated, I use it both on my linux and mac systems. Also check out: Simple, Clean Python Deploys with Anaconda http://blog.stuart.axelbrooke.com/deployment-with-anaconda

I love it on Windows but I wonder why you use it on Linux. What does it do better than the alternative (native packages and pip)?

One word - isolation.

One issue with using your system's packaging system is that a lot of system utilities are written in Python which makes it harder to play around with new versions, bleeding edge libs, etc.

Re: 'New' Python modules of 2015

#90
post #64

I haven't used Python in a while, but I shall once more look into it. Python was always fun. Guess I'll do that over christmas, see where it takes me. I might even get around to learning Python 3 after only ... what? seven-or-so years?

I've been dragging my heels on this for a long time, but I'm finally starting to take the plunge into 3.

I think for any greenfield project, there's very little reason to use CPython 2 anymore. If you want performance, use PyPy. If you want features, use CPython 3. From now on, that's the philosophy I'm following whenever I write something new.

Post reply on HN