
Useful Python Libraries for Startups - zallarak
http://blog.instavest.com/three-useful-python-libraries-for-startups
======
apalmer
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.

~~~
zallarak
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.

~~~
copsarebastards
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.

------
fasouto
[https://github.com/vinta/awesome-python](https://github.com/vinta/awesome-
python)

~~~
pbreit
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.

------
bohinjc
Regarding dates, I would have mentioned Arrow -
[http://crsmithdev.com/arrow/](http://crsmithdev.com/arrow/)

------
athoik
python-requests is a must have!

Requests: HTTP for Humans [http://docs.python-
requests.org/en/latest/](http://docs.python-requests.org/en/latest/)

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

~~~
shpx
[https://gist.github.com/kennethreitz/973705](https://gist.github.com/kennethreitz/973705)

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

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

------
dimino
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](https://github.com/scrapinghub/dateparser)

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

[https://boto.readthedocs.org/en/latest/](https://boto.readthedocs.org/en/latest/)

~~~
sandGorgon
remember that boto3 was released separately -
[https://github.com/boto/boto3](https://github.com/boto/boto3)

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

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

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

Also ERPNext ([https://ERPNext.com](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.

------
hornbill
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.

~~~
zallarak
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.

------
knicholes
I expected more libraries.

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

------
rshaban
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.

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

------
tuyguntn
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?

~~~
zallarak
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...](https://github.com/evansd/whitenoise#quickstart-for-other-wsgi-apps)

~~~
tuyguntn
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](http://www.infoq.com/presentations/Simple-Made-Easy)

~~~
danneu
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".

------
JelteF
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/](https://jeltef.github.io/PyLaTeX/)

Code: [https://github.com/JelteF/PyLaTeX](https://github.com/JelteF/PyLaTeX)

------
codesushi42
Dependency injection:
[https://pypi.python.org/pypi/injector/0.9.1](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](https://pypi.python.org/pypi/Flask-Injector)

------
danhardman
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.

------
truncate
Every startup gotta deploy stuff. I remember Fabric a useful tool for quickly
deploying and automating various tasks -
[http://www.fabfile.org/](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.

------
athoik
Another useful library is vatnumber Python module to validate VAT numbers:
[https://pypi.python.org/pypi/vatnumber](https://pypi.python.org/pypi/vatnumber)

------
welder
An alternative to phonenumbers is
[https://www.twilio.com/lookup](https://www.twilio.com/lookup)

~~~
bpicolo
API call vs code not really the same.

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

~~~
bdarnell
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.

------
merb
This is extremely subjective.

~~~
zallarak
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).

~~~
craigds
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...)

