Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Useful Python Libraries for Startups (instavest.com)
168 points by zallarak on June 30, 2015 | hide | past | favorite | 46 comments


Not sure why these recommendations are start up specific. Nothing here seems particularly 'startup'. These are just good simple general purpose web related python libraries.


I can see that perspective. My thoughts were that each of these were not the "best" way to do things, but provided a great effort/benefit ratio. For example, if you have a very high traffic website, then you're better off using a CDN for static files instead of Whitenoise.


If the effort difference between installing nginx and using Whitenoise makes a significant difference in the success of your business, there are much larger hiccups down the road which are going to put you out of business, so you might as well give up now.


> My thoughts were that each of these were not the "best" way to do things

May I ask what's the better way to parse international phone numbers?



Not a fan of uncurated, kitchen sink lists like that. Almost worse than no list at all. I know, I know, I don't have to look at it.


Awesome!


Regarding dates, I would have mentioned Arrow - http://crsmithdev.com/arrow/


python-requests is a must have!

Requests: HTTP for Humans http://docs.python-requests.org/en/latest/


I seem to do fine with httplib/2 and generally prefer core libraries. Am I really missing out on much?


https://gist.github.com/kennethreitz/973705

I would say not much, but it's much more pythonic.


Interesting but contrived with the authentication part which is rare in my experience (I've never seen it).


Python-dateutil is unintuitive as all get-out in my humble opinion, so I recommend dateparser instead (recent release has many great improvements over dateutil, but check it out for yourself to decide [0]).

[0] https://github.com/scrapinghub/dateparser


Since a lot of startups use AWS, boto ranks up there.

https://boto.readthedocs.org/en/latest/


remember that boto3 was released separately - https://github.com/boto/boto3


Does boto3 becoming 1.0 last week mean that everyone should be moving to it or will boto3 merge into boto?


There's also libcloud, which is a unified API https://libcloud.apache.org/

Some AWS specific functions, particularly for newer products or options, aren't always there immediately so you end up having to use boto in those cases. You also sometimes use provider specific options on functions, so it's not totally write-once and ignore.


Great point :-)!


Disclaimer: I am one of the developers that built this.

Try Frappe Framework (https://frappe.io). We have received feedback that it is really good to quickly build internal projects or prototypes.

Also ERPNext (https://ERPNext.com) is an open source erp that is feature rich and has a good UI. It can help any startup to manage their business without resorting to complicated excel sheets based management.


I am curious about why you have to parse dates in different formats. Is it part of a web crawler?

Once I switched to python 3, datetime has been sufficient for my needs as timezone is also handled.


We worked with a third party API for a data source which had inconsistent formats for dates. Also, we A/B test inputs and its awesome to be able to change how users input dates on the front-end without server-side code changes.


I expected more libraries.


Agreed, but I hadn't heard of the first two, so worth the time.


Hi @zallarak, nice to see you on HN! Not sure if you're doing any text analytics yet, but NLTK is designed to be super-quick to get up and running.


Hey, Thanks for the suggestion! I will look into it. Hope you're having a great summer in SF.


If only for testing I would agree with whitenoise, but in case of startup and you are already serving static files why do you want to replace NGINX with Whitenoise? any specific reason for Whitenoise, maybe it is better/simpler/efficient than NGINX?


Good question. We were not using nginx to begin with (rather, serving it through our app server). It was an alternative to nginx and is super easy to set up: https://github.com/evansd/whitenoise#quickstart-for-other-ws...


If you are using python code for serving static files, probably you are not seeing lots of traffic yet, I guess you should reconsider your decision and watch "Simple made Easy"[1] talk by Rich Hickey

[1] http://www.infoq.com/presentations/Simple-Made-Easy


Looks like Whitenoise can gzip your assets, add a hash to the filename, serve them with far-future headers, and then selectively serve the gzipped version based on Accept-Encoding headers.

Put that behind Cloudflare and your origin server is only hit when an edge location is warming its cache.

Sounds Hickey-tier simple to me, especially compared to your advice of "just use and configure Nginx".



When I needed a Python generation, I created abstractions between Python and LaTeX. The documentation is far from finished, but it should be fairly understandable with the examples.

Docs: https://jeltef.github.io/PyLaTeX/

Code: https://github.com/JelteF/PyLaTeX


Dependency injection: https://pypi.python.org/pypi/injector/0.9.1

For Flask-- it removes the dependency on a global request context: https://pypi.python.org/pypi/Flask-Injector


Does anyone have any non-python alternatives to these libraries? A lot of them seem very useful to me, but I rarely work in Python.


Every startup gotta deploy stuff. I remember Fabric a useful tool for quickly deploying and automating various tasks - http://www.fabfile.org/. Also not a library, but Gunicorn is pretty quick easy way to setup a quick decent HTTP server over your Python WSGI app.


Another useful library is vatnumber Python module to validate VAT numbers: https://pypi.python.org/pypi/vatnumber


An alternative to phonenumbers is https://www.twilio.com/lookup


API call vs code not really the same.


Why is "222-222-2222" not a valid phone number?


The phone numbers library isn't just counting digits; it has a database of which area codes exist (as well as other lesser-known rules, depending on the country). This makes it more effective at filtering out invalid/fake phone numbers, but it does mean you need to stay on top of the latest version as its database changes over time.


This is extremely subjective.


Agreed. My goal was to share what I thought were solutions to generally common problems, and were't incredibly easy to find (i.e. > 3 google searches to find). The three libraries I selected were general tasks that lots of developers end up having to re-invent (especially phone number parsing).


Is parsing phone numbers really a common task for startups? (I've never needed to do it). Is the use-case just validating that the user didn't accidentally type their phone number incorrectly? (Seems if the user wants to give you the wrong phone number, they can just pick one out of a directory...)


True. More so if you come at it from the perspective of "I use C++ at my startup".

If, however, you use Python at your startup it's more interesting, while still somewhat subjective.


It is quasi-contextual, but it would seem that a lot of startups share the same problems so there is broad applicability.


Yeah but there are other Libraries around, and some people maybe like the "real" libphonenumber more. Nothing against the article (not sure why I got down voted), I don't think it's bad to have a subjective meaning onto something, as long as I clearly state it. And the author also said it, so my comment was not against the article, that was just my subjective meaning about the article. ;)


Noting that an article of someone's recommendations is subjective is...well, you could have just said, "This is a blog post."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: