<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hrishikesh Terdalkar</title>
    <description>The latest articles on DEV Community by Hrishikesh Terdalkar (@hrishikeshrt).</description>
    <link>https://dev.to/hrishikeshrt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F824659%2Fd2cb2ccc-e01f-4f13-ab27-3e318e7f507a.png</url>
      <title>DEV Community: Hrishikesh Terdalkar</title>
      <link>https://dev.to/hrishikeshrt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hrishikeshrt"/>
    <language>en</language>
    <item>
      <title>Google Drive Actions</title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Fri, 30 Dec 2022 20:09:58 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/google-drive-actions-3e23</link>
      <guid>https://dev.to/hrishikeshrt/google-drive-actions-3e23</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt" rel="noopener noreferrer"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/google_drive_actions" rel="noopener noreferrer"&gt;
        google_drive_actions
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Perform common actions using Google Drive API v3
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="rst"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Google Drive API&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;Simple &lt;code&gt;GoogleDriveApplication&lt;/code&gt; class to perform common Google Drive actions
such as searching files, downloading entire folders, uploading files, deleting files.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-python notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s1"&gt;application&lt;/span&gt; &lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-v"&gt;GoogleDriveApplication&lt;/span&gt;

&lt;span class="pl-c1"&gt;GD&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-en"&gt;GoogleDriveApplication&lt;/span&gt;(&lt;span class="pl-s"&gt;"path-to-client-secret.json"&lt;/span&gt;)

&lt;span class="pl-c"&gt;# Find files&lt;/span&gt;
&lt;span class="pl-c1"&gt;GD&lt;/span&gt;.&lt;span class="pl-c1"&gt;find_files&lt;/span&gt;(&lt;span class="pl-s"&gt;"hello+world"&lt;/span&gt;, &lt;span class="pl-s1"&gt;is_folder&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;False&lt;/span&gt;)

&lt;span class="pl-c"&gt;# List entire subtree of the specified folder&lt;/span&gt;
&lt;span class="pl-c1"&gt;GD&lt;/span&gt;.&lt;span class="pl-c1"&gt;list_folder&lt;/span&gt;(&lt;span class="pl-s"&gt;"google-drive-id-of-folder"&lt;/span&gt;, &lt;span class="pl-s1"&gt;recursive&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;True&lt;/span&gt;)

&lt;span class="pl-c"&gt;# Download entire folder&lt;/span&gt;
&lt;span class="pl-c1"&gt;GD&lt;/span&gt;.&lt;span class="pl-c1"&gt;download_folder&lt;/span&gt;(&lt;span class="pl-s"&gt;"google-drive-id-of-folder"&lt;/span&gt;)&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Create a project on Google Cloud Platform&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Wizard: &lt;a href="https://console.developers.google.com/start/api?id=drive" rel="nofollow noopener noreferrer"&gt;https://console.developers.google.com/start/api?id=drive&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Instructions&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/genomics/downloading-credentials-for-api-access" rel="nofollow noopener noreferrer"&gt;https://cloud.google.com/genomics/downloading-credentials-for-api-access&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Select application type as "Installed Application"&lt;/li&gt;
&lt;li&gt;Create credentials OAuth consent screen --&amp;gt; OAuth client ID&lt;/li&gt;
&lt;li&gt;Save &lt;code&gt;client_secret.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;References&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/api-client-library/python/start/get_started" rel="nofollow noopener noreferrer"&gt;https://developers.google.com/api-client-library/python/start/get_started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/drive/v3/reference/" rel="nofollow noopener noreferrer"&gt;https://developers.google.com/drive/v3/reference/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/drive/v3/web/quickstart/python" rel="nofollow noopener noreferrer"&gt;https://developers.google.com/drive/v3/web/quickstart/python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/google_drive_actions" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;&lt;strong&gt;Google Drive Actions (API v3)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple &lt;code&gt;GoogleDriveApplication&lt;/code&gt; class to perform common Google Drive actions such as searching files, downloading entire folders, uploading files, deleting files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;GoogleDriveApplication&lt;/span&gt;

&lt;span class="n"&gt;GD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GoogleDriveApplication&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;path-to-client-secret.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Find files
&lt;/span&gt;&lt;span class="n"&gt;GD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find_files&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello+world&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_folder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# List entire subtree of the specified folder
&lt;/span&gt;&lt;span class="n"&gt;GD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list_folder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google-drive-id-of-folder&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recursive&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Download entire folder
&lt;/span&gt;&lt;span class="n"&gt;GD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;download_folder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;google-drive-id-of-folder&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>watercooler</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Devanagari Transliteration Pipeline for LaTeX</title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Wed, 13 Apr 2022 18:59:18 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/devanagari-transliteration-pipeline-for-latex-1fid</link>
      <guid>https://dev.to/hrishikeshrt/devanagari-transliteration-pipeline-for-latex-1fid</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/devanagari-transliteration-latex"&gt;
        devanagari-transliteration-latex
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Devanagari Transliteration in LaTeX --  Write in Devanagari to render as IAST, Harvard-Kyoto, Velthuis, SLP1, WX etc.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Devanagari Transliteration in LaTeX&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;Write in Devanagari to render as IAST, Harvard-Kyoto, Velthuis, SLP1, WX etc.&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Devanagari text can be transliterated in various &lt;a href="https://en.wikipedia.org/wiki/Devanagari_transliteration" rel="nofollow"&gt;standard schemes&lt;/a&gt;. There exist several input systems based on these transliteration schemes to enable users easily input the text. More often than not, a user has a preference of scheme to type the input in. Similarly, at times, one faces a need to render it in a different scheme in the PDF document.&lt;/p&gt;
&lt;p&gt;In my case, I prefer using &lt;a href="https://launchpad.net/ubuntu/+source/ibus-m17n" rel="nofollow"&gt;&lt;code&gt;ibus-m17n&lt;/code&gt;&lt;/a&gt; to type text in Devanagari. While writing articles that contain Devanagari text, I also faced the need to render the text as IAST in the final PDF
One could always learn to input text in another input scheme, but that may get tedious. Similarly, transliterating each word using online systems such as &lt;a href="https://aksharamukha.appspot.com/converter" rel="nofollow"&gt;Aksharamukha&lt;/a&gt; can also be a tedious task. So, I was looking for a way…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/devanagari-transliteration-latex"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Devanagari"&gt;Devanagari&lt;/a&gt; is the fourth most widely adopted writing system in the world, primarily used in the Indian subcontinent. The script is being used for more than 120 languages, some of the more notable languages being, Sanskrit, Hindi, Marathi, Pali, Nepali and several variations of these languages.&lt;/p&gt;

&lt;p&gt;Devanagari text can be transliterated in various &lt;a href="https://en.wikipedia.org/wiki/Devanagari_transliteration"&gt;standard schemes&lt;/a&gt;. There exist several input systems based on these transliteration schemes to enable users easily input the text. More often than not, a user has a preference of scheme to type the input in. Similarly, at times, one faces a need to render it in a different scheme in the PDF document.&lt;/p&gt;

&lt;p&gt;In my case, I prefer using &lt;a href="https://launchpad.net/ubuntu/+source/ibus-m17n"&gt;&lt;code&gt;ibus-m17n&lt;/code&gt;&lt;/a&gt; to type text in Devanagari. While writing articles that contain Devanagari text, I also faced the need to render the text as IAST in the final PDF.&lt;br&gt;
One could always learn to input text in another input scheme, but that may get tedious. Similarly, transliterating each word using online systems such as &lt;a href="https://aksharamukha.appspot.com/converter"&gt;Aksharamukha&lt;/a&gt; can also be a tedious task. So, I was looking for a way where I can type in Devanagari, and have it rendered in IAST after PDF compilation. As a solution, I came up with a system consisting of a small set of LaTeX commands to add custom syntax to LaTeX and a python transliteration script (based on &lt;a href="http://pypi.org/indic-transliteration"&gt;&lt;code&gt;indic-transliteration&lt;/code&gt;&lt;/a&gt; package) to serve as a middle-layer and process the LaTeX file to create a new LaTeX file with proper transliteration.&lt;/p&gt;
&lt;h2&gt;
  
  
  LaTeX Compilation System with Transliteration Support
&lt;/h2&gt;

&lt;p&gt;There are two primary components to the system,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;LaTeX Synatx&lt;/li&gt;
&lt;li&gt;Transliteration Script&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  LaTeX Syntax
&lt;/h3&gt;

&lt;p&gt;XeTeX (&lt;code&gt;xelatex&lt;/code&gt;) and LuaTeX (&lt;code&gt;lualatex&lt;/code&gt;) have good unicode support and can be used to write Devanagari text. In the current example, I mention the setup with XeTeX.&lt;/p&gt;

&lt;p&gt;We first add the required packages in the preamble of the LaTeX (&lt;code&gt;.tex&lt;/code&gt;) file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tex"&gt;&lt;code&gt;&lt;span class="c"&gt;% This assumes your files are encoded as UTF8&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[utf8]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;inputenc&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% Devanagari Related Packages&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;fontspec, xunicode, xltxtra&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using &lt;code&gt;fontspec&lt;/code&gt;, we can define environments for font families, to write text in specific scripts. To write Devanagari text, one needs to have a Devanagari font available. (It is assumed here that one may need to write both in Devanagari as well as other transliteration schemes.)&lt;/p&gt;

&lt;p&gt;For more on Devanagari fonts, you may check the fonts section of this document. In this section, it is assumed that &lt;code&gt;Sanskrit 2003&lt;/code&gt; font is installed in the system.&lt;/p&gt;

&lt;p&gt;To define the environments as mentioned earlier, we add the following lines in the preamble.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tex"&gt;&lt;code&gt;&lt;span class="c"&gt;% Define Fonts&lt;/span&gt;
&lt;span class="k"&gt;\newfontfamily\textskt&lt;/span&gt;&lt;span class="na"&gt;[Script=Devanagari]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;Sanskrit 2003&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\newfontfamily\textiast&lt;/span&gt;&lt;span class="na"&gt;[Script=Latin]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;Sanskrit 2003&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% Commands for Devanagari Transliterations&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\skt&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textskt&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\iast&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textiast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\Iast&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textiast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\IAST&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textiast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This provides us with four commands. &lt;code&gt;\skt{}&lt;/code&gt; can be used to render Devanagari text. &lt;code&gt;\iast{}&lt;/code&gt;, &lt;code&gt;\Iast{}&lt;/code&gt; and &lt;code&gt;\IAST{}&lt;/code&gt; can be used to render devanagari text in IAST format in lower case, title case and upper case respectively. It should be noted that from the perspective of LaTeX engine, the commands &lt;code&gt;\iast{}&lt;/code&gt;, &lt;code&gt;\Iast{}&lt;/code&gt; and &lt;code&gt;\IAST{}&lt;/code&gt; are identical. They are just different syntactically to aid the python script to perform transliteration and apply appropriate modifications.&lt;br&gt;
It should further be noted that we can define new font families and new commands for any of the valid schemes as per the requirement, which can potentially give us additional commands such &lt;code&gt;\velthuis{}&lt;/code&gt;, &lt;code&gt;\hk{}&lt;/code&gt; and so on.&lt;/p&gt;
&lt;h3&gt;
  
  
  Minimal Example
&lt;/h3&gt;

&lt;p&gt;Equipped with these commands, and some Devanagari text, we have a minimal example as follows, stored in the file &lt;code&gt;minimal.tex&lt;/code&gt;,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tex"&gt;&lt;code&gt;&lt;span class="k"&gt;\documentclass&lt;/span&gt;&lt;span class="na"&gt;[10pt]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;article&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% This assumes your files are encoded as UTF8&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[utf8]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;inputenc&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% Devanagari Related Packages&lt;/span&gt;
&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;fontspec, xunicode, xltxtra&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% Define Fonts&lt;/span&gt;
&lt;span class="k"&gt;\newfontfamily\textskt&lt;/span&gt;&lt;span class="na"&gt;[Script=Devanagari]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;Sanskrit 2003&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\newfontfamily\textiast&lt;/span&gt;&lt;span class="na"&gt;[Script=Latin]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;Sanskrit 2003&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% Commands for Devanagari Transliterations&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\skt&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textskt&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\iast&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textiast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\Iast&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textiast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;span class="k"&gt;\newcommand&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;\IAST&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;[1]&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="k"&gt;\textiast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;#1&lt;span class="p"&gt;}}}&lt;/span&gt;

&lt;span class="k"&gt;\title&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;Transliteration of Devanagari Text&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\author&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;Hrishikesh Terdalkar&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;\begin{document}&lt;/span&gt;

&lt;span class="k"&gt;\maketitle&lt;/span&gt;

&lt;span class="k"&gt;\skt&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;को न्वस्मिन् साम्प्रतं लोके गुणवान् कश्च वीर्यवान्।&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\iast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;को न्वस्मिन् साम्प्रतं लोके गुणवान् कश्च वीर्यवान्।&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\Iast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;को न्वस्मिन् साम्प्रतं लोके गुणवान् कश्च वीर्यवान्।&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\IAST&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;को न्वस्मिन् साम्प्रतं लोके गुणवान् कश्च वीर्यवान्।&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;\end{document}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Transliteration Script
&lt;/h3&gt;

&lt;p&gt;The python script is used to perform transliteration and some clean-up on the LaTeX.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;python3 finalize.py minimal.tex final.tex
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This result in the content being transformed in the following way,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tex"&gt;&lt;code&gt;&lt;span class="c"&gt;% ...&lt;/span&gt;

&lt;span class="k"&gt;\skt&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;को न्वस्मिन् साम्प्रतं लोके गुणवान् कश्च वीर्यवान्।&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\iast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;ko nvasmin sāmprataṃ loke guṇavān kaśca vīryavān|&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\Iast&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;Ko Nvasmin Sāmprataṃ Loke Guṇavān Kaśca Vīryavān|&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;\IAST&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;KO NVASMIN SĀMPRATAṂ LOKE GUṆAVĀN KAŚCA VĪRYAVĀN|&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;% ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can now proceed to compile the &lt;code&gt;final.tex&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;xelatex final
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This results in the following output, &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VeuGRoNa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/hrishikeshrt/devanagari-transliteration-latex/master/minimal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VeuGRoNa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/hrishikeshrt/devanagari-transliteration-latex/master/minimal.png" alt="PDF" width="806" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Anatomy of the Transliteration Script
&lt;/h3&gt;

&lt;p&gt;At the core of the transliteration script, there is a function &lt;code&gt;transliterate_between&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;transliterate_between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;start_pattern&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;end_pattern&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;post_hook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Callable&lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;"""Transliterate the text appearing between two patterns

    Only the text appearing between patterns `start_pattern` and `end_pattern`
    it transliterated.
    `start_pattern` and `end_pattern` can appear multiple times in the full
    text, and for every occurrence, the text between them is transliterated.

    `from_scheme` and `to_scheme` should be compatible with scheme names from
    `indic-transliteration`

    Parameters
    ----------
    text : str
        Full text
    from_scheme : str
        Input transliteration scheme
    to_scheme : str
        Output transliteration scheme
    start_pattern : regexp
        Pattern describing the start tag
    end_pattern : regexp
        Pattern describing the end tag
    post_hook : Callable[[str], str], optional
        Function to be applied on the text within tags after transliteration
        The default is `lambda x: x`.

    Returns
    -------
    str
        Text after replacements
    """&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;from_scheme&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;transliterate_match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matchobj&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;matchobj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;replacement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;transliterate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;replacement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;post_hook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;replacement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;start_pattern&lt;/span&gt;&lt;span class="si"&gt;}{&lt;/span&gt;&lt;span class="n"&gt;replacement&lt;/span&gt;&lt;span class="si"&gt;}{&lt;/span&gt;&lt;span class="n"&gt;end_pattern&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;

    &lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"%s(.*?)%s"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;escape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start_pattern&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;escape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end_pattern&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;transliterate_match&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;flags&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DOTALL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can provide the start and end patterns as &lt;code&gt;\iast{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt; respsectively, to transliterate the text enclosed in these tags.&lt;/p&gt;

&lt;p&gt;Using this function, we can write a generic function to work with any transliteration scheme.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;latex_transliteration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;input_text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;"""Transliaterate parts of the LaTeX input enclosed in scheme tags

    A scheme tag is of the form `&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;to_scheme_lowercase{}` and is used
    when the desired output is in `to_scheme`.

    i.e.,
    - Tags for IAST scheme are enclosed in &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;iast{} tags
    - Tags for VH scheme are enclosed in &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;vh{} tags
    - ...

    Parameters
    ----------
    input_text : str
        Input text
    from_scheme : str
        Transliteration scheme of the text written within the input tags
    to_scheme : str
        Transliteration scheme to which the text within tags should be
        transliterated

    Returns
    -------
    str
        Text after replacement of text within the scheme tags
    """&lt;/span&gt;
    &lt;span class="n"&gt;start_tag_pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;end_tag_pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"}"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;transliterate_between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;input_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;start_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;start_tag_pattern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;end_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;end_tag_pattern&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The names of schemes (and therefore the corresponding LaTeX commands) have to conform to the names of schemes used&lt;br&gt;
by the &lt;code&gt;indic-transliteration&lt;/code&gt; package.&lt;/p&gt;

&lt;p&gt;IAST is a case-insensitive transliteration scheme, and as such, we might be interested in specific capitalization of certain words (e.g. proper nouns). We can use the &lt;code&gt;post_hook&lt;/code&gt; argument to provide this function. Using that, we can create a function to handle the three variants of IAST mentioned previously, namely, &lt;code&gt;\iast{}&lt;/code&gt; (lower), &lt;code&gt;\Iast{}&lt;/code&gt; (title) and &lt;code&gt;\IAST{}&lt;/code&gt; (upper).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;devanagari_to_iast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input_text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;"""Transliaterate parts of the input enclosed in
    &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;iast{}, &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;Iast{} or &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;IAST{} tags from Devanagari to IAST

    Text in &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;Iast{} tags also undergoes a `.title()` post-hook.
    Text in &lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;IAST{} tags also undergoes a `.upper()` post-hook.

    Parameters
    ----------
    input_text : str
        Input text

    Returns
    -------
    str
        Text after replacement of text within the IAST tags
    """&lt;/span&gt;
    &lt;span class="n"&gt;intermediate_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;transliterate_between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;input_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sanscript&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVANAGARI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sanscript&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IAST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;start_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;iast{"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;end_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"}"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;intermediate_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;transliterate_between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;intermediate_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sanscript&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVANAGARI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sanscript&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IAST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;start_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;Iast{"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;end_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;post_hook&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;final_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;transliterate_between&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;intermediate_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;from_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sanscript&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DEVANAGARI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;to_scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sanscript&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IAST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;start_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;IAST{"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;end_pattern&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;post_hook&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;final_text&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, there are other utility functions to remove comments and clean excessive whitespaces.&lt;/p&gt;

&lt;h3&gt;
  
  
  Extras
&lt;/h3&gt;

&lt;p&gt;Additionally, we may want some more structure to our setup, such as,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Separation of ontent into multiple files
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tex"&gt;&lt;code&gt;&lt;span class="k"&gt;\input&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;sections/section&lt;span class="p"&gt;_&lt;/span&gt;devanagari.tex&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\input&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;sections/section&lt;span class="p"&gt;_&lt;/span&gt;iast&lt;span class="p"&gt;_&lt;/span&gt;lower.tex&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\input&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;sections/section&lt;span class="p"&gt;_&lt;/span&gt;iast&lt;span class="p"&gt;_&lt;/span&gt;title.tex&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\input&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;sections/section&lt;span class="p"&gt;_&lt;/span&gt;iast&lt;span class="p"&gt;_&lt;/span&gt;upper.tex&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Bibliography
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tex"&gt;&lt;code&gt;&lt;span class="k"&gt;\bibliographystyle&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;acm&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;\bibliography&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;papers&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Final LaTeX Preparation
&lt;/h4&gt;

&lt;p&gt;We may have used the scheme tags across multiple sections. One option is to apply the transliteration script on every section file, to create a new set of section files and use those to compile the final LaTeX file.&lt;/p&gt;

&lt;p&gt;A simpler solution is available in the form of &lt;code&gt;latexpand&lt;/code&gt; which resolves the &lt;code&gt;\input{}&lt;/code&gt; commands to actually include the content and create a single consolidated LaTeX file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;latexpand main.tex &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;single.tex
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we can run the python script on this file to resolve the transliteration tags.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;python3 finalize.py main.tex final.tex
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Compilation
&lt;/h4&gt;

&lt;p&gt;When working with BibTeX, we often need to multiple times to get the correct rendering of references in the PDF. Usually, this requires&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;xelatex final
bibtex final
xelatex final
xelatex final
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, we can use &lt;code&gt;latexmk&lt;/code&gt; which takes care of the tedious compilation routines and reduces our job to a single command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;latexmk -pdflatex='xelatex %O %S' -pdf -ps- -dvi- final.tex
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another benefit of using &lt;code&gt;latexmk&lt;/code&gt; is, we can clean the numerous files generated by LaTeX engine using a one-liner as well,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;latexmk -c
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Makefile
&lt;/h4&gt;

&lt;p&gt;Finally, we can place all of the console commands together in a &lt;code&gt;Makefile&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="nl"&gt;all&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;.all&lt;/span&gt;

&lt;span class="nl"&gt;.all&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;main.tex sections/*.tex papers.bib&lt;/span&gt;
        latexpand main.tex &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; single.tex
        python3 finalize.py single.tex final.tex

        &lt;span class="err"&gt;latexmk&lt;/span&gt; &lt;span class="nv"&gt;-pdflatex&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'xelatex %O %S'&lt;/span&gt; &lt;span class="nt"&gt;-pdf&lt;/span&gt; &lt;span class="nt"&gt;-ps-&lt;/span&gt; &lt;span class="nt"&gt;-dvi-&lt;/span&gt; final.tex

&lt;span class="nl"&gt;clear&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        latexmk &lt;span class="nt"&gt;-C&lt;/span&gt;
        &lt;span class="nb"&gt;rm &lt;/span&gt;single.tex
        &lt;span class="nb"&gt;rm &lt;/span&gt;final.tex

&lt;span class="nl"&gt;clean&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        latexmk &lt;span class="nt"&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thus, now we can focus on writing content in the &lt;code&gt;.tex&lt;/code&gt; files and once we are done, simply use the command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;make
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;p&gt;We have made use of a number of external tools, and it is required to have these setup prior to the described solution.&lt;/p&gt;

&lt;h4&gt;
  
  
  Minimal Requirements
&lt;/h4&gt;

&lt;p&gt;The minimal example mentioned earlier requires only three things,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;XeLaTeX (unicode support) (included in &lt;a href="https://www.tug.org/texlive/"&gt;TeX Live&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.python.org/downloads/"&gt;Python3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/indic-transliteration/"&gt;&lt;code&gt;indic-transliteration&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Extra Requirements
&lt;/h4&gt;

&lt;p&gt;The extras have some more dependencies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://www.bibtex.org/"&gt;BibTeX&lt;/a&gt; (optional) (bibliography support)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ctan.org/pkg/latexpand?lang=en"&gt;&lt;code&gt;latexpand&lt;/code&gt;&lt;/a&gt; (optional) (resolve &lt;code&gt;\input{}&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://mg.readthedocs.io/latexmk.html"&gt;&lt;code&gt;latexmk&lt;/code&gt;&lt;/a&gt; (optional) (simpler TeX compilation)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Devanagari Fonts
&lt;/h2&gt;

&lt;p&gt;Nowadays, there are several good Devanagari fonts available. Google Fonts also provides a &lt;a href="https://fonts.google.com/?subset=devanagari"&gt;wide variety of Devanagari fonts&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Two of my personal favourites are,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://omkarananda-ashram.org/Sanskrit/itranslator2003.htm#dls"&gt;Sanskrit 2003&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://fonts.google.com/noto/specimen/Noto+Serif+Devanagari"&gt;Noto Serif Devanagari&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;The source code for the entire setup is available at &lt;a href="https://github.com/hrishikeshrt/devanagari-transliteration-latex"&gt;hrishikeshrt/devanagari-transliteration-latex&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>latex</category>
      <category>transliteration</category>
    </item>
    <item>
      <title>pyopendota: Python Package for OPENDOTA API
</title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Fri, 04 Mar 2022 09:33:38 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/pyopendota-python-package-for-opendota-api-5h7o</link>
      <guid>https://dev.to/hrishikeshrt/pyopendota-python-package-for-opendota-api-5h7o</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/pyopendota"&gt;
        pyopendota
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Python wrapper for &amp;lt;OPENDOTA/&amp;gt; API
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="rst"&gt;
&lt;h1&gt;
&amp;lt;OPENDOTA/&amp;gt; API&lt;/h1&gt;
&lt;a href="https://pypi.python.org/pypi/pyopendota" rel="nofollow"&gt;&lt;img alt="https://img.shields.io/pypi/v/pyopendota?color=success" src="https://camo.githubusercontent.com/2bdf87c0c2139e0cddecd4dedcbedcbd0d636e10337dfa522aa353100d9d6612/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f70796f70656e646f74613f636f6c6f723d73756363657373"&gt;&lt;/a&gt;
&lt;a href="https://pyopendota.readthedocs.io/en/latest/?version=latest" rel="nofollow"&gt;&lt;img alt="Documentation Status" src="https://camo.githubusercontent.com/fed107ce79ba967be8cb223a71c5b5a1f41d30a72ea2fb1f7dc9a4b91b09bcbe/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f70796f70656e646f74612f62616467652f3f76657273696f6e3d6c6174657374"&gt;&lt;/a&gt;
&lt;a href="https://pypi.python.org/pypi/pyopendota" rel="nofollow"&gt;&lt;img alt="Python Version Support" src="https://camo.githubusercontent.com/e0d54021eebe33f27e7002e7ec5acb896352a87138d27cd53138b88d97ce4676/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f70796f70656e646f7461"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt/pyopendota/issues"&gt;&lt;img alt="GitHub Issues" src="https://camo.githubusercontent.com/62a6dd7e547bb5b5abbb06c77389caca6d837404477b0f981157ebbb5377e562/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6872697368696b65736872742f70796f70656e646f7461"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt"&gt;&lt;img alt="GitHub Followers" src="https://camo.githubusercontent.com/6af0957501e31aa62f6db660a09c5e705c2d45e003ca0c7966151f991c453d22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/hrishikeshrt" rel="nofollow"&gt;&lt;img alt="Twitter Followers" src="https://camo.githubusercontent.com/6e8bc82231ba92778b6f272def979b2b5669bb1078f2a8531b7322ea39276b79/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;p&gt;A python interface for &amp;lt;OPENDOTA/&amp;gt; API&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;OpenDota&lt;/code&gt; class provided with the package serves as a python
interface for the original OpenDota API in the form of a thin wrapper
The class assumes some familiarity with the OpenDota API.&lt;/p&gt;
&lt;p&gt;All method calls return serializable python objects, as return by the API
in most cases a dict or a list. Response data is stored as JSON in a local
directory (Default: &lt;code&gt;~/dota2&lt;/code&gt;), to prevent the load on OpenDota API.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Free software: MIT license&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://pyopendota.readthedocs.io" rel="nofollow"&gt;https://pyopendota.readthedocs.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Transparent wrapper for majority of the API calls&lt;/li&gt;
&lt;li&gt;Ability to authenticate using API key&lt;/li&gt;
&lt;li&gt;In-built and cusomizable limit to protect against frequent API calls&lt;/li&gt;
&lt;li&gt;Local file-based storage for frequent requests&lt;/li&gt;
&lt;li&gt;Basic CLI using &lt;code&gt;fire&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
Usage&lt;/h2&gt;

&lt;h3&gt;
Use &amp;lt;OPENDOTA/&amp;gt; API in a project&lt;/h3&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;opendota&lt;/span&gt;

&lt;span class="pl-c"&gt;# Initialize the API-connection object&lt;/span&gt;
&lt;span class="pl-s1"&gt;client&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;opendota&lt;/span&gt;.&lt;span class="pl-v"&gt;OpenDota&lt;/span&gt;()&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
Get Common Entities&lt;/h4&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-s1"&gt;client&lt;/span&gt;.&lt;span class="pl-en"&gt;get_matches&lt;/span&gt;(&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/pyopendota"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  About OpenDota API
&lt;/h2&gt;

&lt;p&gt;The OpenDota API provides &lt;a href="https://www.dota2.com/"&gt;Dota 2&lt;/a&gt; related data including advanced match data extracted from match replays. OpenDota API Documentation: &lt;a href="https://docs.opendota.com/"&gt;https://docs.opendota.com/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  About &lt;code&gt;pyopendota&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;OpenDota&lt;/code&gt; class provided with the package serves as a python interface for the original OpenDota API in the form of a thin wrapper. The class assumes some familiarity with the OpenDota API.&lt;/p&gt;

&lt;p&gt;All method calls return serializable python objects, as return by the API, in most cases a dict or a list. Response data is stored as JSON in a local directory (Default: &lt;code&gt;~/dota2&lt;/code&gt;), to prevent the load on OpenDota API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Transparent wrapper for majority of the API calls&lt;/li&gt;
&lt;li&gt;Ability to authenticate using API key&lt;/li&gt;
&lt;li&gt;In-built and cusomizable limit to protect against frequent API calls&lt;/li&gt;
&lt;li&gt;Local file-based storage for frequent requests&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Extra
&lt;/h3&gt;

&lt;p&gt;Apart from the direct API calls, it also lets one "Search by name" for pro players, teams, leagues etc.&lt;/p&gt;

</description>
      <category>python</category>
      <category>dota2</category>
      <category>api</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Py-Stopwatch: Measure execution time of your python code segments</title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Fri, 04 Mar 2022 08:38:45 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/py-stopwatch-measure-execution-time-of-your-python-code-segments-423g</link>
      <guid>https://dev.to/hrishikeshrt/py-stopwatch-measure-execution-time-of-your-python-code-segments-423g</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/py_stopwatch"&gt;
        py_stopwatch
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Python Stopwatch Class
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="rst"&gt;
&lt;h1&gt;
py-stopwatch&lt;/h1&gt;
&lt;a href="https://pypi.python.org/pypi/py_stopwatch" rel="nofollow"&gt;&lt;img alt="https://img.shields.io/pypi/v/py-stopwatch?color=success" src="https://camo.githubusercontent.com/b6a3226c5ca8a94368f476f7b8e0d10aba95b73004b5ab97f7f7d6e5a6e67e06/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f70792d73746f7077617463683f636f6c6f723d73756363657373"&gt;&lt;/a&gt;
&lt;a href="https://py-stopwatch.readthedocs.io/en/latest/?badge=latest" rel="nofollow"&gt;&lt;img alt="Documentation Status" src="https://camo.githubusercontent.com/dd16d102e07da9dec390c2c3d9f16c6fff5ae9e85aaa38c7068a8ca3a96f2f00/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f70792d73746f7077617463682f62616467652f3f76657273696f6e3d6c6174657374"&gt;&lt;/a&gt;
&lt;a href="https://pypi.python.org/pypi/py-stopwatch" rel="nofollow"&gt;&lt;img alt="Python Version Support" src="https://camo.githubusercontent.com/cbaf3e91c5c2cc467a47de72b47a04a3d75310bcd108d0b5f1e93744f679fd17/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f70792d73746f707761746368"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt/py_stopwatch/issues"&gt;&lt;img alt="GitHub Issues" src="https://camo.githubusercontent.com/8a18c1541c99f113526b59202f92d75a96211683d6174279e5bdc6e604ce8c3d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6872697368696b65736872742f70795f73746f707761746368"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt"&gt;&lt;img alt="GitHub Followers" src="https://camo.githubusercontent.com/6af0957501e31aa62f6db660a09c5e705c2d45e003ca0c7966151f991c453d22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/hrishikeshrt" rel="nofollow"&gt;&lt;img alt="Twitter Followers" src="https://camo.githubusercontent.com/6e8bc82231ba92778b6f272def979b2b5669bb1078f2a8531b7322ea39276b79/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;p&gt;Stopwatch class for timing portions of python code.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Free software: MIT license&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://py-stopwatch.readthedocs.io" rel="nofollow"&gt;https://py-stopwatch.readthedocs.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Tick-based stopwatch&lt;/li&gt;
&lt;li&gt;Support for Pause/Resume&lt;/li&gt;
&lt;li&gt;Support for multiple named-ticks&lt;/li&gt;
&lt;li&gt;Utility functions for time between different ticks&lt;/li&gt;
&lt;li&gt;No third party requirements.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s1"&gt;stopwatch&lt;/span&gt; &lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-v"&gt;Stopwatch&lt;/span&gt;
&lt;span class="pl-s1"&gt;t&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-v"&gt;Stopwatch&lt;/span&gt;()
&lt;span class="pl-s1"&gt;t&lt;/span&gt;.&lt;span class="pl-en"&gt;start&lt;/span&gt;()
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;"Started .."&lt;/span&gt;)
&lt;span class="pl-s1"&gt;time&lt;/span&gt;.&lt;span class="pl-en"&gt;sleep&lt;/span&gt;(&lt;span class="pl-c1"&gt;0.24&lt;/span&gt;)
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;f"t.tick(): &lt;span class="pl-s1"&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt;&lt;span class="pl-s1"&gt;t&lt;/span&gt;.&lt;span class="pl-en"&gt;tick&lt;/span&gt;():.4f&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/span&gt; seconds"&lt;/span&gt;)
&lt;span class="pl-s1"&gt;time&lt;/span&gt;.&lt;span class="pl-en"&gt;sleep&lt;/span&gt;(&lt;span class="pl-c1"&gt;0.48&lt;/span&gt;)
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;f"t.tick(): &lt;span class="pl-s1"&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt;&lt;span class="pl-s1"&gt;t&lt;/span&gt;.&lt;span class="pl-en"&gt;tick&lt;/span&gt;():.4f&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/span&gt; seconds"&lt;/span&gt;)
&lt;span class="pl-s1"&gt;time&lt;/span&gt;.&lt;span class="pl-en"&gt;sleep&lt;/span&gt;(&lt;span class="pl-c1"&gt;0.16&lt;/span&gt;)
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;f"t.tick('Named Tick-1'): &lt;span class="pl-s1"&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt;&lt;span class="pl-s1"&gt;t&lt;/span&gt;.&lt;span class="pl-en"&gt;tick&lt;/span&gt;(&lt;span class="pl-s"&gt;'Named Tick-1'&lt;/span&gt;):.4f&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/span&gt; seconds"&lt;/span&gt;)
&lt;span class="pl-s1"&gt;t&lt;/span&gt;.&lt;span class="pl-en"&gt;pause&lt;/span&gt;()
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;"Paused .."&lt;/span&gt;)
&lt;span class="pl-s1"&gt;time&lt;/span&gt;.&lt;span class="pl-en"&gt;sleep&lt;/span&gt;(&lt;span class="pl-c1"&gt;0.12&lt;/span&gt;)
&lt;span class="pl-s1"&gt;t&lt;/span&gt;.&lt;span class="pl-en"&gt;resume&lt;/span&gt;()
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;"Resumed .."&lt;/span&gt;)
&lt;span class="pl-en"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;f"t.last(): &lt;span class="pl-s1"&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt;&lt;span class="pl-s1"&gt;t&lt;/span&gt;.&lt;span class="pl-en"&gt;last&lt;/span&gt;():.4f&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/span&gt; seconds"&lt;/span&gt;)
&lt;span class="pl-s1"&gt;time&lt;/span&gt;.&lt;span class="pl-en"&gt;sleep&lt;/span&gt;(&lt;span class="pl-c1"&gt;0.12&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/py_stopwatch"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tick-based stopwatch.&lt;/li&gt;
&lt;li&gt;Support for Pause / Resume.&lt;/li&gt;
&lt;li&gt;Support for multiple named-ticks.&lt;/li&gt;
&lt;li&gt;Utility functions for time between different ticks.&lt;/li&gt;
&lt;li&gt;No third party requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;stopwatch&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Stopwatch&lt;/span&gt;
&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Stopwatch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Started .."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.24&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"t.tick(): &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;():.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.48&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"t.tick(): &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;():.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"t.tick('Named Tick-1'): &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Named Tick-1'&lt;/span&gt;&lt;span class="p"&gt;):.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pause&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Paused .."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;resume&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Resumed .."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"t.last(): &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;():.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"t.tick(): &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;():.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"t.tick('Named Tick-2'): &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Named Tick-2'&lt;/span&gt;&lt;span class="p"&gt;):.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Timer stopped."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"---"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Total pause: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time_paused&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Total runtime: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time_active&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Total time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time_total&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; seconds."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;tij&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;time_elapsed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Named Tick-1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'Named Tick-2'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Time between 'Named Tick-1' and 'Named Tick-2': &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tij&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>performance</category>
      <category>stopwatch</category>
    </item>
    <item>
      <title>Elegant WebApp Template using Flask + Bootstrap + PythonAnywhere</title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Thu, 03 Mar 2022 09:40:21 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/elegant-webapp-template-using-flask-bootstrap-pythonanywhere-4b8d</link>
      <guid>https://dev.to/hrishikeshrt/elegant-webapp-template-using-flask-bootstrap-pythonanywhere-4b8d</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt" rel="noopener noreferrer"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/flask-bootstrap-anywhere" rel="noopener noreferrer"&gt;
        flask-bootstrap-anywhere
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Quickly set up a web-based application using Flask styled with Bootstrap and deploy on PythonAnywhere
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Flask-Bootstrap-Anywhere&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;This is a skeleton application written in python using Flask microframework
It comes with support for user registration, login, session management
password recovery, password reset and database connection.
These features are achieved by &lt;code&gt;Flask-Security-Too&lt;/code&gt;, which in turn achieves
them by various flask extensions such as &lt;code&gt;Flask-Login&lt;/code&gt;, &lt;code&gt;Flask-WTF&lt;/code&gt; etc.
Front-end styling is done using &lt;code&gt;Bootstrap&lt;/code&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Motivation&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;In general, many web applications require some level of user-management.
While &lt;code&gt;Django&lt;/code&gt; can be suitable for big projects, for relatively small projects
it might be an overkill. Further, &lt;code&gt;Flask&lt;/code&gt; offers more flexibility.
However, with &lt;code&gt;Flask&lt;/code&gt; being a "microframework", we have to choose from a variety
of plugins to build a working system.&lt;/p&gt;
&lt;p&gt;This application fits together a handful of such commonly used plugins
for commonly required tasks, and aims to save developers' effort.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Back-end&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;User Management
&lt;ul&gt;
&lt;li&gt;Registration&lt;/li&gt;
&lt;li&gt;Login&lt;/li&gt;
&lt;li&gt;Session Management&lt;/li&gt;
&lt;li&gt;Password Recovery&lt;/li&gt;
&lt;li&gt;Roles&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Database Support
&lt;ul&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;li&gt;MongoDB (incomplete)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Mail&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/flask-bootstrap-anywhere" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Motivation
&lt;/h2&gt;

&lt;p&gt;In general, many web applications require some level of user-management.&lt;br&gt;
While &lt;code&gt;Django&lt;/code&gt; can be suitable for big projects, for relatively small projects&lt;br&gt;
it might be an overkill. Further, &lt;code&gt;Flask&lt;/code&gt; offers more flexibility.&lt;br&gt;
However, with &lt;code&gt;Flask&lt;/code&gt; being a "microframework", we have to choose from a variety&lt;br&gt;
of plugins to build a working system.&lt;/p&gt;

&lt;p&gt;This application fits together a handful of such commonly used plugins&lt;br&gt;
for commonly required tasks, and aims to save developers' effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Back-end
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;User Management

&lt;ul&gt;
&lt;li&gt;Registration&lt;/li&gt;
&lt;li&gt;Login&lt;/li&gt;
&lt;li&gt;Session Management&lt;/li&gt;
&lt;li&gt;Password Recovery&lt;/li&gt;
&lt;li&gt;Roles&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Database Support

&lt;ul&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Mail&lt;/li&gt;

&lt;li&gt;Migrations (Powered by &lt;code&gt;Flask-Migrate&lt;/code&gt;)&lt;/li&gt;

&lt;li&gt;Deployment

&lt;ul&gt;
&lt;li&gt;Support for Git-powered release on on &lt;code&gt;PythonAnywhere&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Front-end
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Bootstrap&lt;/code&gt;-powered clean front-end&lt;/li&gt;
&lt;li&gt;Elegant themes powered by &lt;a href="https://bootswatch.com/" rel="noopener noreferrer"&gt;https://bootswatch.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ability to change themes on the fly&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>bootstrap</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Wordle CLI</title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Thu, 03 Mar 2022 09:30:37 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/wordle-cli-3644</link>
      <guid>https://dev.to/hrishikeshrt/wordle-cli-3644</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/python-wordle"&gt;
        python-wordle
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Wordle in Python -- Game, Solver and Helper! Play Wordle on the terminal. Optionally, let WordleSolver play it out for you! Use WordleSolver's help for solving your Wordles provided by other platforms.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="rst"&gt;
&lt;h1&gt;
Wordle&lt;/h1&gt;
&lt;a href="https://pypi.python.org/pypi/python-wordle" rel="nofollow"&gt;&lt;img alt="https://img.shields.io/pypi/v/python-wordle?color=success" src="https://camo.githubusercontent.com/f56cdd3e6caac72221ce7859fe54242f4f4f58138c76e6ae99431df40b628d1d/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f707974686f6e2d776f72646c653f636f6c6f723d73756363657373"&gt;&lt;/a&gt;
&lt;a href="https://python-wordle.readthedocs.io/en/latest/?version=latest" rel="nofollow"&gt;&lt;img alt="Documentation Status" src="https://camo.githubusercontent.com/85d04a2001909258d131335bee9a903a89986fbb77c05946bd7c9df525c7cf5b/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f707974686f6e2d776f72646c652f62616467652f3f76657273696f6e3d6c6174657374"&gt;&lt;/a&gt;
&lt;a href="https://pypi.python.org/pypi/python-wordle" rel="nofollow"&gt;&lt;img alt="Python Version Support" src="https://camo.githubusercontent.com/ddd569ee6567562b9d4c55abfecd761eabca513b4356fc95eb148bae95cbe517/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f707974686f6e2d776f72646c65"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt/python-wordle/issues"&gt;&lt;img alt="GitHub Issues" src="https://camo.githubusercontent.com/6208d9bb3a0cfb522f84e4e71eaadcd3ac0d4b7287db3118c54fba7d3bb4eae4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6872697368696b65736872742f707974686f6e2d776f72646c65"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt"&gt;&lt;img alt="GitHub Followers" src="https://camo.githubusercontent.com/6af0957501e31aa62f6db660a09c5e705c2d45e003ca0c7966151f991c453d22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/hrishikeshrt" rel="nofollow"&gt;&lt;img alt="Twitter Followers" src="https://camo.githubusercontent.com/6e8bc82231ba92778b6f272def979b2b5669bb1078f2a8531b7322ea39276b79/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;p&gt;Wordle -- Game, Solver and Helper!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Free software: GNU General Public License v3&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://python-wordle.readthedocs.io" rel="nofollow"&gt;https://python-wordle.readthedocs.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;dl&gt;
&lt;dt&gt;Comprehensive CLI Application&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;Play Wordle in your terminal!&lt;/li&gt;
&lt;li&gt;Let the solver play it out for you!&lt;/li&gt;
&lt;li&gt;Use the helper mode for solving Wordles provided by other platforms!&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;dl&gt;
&lt;dt&gt;New Wordle every day.&lt;/dt&gt;
&lt;dd&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Disclaimer&lt;/strong&gt;: This has nothing to do with the NYTimes Wordle.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;Play more using &lt;code&gt;--random&lt;/code&gt; option.&lt;/li&gt;
&lt;li&gt;Reproducible random Wordle by specifying &lt;code&gt;--seed&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WordleSolver()&lt;/code&gt; class for solving Wordle.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--solve&lt;/code&gt; option to let &lt;code&gt;WordleSolver()&lt;/code&gt; do its work in front of your eyes!&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--helper&lt;/code&gt; option to activate the helper mode for help with solving Wordles provided by other platforms.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Install&lt;/h2&gt;
&lt;p&gt;To install, run this command in your terminal:&lt;/p&gt;
&lt;div class="highlight highlight-text-shell-session position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ &lt;span class="pl-s1"&gt;pip install python-wordle&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;div class="highlight highlight-text-shell-session position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c1"&gt;usage: wordle [-h] [--random] [--seed SEED] [--solve] [--helper]&lt;/span&gt;
&lt;span class="pl-c1"&gt;Wordle on your terminal&lt;/span&gt;

&lt;span class="pl-c1"&gt;optional arguments:&lt;/span&gt;
&lt;span class="pl-c1"&gt;-h, --help   show this help message and exit&lt;/span&gt;
&lt;span class="pl-c1"&gt;--random     Show a random Wordle&lt;/span&gt;
&lt;span class="pl-c1"&gt;--seed SEED  Seed&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/python-wordle"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://pypi.org/project/python-wordle/"&gt;&lt;code&gt;python-wordle&lt;/code&gt;&lt;/a&gt; is a Wordle toolkit containing the game, a solver and a helper! &lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hM_zLQ-K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/hrishikeshrt/python-wordle/master/screenshot.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hM_zLQ-K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/hrishikeshrt/python-wordle/master/screenshot.png" alt="Example" width="880" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Comprehensive CLI Application

&lt;ul&gt;
&lt;li&gt;Play Wordle in your terminal!&lt;/li&gt;
&lt;li&gt;Let the solver play it out for you!&lt;/li&gt;
&lt;li&gt;Use the helper mode for solving Wordles provided by other platforms!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;New Wordle every day.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Disclaimer&lt;/strong&gt;: This has nothing to do with the NYTimes Wordle.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Play more using &lt;code&gt;--random&lt;/code&gt; option.&lt;/li&gt;
&lt;li&gt;Reproducible random Wordle by specifying &lt;code&gt;--seed&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WordleSolver()&lt;/code&gt; class for solving Wordle.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--solve&lt;/code&gt; option to let &lt;code&gt;WordleSolver()&lt;/code&gt; do its work in front of your eyes!&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--helper&lt;/code&gt; option to activate the helper mode for help with solving Wordles provided by other platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;To install, run this command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;pip install python-wordle
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;
usage: wordle [-h] [--random] [--seed SEED] [--solve] [--helper]

Wordle on your terminal

optional arguments:
  -h, --help   show this help message and exit
  --random     Show a random Wordle
  --seed SEED  Seed the RNG
  --solve      Simulate WordleSolver
  --helper     Take help from WordleSolver for a Wordle in a different platform
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>wordle</category>
      <category>python</category>
      <category>cli</category>
      <category>solve</category>
    </item>
    <item>
      <title>PyCDSL -  Python Interface to Cologne Digital Sanskrit Lexicon (CDSL) </title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Thu, 03 Mar 2022 09:22:52 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/pycdsl-python-interface-to-cologne-digital-sanskrit-lexicon-cdsl-3jji</link>
      <guid>https://dev.to/hrishikeshrt/pycdsl-python-interface-to-cologne-digital-sanskrit-lexicon-cdsl-3jji</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/PyCDSL"&gt;
        PyCDSL
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Python Interface to Cologne Digital Sanskrit Lexicon (CDSL)
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="rst"&gt;
&lt;h1&gt;
PyCDSL&lt;/h1&gt;
&lt;a href="https://pypi.python.org/pypi/PyCDSL" rel="nofollow"&gt;&lt;img alt="https://img.shields.io/pypi/v/PyCDSL?color=success" src="https://camo.githubusercontent.com/0cb46109c72f6aa5a59fe942d601d6daa2c0d67cf9b05e8f42e934036338652c/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f50794344534c3f636f6c6f723d73756363657373"&gt;&lt;/a&gt;
&lt;a href="https://pycdsl.readthedocs.io/en/latest/?version=latest" rel="nofollow"&gt;&lt;img alt="Documentation Status" src="https://camo.githubusercontent.com/b348d652f50bc1f71703b0aabcf0f368c52a01ce0d4a8eefa1e75e7d8a6300dc/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f70796364736c2f62616467652f3f76657273696f6e3d6c6174657374"&gt;&lt;/a&gt;
&lt;a href="https://pypi.python.org/pypi/PyCDSL" rel="nofollow"&gt;&lt;img alt="Python Version Support" src="https://camo.githubusercontent.com/3091714f73623d292f88eed200df497ff073c9f6da5711acada92b6b64253160/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f50794344534c"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt/PyCDSL/issues"&gt;&lt;img alt="GitHub Issues" src="https://camo.githubusercontent.com/6457c3076942982ec8a6a17028a62222fec79207666052552a97667f15bbeeb0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6872697368696b65736872742f50794344534c"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt"&gt;&lt;img alt="GitHub Followers" src="https://camo.githubusercontent.com/6af0957501e31aa62f6db660a09c5e705c2d45e003ca0c7966151f991c453d22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/hrishikeshrt" rel="nofollow"&gt;&lt;img alt="Twitter Followers" src="https://camo.githubusercontent.com/6e8bc82231ba92778b6f272def979b2b5669bb1078f2a8531b7322ea39276b79/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;p&gt;PyCDSL is a python interface to &lt;a href="https://www.sanskrit-lexicon.uni-koeln.de/" rel="nofollow"&gt;Cologne Digital Sanskrit Lexicon (CDSL)&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Free software: GNU General Public License v3&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://pycdsl.readthedocs.io" rel="nofollow"&gt;https://pycdsl.readthedocs.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CDSL Corpus Management (Download, Update, Access)&lt;/li&gt;
&lt;li&gt;Unified Programmable Interface to access all dictionaries available at CDSL&lt;/li&gt;
&lt;li&gt;Console Command and REPL Interface for easy dictionary search&lt;/li&gt;
&lt;li&gt;Extensive support for transliteration using &lt;code&gt;indic-transliteration&lt;/code&gt; module&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Install&lt;/h2&gt;
&lt;p&gt;To install PyCDSL, run this command in your terminal:&lt;/p&gt;
&lt;div class="highlight highlight-text-shell-session position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ &lt;span class="pl-s1"&gt;pip install PyCDSL&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;p&gt;PyCDSL can be used in a python project, as a console command and
as an interactive REPL interface.&lt;/p&gt;

&lt;h3&gt;
Using PyCDSL in a Project&lt;/h3&gt;
&lt;p&gt;Import PyCDSL in a project:&lt;/p&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;pycdsl&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Create a CDSLCorpus Instance:&lt;/p&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;# Default installation at ~/cdsl_data&lt;/span&gt;
&lt;span class="pl-v"&gt;CDSL&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;pycdsl&lt;/span&gt;.&lt;span class="pl-v"&gt;CDSLCorpus&lt;/span&gt;()
&lt;span class="pl-c"&gt;# Custom installation path can be specified with argument `data_dir`&lt;/span&gt;
&lt;span class="pl-c"&gt;# e.g. CDSL = pycdsl.CDSLCorpus(data_dir="custom-installation-path")&lt;/span&gt;

&lt;span class="pl-c"&gt;# Custom transliteration schemes for input and output can be specified&lt;/span&gt;
&lt;span class="pl-c"&gt;# with arguments `input_scheme` and `output_scheme`.&lt;/span&gt;
&lt;span class="pl-c"&gt;# Values&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/PyCDSL"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>dictionary</category>
      <category>tooling</category>
      <category>sanskrit</category>
      <category>python</category>
    </item>
    <item>
      <title>Perform OCR using Google's Drive API v3</title>
      <dc:creator>Hrishikesh Terdalkar</dc:creator>
      <pubDate>Thu, 03 Mar 2022 09:20:37 +0000</pubDate>
      <link>https://dev.to/hrishikeshrt/perform-ocr-using-googles-drive-api-v3-134a</link>
      <guid>https://dev.to/hrishikeshrt/perform-ocr-using-googles-drive-api-v3-134a</guid>
      <description>&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/hrishikeshrt"&gt;
        hrishikeshrt
      &lt;/a&gt; / &lt;a href="https://github.com/hrishikeshrt/google_drive_ocr"&gt;
        google_drive_ocr
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Perform OCR using Google's Drive API v3
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="rst"&gt;
&lt;h1&gt;
Google OCR (Drive API v3)&lt;/h1&gt;
&lt;a href="https://pypi.python.org/pypi/google_drive_ocr" rel="nofollow"&gt;&lt;img alt="https://img.shields.io/pypi/v/google_drive_ocr?color=success" src="https://camo.githubusercontent.com/43b9138592eb7671482c5879f848cfb4e92f25abdffda30a21a07122d47ed1ab/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f676f6f676c655f64726976655f6f63723f636f6c6f723d73756363657373"&gt;&lt;/a&gt;
&lt;a href="https://google-drive-ocr.readthedocs.io/en/latest/?version=latest" rel="nofollow"&gt;&lt;img alt="Documentation Status" src="https://camo.githubusercontent.com/7a84ec4c4fb3282efd505f240482f551999e80ea986ae993d50d4d5e77fdf406/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f676f6f676c652d64726976652d6f63722f62616467652f3f76657273696f6e3d6c6174657374"&gt;&lt;/a&gt;
&lt;a href="https://pypi.python.org/pypi/google_drive_ocr" rel="nofollow"&gt;&lt;img alt="Python Version Support" src="https://camo.githubusercontent.com/0aa039fb95f126d71bb721a6ea6b21f8649b4b81175ed421f264df62d7495080/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f676f6f676c655f64726976655f6f6372"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt/google_drive_ocr/issues"&gt;&lt;img alt="GitHub Issues" src="https://camo.githubusercontent.com/a4070dfd7d744ba735bfb943db366b201509f34673b54115af6134ae2a8c9b32/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6872697368696b65736872742f676f6f676c655f64726976655f6f6372"&gt;&lt;/a&gt;
&lt;a href="https://github.com/hrishikeshrt"&gt;&lt;img alt="GitHub Followers" src="https://camo.githubusercontent.com/6af0957501e31aa62f6db660a09c5e705c2d45e003ca0c7966151f991c453d22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f6c6c6f776572732f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/hrishikeshrt" rel="nofollow"&gt;&lt;img alt="Twitter Followers" src="https://camo.githubusercontent.com/6e8bc82231ba92778b6f272def979b2b5669bb1078f2a8531b7322ea39276b79/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6872697368696b65736872743f7374796c653d736f6369616c"&gt;&lt;/a&gt;
&lt;p&gt;Perform OCR using Google's Drive API v3&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Free software: GNU General Public License v3&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://google-drive-ocr.readthedocs.io" rel="nofollow"&gt;https://google-drive-ocr.readthedocs.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Perform OCR using Google's Drive API v3&lt;/li&gt;
&lt;li&gt;Class &lt;code&gt;GoogleOCRApplication()&lt;/code&gt; for use in projects&lt;/li&gt;
&lt;li&gt;Highly configurable CLI&lt;/li&gt;
&lt;li&gt;Run OCR on a single image file&lt;/li&gt;
&lt;li&gt;Run OCR on multiple image files&lt;/li&gt;
&lt;li&gt;Run OCR on all images in directory&lt;/li&gt;
&lt;li&gt;Use multiple workers (&lt;code&gt;multiprocessing&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Work on a PDF document directly&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;h3&gt;
Using in a Project&lt;/h3&gt;
&lt;p&gt;Create a &lt;code&gt;GoogleOCRApplication&lt;/code&gt; application instance:&lt;/p&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s1"&gt;google_drive_ocr&lt;/span&gt; &lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-v"&gt;GoogleOCRApplication&lt;/span&gt;

&lt;span class="pl-s1"&gt;app&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-v"&gt;GoogleOCRApplication&lt;/span&gt;(&lt;span class="pl-s"&gt;'client_secret.json'&lt;/span&gt;)&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Perform OCR on a single image:&lt;/p&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-s1"&gt;app&lt;/span&gt;.&lt;span class="pl-en"&gt;perform_ocr&lt;/span&gt;(&lt;span class="pl-s"&gt;'image.png'&lt;/span&gt;)&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Perform OCR on mupltiple images:&lt;/p&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-s1"&gt;app&lt;/span&gt;.&lt;span class="pl-en"&gt;perform_batch_ocr&lt;/span&gt;([&lt;span class="pl-s"&gt;'image_1.png'&lt;/span&gt;, &lt;span class="pl-s"&gt;'image_2.png'&lt;/span&gt;, &lt;span class="pl-s"&gt;'image_3.png'&lt;/span&gt;])&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Perform OCR on multiple images using multiple workers (&lt;code&gt;multiprocessing&lt;/code&gt;):&lt;/p&gt;
&lt;div class="highlight highlight-source-python position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-s1"&gt;app&lt;/span&gt;.&lt;span class="pl-en"&gt;perform_batch_ocr&lt;/span&gt;([&lt;span class="pl-s"&gt;'image_1.png'&lt;/span&gt;, &lt;span class="pl-s"&gt;'image_3.png'&lt;/span&gt;, &lt;span class="pl-s"&gt;'image_2.png'&lt;/span&gt;], &lt;span class="pl-s1"&gt;workers&lt;/span&gt;&lt;span class="pl-c1"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;2&lt;/span&gt;)&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
Using Command Line Interface&lt;/h3&gt;
&lt;p&gt;Typical usage with…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/hrishikeshrt/google_drive_ocr"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Google's Drive API can be used to perform OCR on images from any language. &lt;a href="https://pypi.org/project/google-drive-ocr/"&gt;&lt;code&gt;google-drive-ocr&lt;/code&gt;&lt;/a&gt; is a python package that allows users to do this with utmost ease, right from the terminal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free software: GNU General Public License v3&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://google-drive-ocr.readthedocs.io"&gt;https://google-drive-ocr.readthedocs.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Perform OCR using Google's Drive API v3&lt;/li&gt;
&lt;li&gt;Class &lt;code&gt;GoogleOCRApplication()&lt;/code&gt; for use in projects&lt;/li&gt;
&lt;li&gt;Highly configurable CLI&lt;/li&gt;
&lt;li&gt;Run OCR on a single image file&lt;/li&gt;
&lt;li&gt;Run OCR on multiple image files&lt;/li&gt;
&lt;li&gt;Run OCR on all images in directory&lt;/li&gt;
&lt;li&gt;Use multiple workers (&lt;code&gt;multiprocessing&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Work on a PDF document directly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;To install Google OCR (Drive API v3), run this command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;pip install google-drive-ocr
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: One must setup a Google application and download &lt;code&gt;client_secrets.json&lt;/code&gt; file before using &lt;code&gt;google_drive_ocr&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a project on Google Cloud Platform&lt;/li&gt;
&lt;li&gt;Wizard: &lt;a href="https://console.developers.google.com/start/api?id=drive"&gt;https://console.developers.google.com/start/api?id=drive&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Instructions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/genomics/downloading-credentials-for-api-access"&gt;https://cloud.google.com/genomics/downloading-credentials-for-api-access&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Select application type as "Installed Application"&lt;/li&gt;
&lt;li&gt;Create credentials "OAuth consent screen" --&amp;gt; "OAuth client ID"&lt;/li&gt;
&lt;li&gt;Save &lt;code&gt;client_secret.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Using in a Project
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;GoogleOCRApplication&lt;/code&gt; application instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;google_drive_ocr&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;GoogleOCRApplication&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GoogleOCRApplication&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'client_secret.json'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Perform OCR on a single image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;perform_ocr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'image.png'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Perform OCR on mupltiple images:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;perform_batch_ocr&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s"&gt;'image_1.png'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'image_2.png'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'image_3.png'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Perform OCR on multiple images using multiple workers (&lt;code&gt;multiprocessing&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;perform_batch_ocr&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s"&gt;'image_1.png'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'image_3.png'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'image_2.png'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;workers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using Command Line Interface
&lt;/h3&gt;

&lt;p&gt;Typical usage with several options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr --client-secret client_secret.json \
&lt;/span&gt;&lt;span class="gp"&gt;--upload-folder-id &amp;lt;google-drive-folder-id&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="go"&gt;--image-dir images/ --extension .jpg \
--workers 4 --no-keep
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show help message with the full set of options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr --help
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Configuration
&lt;/h4&gt;

&lt;p&gt;The default location for configuration is &lt;code&gt;~/.gdo.cfg&lt;/code&gt;.&lt;br&gt;
If configuration is written to this location with a set of options,&lt;br&gt;
we don't have to specify those options again on the subsequent runs.&lt;/p&gt;

&lt;p&gt;Save configuration and exit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr --client-secret client_secret.json --write-config ~/.gdo.cfg
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read configuration from a custom location (if it was written to a custom location):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr --config ~/.my_config_file ..
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Performing OCR
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: It is assumed that the &lt;code&gt;client-secret&lt;/code&gt; option is saved in configuration file.&lt;/p&gt;

&lt;p&gt;Single image file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr -i image.png
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiple image files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr -b image_1.png image_2.png image_3.png
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All image files from a directory with a specific extension:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr --image-dir images/ --extension .png
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiple workers (&lt;code&gt;multiprocessing&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr -b image_1.png image_2.png image_3.png --workers 2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PDF files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;google-ocr --pdf document.pdf --pages 1-3 5 7-10 13
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>googledrive</category>
      <category>ocr</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
