Parsing SQL with Python

I have looked into this issue quite extensively. Python-sqlparse is a non validating parser which is not really what you need. The examples in antlr need a lot of work to convert to a nice ast in python. The sql standard grammars are here, but it would be a full time job to convert them … Read more

unknown version in python library pyparsing

I received the same error and I’m also in Python 3.6.0 … AttributeError: ‘version_info’ object has no attribute ‘__version__’ If you want to dig a little more, you can type this in your console and detect which package is using this dependency. > pip show pyparsing In my case the output was something like this, … Read more

a python library that accepts some text, and replaces phone numbers, names, and so on with tokens

As Harrison pointed out, nltk has named entity recognition, which is what you want for this task. Here is a good sample to get you started. From the site: import nltk sentences = nltk.sent_tokenize(text) tokenized_sentences = [nltk.word_tokenize(sentence) for sentence in sentences] tagged_sentences = [nltk.pos_tag(sentence) for sentence in tokenized_sentences] chunked_sentences = nltk.ne_chunk_sents(tagged_sentences, binary=True) def extract_entity_names(t): entity_names … Read more