{"id":239081,"date":"2014-10-03T21:05:02","date_gmt":"2014-10-03T17:05:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=239081"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=239081","title":{"rendered":"<span class=\"post_title\">\u041f\u0430\u0440\u0441\u0438\u043c \u043d\u0430 Python: Pyparsing \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0430\u0440\u0441\u0438\u043d\u0433 (\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u043e\u0432 \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u2014 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code>import matplotlib.pyplot  as plt <\/code><\/pre>\n<p>  \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0430: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0451\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e import, \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043b\u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0438\u043c\u0451\u043d \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u043a\u043e\u0439, \u043f\u043e\u0442\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e as, \u0430 \u0437\u0430 \u043d\u0438\u043c \u2014 \u043d\u0430\u0448\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e.<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e:<\/p>\n<pre><code>{ 'import': [ 'matplotlib', 'pyplot' ], 'as': 'plt' } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0430: &#8216;import&#8217; \u0438 &#8216;as&#8217;. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043a\u043b\u044e\u0447\u0430 &#8216;import&#8217; \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c Python \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c re (regular expression \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435). \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u0434\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0438\u0445 \u0432\u0438\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u0441 \u0438\u0441\u043f\u0443\u0433\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430 &#8216;import matplotlib.pyplot as plt&#8217; \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:<\/p>\n<pre><code>r'^[ \\t]*import +\\D+\\.\\D+ +as \\D+' <\/code><\/pre>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Pyparsing. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e \u2014 \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Pyparsing \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430 \u043d\u0451\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0441\u0435\u0440.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Pyparsing. \u0415\u0441\u043b\u0438 \u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0432 Linux, \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435:<\/p>\n<pre><code>sudo pip install pyparsing <\/code><\/pre>\n<p>  \u0412 Windows \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433, \u0433\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 \u0444\u0430\u0439\u043b pip.exe (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, C:\\Python27\\Scripts\\), \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<pre><code>pip install pyparsing <\/code><\/pre>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u044d\u0442\u043e \u0437\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"http:\/\/sourceforge.net\/projects\/pyparsing\/files\/\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Pyparsing \u043d\u0430 SourceForge<\/a>, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0442\u0430\u043c \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0442\u043e\u0440 \u0434\u043b\u044f Windows \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Pyparsing \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u041f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Pyparsing \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430 <a href=\"http:\/\/pyparsing.wikispaces.com\/Download+and+Installation\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0443. \u041f\u0443\u0441\u0442\u044c s \u2014 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430:<\/p>\n<pre><code>s = 'import matplotlib.pyplot as plt' <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044c:<\/p>\n<pre><code>{ 'import': [ 'matplotlib', 'pyplot' ], 'as': 'plt' } <\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c Pyparsing. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Python IDLE \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435:<\/p>\n<pre><code>from pyparsing import * <\/code><\/pre>\n<p>  \u0417\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0430 * \u0432\u044b\u0448\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442 \u0432\u0441\u0435\u0445 \u0438\u043c\u0451\u043d \u0438\u0437 pyparsing. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 * \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 Pyparsing \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0430\u0440\u0441\u0435\u0440, \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u043c * \u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 pyparsing, \u043f\u0430\u0440\u0441\u0435\u0440 \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432, \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0444\u0440\u0430\u0437, \u0430 \u043f\u043e\u0442\u043e\u043c \u0438\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0441\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0435\u0441\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0430: \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0438\u0437 \u0431\u0443\u043a\u0432 \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f. \u041d\u0430 pyparsing:<\/p>\n<pre><code>module_name = Word(alphas + '_') <\/code><\/pre>\n<p>  Word \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e, alphas \u2014 \u0431\u0443\u043a\u0432\u044b. <code>Word(alphas + '_')<\/code> \u2014 \u0441\u043b\u043e\u0432\u043e, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0438\u0437 \u0431\u0443\u043a\u0432 \u0438 \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f. module_name \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f. \u0422\u0435\u043f\u0435\u0440\u044c \u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0438\u0437 \u0431\u0443\u043a\u0432 \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430 Pyparsing \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u0430 \u043a \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u044f\u0437\u044b\u043a\u0443.<\/p>\n<p>  \u041f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u2014 \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u043f\u043e\u0442\u043e\u043c \u0442\u043e\u0447\u043a\u0430, \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u043f\u043e\u0442\u043e\u043c \u0441\u043d\u043e\u0432\u0430 \u0442\u043e\u0447\u043a\u0430, \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435, \u043f\u043e\u043a\u0430 \u043f\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u043c \u0434\u043e \u0438\u0441\u043a\u043e\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u041f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0438\u043c\u0435\u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u0442\u043e\u0447\u0435\u043a. \u041d\u0430 pyparsing:<\/p>\n<pre><code>full_module_name = module_name + ZeroOrMore('.' + module_name) <\/code><\/pre>\n<p>  ZeroOrMore \u0434\u043e\u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u043d\u043e\u043b\u044c \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435\u00bb, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0438\u043b\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0447\u0438\u0442\u0430\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0442\u043e\u0440\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043f\u0430\u0440\u0441\u0435\u0440\u0430: \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u2014 \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u043e\u043b\u044c \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0437 \u0438\u0434\u0443\u0442 \u0442\u043e\u0447\u043a\u0430 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u0434\u0451\u0442 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c &#8216;as plt&#8217;. \u041e\u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e &#8216;as&#8217;, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0434\u0451\u0442 \u0438\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u0430\u043c\u0438 \u0434\u0430\u043b\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e. \u041d\u0430 pyparsing:<\/p>\n<pre><code>import_as = Optional('as' + module_name) <\/code><\/pre>\n<p>  Optional \u0434\u043e\u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439\u00bb, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0412 \u0441\u0443\u043c\u043c\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c: \u00ab\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0438\u0437 \u0441\u043b\u043e\u0432\u0430 &#8216;as&#8217; \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>  \u041f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 import, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0434\u0451\u0442 \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f, \u043f\u043e\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f &#8216;as plt&#8217;. \u041d\u0430 pyparsing:<\/p>\n<pre><code>parse_module = 'import' + full_module_name + import_as <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0438\u043c\u0435\u0435\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0441\u0435\u0440:<\/p>\n<pre><code>module_name = Word(alphas + '_') full_module_name = module_name + ZeroOrMore('.' + module_name) import_as = Optional('as' + module_name) parse_module = 'import' + full_module_name + import_as <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 s:<\/p>\n<pre><code>parse_module.parseString(s) <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code>(['import', 'matplotlib', '.', 'pyplot', 'as', 'plt'], {}) <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a:<\/p>\n<pre><code>parse_module.parseString(s).asList() <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c: <\/p>\n<pre><code>['import', 'matplotlib', '.', 'pyplot', 'as', 'plt'] <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0441\u0435\u0440. \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043c\u044b \u0431\u044b \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u0441\u043b\u043e\u0432\u043e import \u0438 \u0442\u043e\u0447\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0414\u043b\u044f \u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Suppress(). \u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448 \u043f\u0430\u0440\u0441\u0435\u0440 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>module_name = Word(alphas + '_') full_module_name = module_name + ZeroOrMore(Suppress('.') + module_name) import_as = Optional(Suppress('as') + module_name) parse_module = Suppress('import') + full_module_name <\/code><\/pre>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0432 <code>parse_module.parseString(s).asList()<\/code>, \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code>['matplotlib', 'pyplot', 'plt'] <\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u0441\u0435\u0440 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u043d\u0430\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432\u0438\u0434\u0430 <code>{'import':[\u043c\u043e\u0434\u0443\u043b\u044c1, \u043c\u043e\u0434\u0443\u043b\u044c2, ...], 'as':\u043c\u043e\u0434\u0443\u043b\u044c}<\/code>. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e, \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (full_module_name) \u0438 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f (import_as). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e pyparsing \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u0430\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043a\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438\u043c\u044f &#8216;modules&#8217;, \u0430 \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043c\u044b \u0441\u0430\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u2014 \u0438\u043c\u044f &#8216;import as&#8217;:<\/p>\n<pre><code>full_module_name = (module_name + ZeroOrMore(Suppress('.') + module_name))('modules') import_as = (Optional(Suppress('as') + module_name))('import_as') <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0432\u044b\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0438\u043c\u044f, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043a\u043e\u0431\u043a\u0438, \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u0434:<\/p>\n<pre><code>res = parse_module.parseString(s) print(res.modules.asList()) print(res.import_as.asList()) <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code>['matplotlib', 'pyplot'] ['plt'] <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0438\u0441\u043a\u043e\u043c\u043e\u0433\u043e \u0438 \u043d\u0430\u0448\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0435\u0433\u043e. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u0441\u0435\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u0441\u043b\u043e\u0432\u0430\u0440\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435 ParseAction \u2014 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430:<\/p>\n<pre><code>parse_module = (Suppress('import') + full_module_name).setParseAction(lambda t: {'import': t.modules.asList(), 'as': t.import_as.asList()[0]}) <\/code><\/pre>\n<p>  lambda \u2014 \u044d\u0442\u043e \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 Python, t \u2014 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u043e\u0442\u043e\u043c \u0438\u0434\u0451\u0442 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f Python, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c asList(), \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a. \u0418\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u0441\u043b\u0435 as \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u043d\u043e, \u0438 \u0441\u043f\u0438\u0441\u043e\u043a <code>t.import_as.asList()<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430 (\u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u043e\u043b\u044c) \u0438 \u043f\u0438\u0448\u0435\u043c asList()[0].<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043f\u0430\u0440\u0441\u0435\u0440. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c <code>parse_module.parseString(s).asList()<\/code> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code>[{ 'import': [ 'matplotlib', 'pyplot' ], 'as': 'plt' }] <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u0447\u0442\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u0446\u0435\u043b\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0434\u043e\u0431\u0430\u0432\u0438\u043c [0] \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0442\u0435\u043a\u0441\u0442\u0430: <code> parse_module.parseString(s).asList()[0] <\/code><\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435:<\/p>\n<pre><code>{ 'import': [ 'matplotlib', 'pyplot' ], 'as': 'plt' } <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0442\u043e, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u0438.<\/p>\n<p>  \u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0432 \u0446\u0435\u043b\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a &#8216;from pyparsing import *&#8217; \u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0443 \u043d\u0430 \u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0438\u0441\u044c:<\/p>\n<pre><code>from pyparsing import Word, alphas, ZeroOrMore, Suppress, Optional <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430\u0448 \u043a\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code>from pyparsing import Word, alphas, ZeroOrMore, Suppress, Optional module_name = Word(alphas + &quot;_&quot;) full_module_name = (module_name + ZeroOrMore(Suppress('.') + module_name))('modules') import_as = (Optional(Suppress('as') + module_name))('import_as') parse_module = (Suppress('import') + full_module_name + import_as).setParseAction(lambda t: {'import': t.modules.asList(), 'as': t.import_as.asList()[0]}) <\/code><\/pre>\n<p>  \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u043b\u0438\u0448\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Pyparsing. \u0417\u0430 \u0431\u043e\u0440\u0442\u043e\u043c \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446, \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u0440\u0435\u0437\u043a\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u044e\u0449\u0435\u0439 \u0441\u0430\u043c \u043f\u043e\u0438\u0441\u043a, \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>  \u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0443 \u0441\u043b\u043e\u0432 \u043e \u0441\u0435\u0431\u0435. \u042f \u0430\u0441\u043f\u0438\u0440\u0430\u043d\u0442 \u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u041c\u0413\u0422\u0423 \u0438\u043c. \u0411\u0430\u0443\u043c\u0430\u043d\u0430 (\u043a\u0430\u0444\u0435\u0434\u0440\u0430 \u041c\u0422-1 \u201e\u041c\u0435\u0442\u0430\u043b\u043b\u043e\u0440\u0435\u0436\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u043d\u043a\u0438\u201c). \u0423\u0432\u043b\u0435\u043a\u0430\u044e\u0441\u044c Python, Linux, HTML, CSS \u0438 JS. \u041c\u043e\u0451 \u0445\u043e\u0431\u0431\u0438 \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0445 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432. \u0421\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0433\u0443 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0425\u0430\u0431\u0440\u0443, \u0434\u0435\u043b\u044f\u0441\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 Pyparsing, Sage \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0445 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u0437\u043d\u0430\u044e \u0441\u0440\u0435\u0434\u0443 SageMathCloud, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0449\u043d\u043e\u0439 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 Wolfram Alpha. SageMathCloud \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u0430 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432 \u043d\u0430 Python \u0432 \u043e\u0431\u043b\u0430\u043a\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0412\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c (Ubuntu \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c), Sage, IPython \u0438 LaTeX. \u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u043e\u043c\u0438\u043c\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 Python SageMathCloud \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 html, css, js, coffescript, go, fortran, scilab \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0440\u0435\u0434\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430 (\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0431\u0435\u0442\u0430-\u0432\u0435\u0440\u0441\u0438\u044f), \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Freemium. \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044d\u0442\u0430 \u0441\u0440\u0435\u0434\u0430 \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0430 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u0438 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0431\u0435\u043b.<\/p>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0414\u0430\u0440\u044c\u044e \u0424\u0440\u043e\u043b\u043e\u0432\u0443 \u0438 \u041d\u0438\u043a\u0438\u0442\u0443 \u041a\u043e\u043d\u043e\u0432\u0430\u043b\u043e\u0432\u0430 \u0437\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/239081\/\"> http:\/\/habrahabr.ru\/post\/239081\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0430\u0440\u0441\u0438\u043d\u0433 (\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u043e\u0432 \u0438\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u2014 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code>import matplotlib.pyplot  as plt <\/code><\/pre>\n<p>  \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0430: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0451\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e import, \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043b\u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0438\u043c\u0451\u043d \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u043a\u043e\u0439, \u043f\u043e\u0442\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e as, \u0430 \u0437\u0430 \u043d\u0438\u043c \u2014 \u043d\u0430\u0448\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e.<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e:<\/p>\n<pre><code>{ 'import': [ 'matplotlib', 'pyplot' ], 'as': 'plt' } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043a\u043b\u044e\u0447\u0430: &#8216;import&#8217; \u0438 &#8216;as&#8217;. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043a\u043b\u044e\u0447\u0430 &#8216;import&#8217; \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c Python \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c re (regular expression \u2014 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435). \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u0434\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0438\u0445 \u0432\u0438\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u0441 \u0438\u0441\u043f\u0443\u0433\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430 &#8216;import matplotlib.pyplot as plt&#8217; \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:<\/p>\n<pre><code>r'^[ \\t]*import +\\D+\\.\\D+ +as \\D+' <\/code><\/pre>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Pyparsing. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e \u2014 \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Pyparsing \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430 \u043d\u0451\u043c \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0441\u0435\u0440.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-239081","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/239081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=239081"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/239081\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=239081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=239081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=239081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}