Deploying a Python Flask app on Heroku

In my previous post I described on a high level how I developed an API using Flask. I talked briefly about how I hosted it via Heroku. In this post, I am going to go deeper and show you how to deploy the API to Heroku step by step.

.. Heroku CLI

You need to download the Heroku CLI which will enable us deploy and manage our application.

After installation login into the Heroku Cli by running this command in the terminal.

heroku login

pyspellchecker 0.1.1

Pure python spell checker based on work by Peter Norvig

Pure Python Spell Checking based on Peter Norvig’s blog post on setting up a simple spell checking algorithm.

It uses a Levenshtein Distance algorithm to find permutations within an edit distance of 2 from the original word. It then compares all permutations (insertions, deletions, replacements, and transpositions) to known words in a word frequency list. Those words that are found more often in the frequency list are *more likely* the correct results.

pyspellchecker supports multiple languages including English, Spanish, German, and French. Dictionaries were generated using the WordFrequency project on GitHub.

pyspellchecker supports Python 3. If may work for Python 2.7 but it is not guaranteed (especially for Non-English dictionaries)!

Installation
The easiest method to install is using pip:

pip install pyspellchecker
To install from source:

git clone https://github.com/barrust/pyspellchecker.git
cd pyspellchecker
python setup.py install
As always, I highly recommend using the Pipenv package to help manage dependencies!

Quickstart
After installation, using pyspellchecker should be fairly straight forward:

from spellchecker import SpellChecker

spell = SpellChecker()

# find those words that may be misspelled
misspelled = spell.unknown([‘something’, ‘is’, ‘hapenning’, ‘here’])

for word in misspelled:
# Get the one `most likely` answer
print(spell.correction(word))

# Get a list of `likely` options
print(spell.candidates(word)

Ask HN: What is the best way to archive a webpage

I’ve enjoyed great success with various archiving proxies, including https://github.com/internetarchive/warcprox#readme and https://github.com/zaproxy/zaproxy#readme (which saves the content to an embedded database, and can be easier to work with than warc files). The benefit of those approaches over just save-as from the browser is that almost by definition the proxy will save all the components required to re-render the page, whereas save will only grab the parts it sees at that time.