<?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: Anindita Basu</title>
    <description>The latest articles on DEV Community by Anindita Basu (@aninditabasu).</description>
    <link>https://dev.to/aninditabasu</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%2F20209%2F7c409cf7-a801-49ab-b72f-1ee9fd936ad3.PNG</url>
      <title>DEV Community: Anindita Basu</title>
      <link>https://dev.to/aninditabasu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aninditabasu"/>
    <language>en</language>
    <item>
      <title>Dictionaries and learning</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Sun, 11 Oct 2020 07:51:41 +0000</pubDate>
      <link>https://dev.to/aninditabasu/dictionaries-and-learning-pnf</link>
      <guid>https://dev.to/aninditabasu/dictionaries-and-learning-pnf</guid>
      <description>&lt;p&gt;Python 🐍 people, I need help 😊&lt;/p&gt;

&lt;p&gt;If you have the time to spare, help me make Mercury better. Mercury 🌑 is a customisable translation app, meant for English learners.&lt;/p&gt;

&lt;p&gt;The issues (all #hacktoberfest eligible) are in this repo 👇🏽 &lt;br&gt;
&lt;/p&gt;
&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--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/AninditaBasu"&gt;
        AninditaBasu
      &lt;/a&gt; / &lt;a href="https://github.com/AninditaBasu/mercury"&gt;
        mercury
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Customisable web app to translate words to English. Uses the Oxford Dictionaries API.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Mercury&lt;/h1&gt;
&lt;p&gt;Mercury is a customisable web app that uses the Oxford Dictionaries API to translate words to English. You enter a word in your language, and are shown a list of their English counterparts and how to pronounce them, together with examples to show how to use the words in English sentences.&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;A customised version of the app, which translates Urdu words to English, is live at &lt;a href="https://tarjuma.herokuapp.com" rel="nofollow"&gt;Tarjuma&lt;/a&gt;.&lt;/strong&gt; 👈&lt;/p&gt;
&lt;p&gt;Customisation instructions are in the Mercury documentation, which also contains a &lt;a href="https://aninditabasu.github.io/mercury/index.html" rel="nofollow"&gt;demo&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Disclaimer: This app is neither developed nor endorsed by Oxford Dictionaries. The code is available as-is, on an MIT license.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;
How to use Mercury&lt;/h1&gt;
&lt;p&gt;The app runs on Python, but you don't need to know Python to use the app or to customise it.&lt;/p&gt;
&lt;h3&gt;
Prerequisites&lt;/h3&gt;
&lt;p&gt;You need a paid API key from &lt;a href="https://developer.oxforddictionaries.com/" rel="nofollow"&gt;Oxford Dictionaries API&lt;/a&gt;. The free plan is adequate for testing purposes but only…&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/AninditaBasu/mercury"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;(sits back and waits for #community magic to float in 🧚🏽‍♀️🧚🏽‍♂️✨)&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>Designing a customisable translation app</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Wed, 13 May 2020 15:54:38 +0000</pubDate>
      <link>https://dev.to/aninditabasu/designing-a-translation-app-1odl</link>
      <guid>https://dev.to/aninditabasu/designing-a-translation-app-1odl</guid>
      <description>&lt;p&gt;There already are so many translation apps out there; why another one?&lt;/p&gt;

&lt;p&gt;Well, because the Oxford Dictionaries API is there 🤷‍♀️&lt;/p&gt;

&lt;p&gt;And, therefore, Mercury was born, targetted towards English-language learners. Mercury translates words to English, shows example usage, and includes a click-to-play pronunciation file.&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Design considerations&lt;/li&gt;
&lt;li&gt;Coding&lt;/li&gt;
&lt;li&gt;Call for action&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Design considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt; Do not overwhelm a language learner with info. Include barest minimum info, and give links for more (target audience: those who've just begun to learn English).&lt;/li&gt;
&lt;li&gt; Make a customisable app, so people can specify which language they want and what text they see on the UI (target audience: people for whom the English language is very very foreign and who, therefore, are more comfortable with a UI in their own language).&lt;/li&gt;
&lt;li&gt; Make the customisation so easy that people who don't know how to code can also download and run the app (target audience: schools and institutes that do not have coders on their rolls but are teaching English as a foreign language).&lt;/li&gt;
&lt;li&gt; Make the app code lightweight (reason: internet connectivity is poor in too many places in the world).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Coding
&lt;/h2&gt;

&lt;p&gt;In Python 🙂 because that's the only language I know.&lt;/p&gt;


&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--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/AninditaBasu"&gt;
        AninditaBasu
      &lt;/a&gt; / &lt;a href="https://github.com/AninditaBasu/mercury"&gt;
        mercury
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Customisable web app to translate words to English. Uses the Oxford Dictionaries API.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Mercury&lt;/h1&gt;
&lt;p&gt;Mercury is a customisable web app that uses the Oxford Dictionaries API to translate words to English. You enter a word in your language, and are shown a list of their English counterparts and how to pronounce them, together with examples to show how to use the words in English sentences.&lt;/p&gt;
&lt;p&gt;👉 &lt;strong&gt;A customised version of the app, which translates Urdu words to English, is live at &lt;a href="https://tarjuma.herokuapp.com" rel="nofollow"&gt;Tarjuma&lt;/a&gt;.&lt;/strong&gt; 👈&lt;/p&gt;
&lt;p&gt;Customisation instructions are in the Mercury documentation, which also contains a &lt;a href="https://aninditabasu.github.io/mercury/index.html" rel="nofollow"&gt;demo&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Disclaimer: This app is neither developed nor endorsed by Oxford Dictionaries. The code is available as-is, on an MIT license.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;
How to use Mercury&lt;/h1&gt;
&lt;p&gt;The app runs on Python, but you don't need to know Python to use the app or to customise it.&lt;/p&gt;
&lt;h3&gt;
Prerequisites&lt;/h3&gt;
&lt;p&gt;You need a paid API key from &lt;a href="https://developer.oxforddictionaries.com/" rel="nofollow"&gt;Oxford Dictionaries API&lt;/a&gt;. The free plan is adequate for testing purposes but only…&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/AninditaBasu/mercury"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Call for action
&lt;/h2&gt;

&lt;p&gt;Please help me make this app better? Your feedback, suggestions, and comments are most welcome, as are PRs. Let's together 🌈 bridge languages.&lt;/p&gt;

</description>
      <category>python</category>
      <category>translations</category>
      <category>community</category>
    </item>
    <item>
      <title>Pushing out an MVP</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Fri, 24 Apr 2020 07:32:53 +0000</pubDate>
      <link>https://dev.to/aninditabasu/pushing-out-an-mvp-3gbe</link>
      <guid>https://dev.to/aninditabasu/pushing-out-an-mvp-3gbe</guid>
      <description>&lt;p&gt;I want to build a chatbot that answers questions about the Mahabharat.&lt;/p&gt;

&lt;p&gt;When I started out, my intention was to build the chatbot (and, subsequently, an API) on a MySQL database with Python. Things didn't work out as planned, however 😄. For starters, my RaspberryPi refused to play nice with MySQL through Python. Yes, I googled. No, nothing worked (yet).&lt;/p&gt;

&lt;p&gt;Meanwhile, I was getting frustrated. Here I was, with tons of data to share with the world, and some stupid technical non-knowledge was standing in my way.&lt;/p&gt;

&lt;p&gt;So, I decided to look for a simpler tech stack and push out an MVP. Doing so will help me in two ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gather feedback on the usefulness of my offering&lt;/li&gt;
&lt;li&gt;Find simpler solutions to technical challenges (did I mention I am not a coder?)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, here's my MVP: &lt;a href="https://mb-verse.herokuapp.com"&gt;https://mb-verse.herokuapp.com&lt;/a&gt;. Its tech-stack uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;json for storing data&lt;/li&gt;
&lt;li&gt;python for processing data&lt;/li&gt;
&lt;li&gt;heroku for hosting
(The code is in a private GitHub repo at the moment because I am not comfortable yet sharing the json files.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please let me know your thoughts regarding the MVP. I am looking for feedback on usability and usefulness. I started a public GitHub repo to gather issues: &lt;a href="https://github.com/AninditaBasu/calm-wildwood"&gt;https://github.com/AninditaBasu/calm-wildwood&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(And, if you don't know about the Mahabharat, you might want to read this summary: &lt;a href="https://www.ancient.eu/Mahabharata/"&gt;https://www.ancient.eu/Mahabharata/&lt;/a&gt;. But even if you don't know the story [and &lt;em&gt;especially&lt;/em&gt; if you dont know the story], your feedback is very welcome because you represent a good user persona: someone who wants to know about a story - any story - that's much loved by some other group. For example, if I haven't seen any Star Wars and there was this chatbot...)&lt;/p&gt;

&lt;p&gt;Let me know what you think 🙂&lt;/p&gt;

</description>
      <category>beta</category>
      <category>mvp</category>
    </item>
    <item>
      <title>How to build a basic website on GitHub with Liquid</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Thu, 05 Mar 2020 13:29:26 +0000</pubDate>
      <link>https://dev.to/aninditabasu/how-to-build-a-basic-website-on-github-with-liquid-jfm</link>
      <guid>https://dev.to/aninditabasu/how-to-build-a-basic-website-on-github-with-liquid-jfm</guid>
      <description>&lt;p&gt;Why this post?&lt;/p&gt;

&lt;p&gt;Because I could not find any resource that tells me how to build a &lt;em&gt;basic&lt;/em&gt; website with Liquid tags on GitHub. Through the GitHub web interface, not through any CLI, whether Jekyll or Git. Without needing to install Jekyll (which isn't officially supported for my Windows machine anyway).&lt;/p&gt;

&lt;p&gt;Also because the official Jekyll documentation (and the official Jekyll tutorial) assumes a level of knowledge that I do not have. Also because all the so-called starter packs I found on GitHub (and through Google) have way too many files to be useful to me as a beginner.&lt;/p&gt;

&lt;p&gt;So, this post.&lt;/p&gt;

&lt;p&gt;This post is for people like me who get frustrated when they encounter something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--042R21-k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ky7gx052x3uuavzwv6s7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--042R21-k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ky7gx052x3uuavzwv6s7.png" alt="Dont tell me how to make a chesterfield when all I want is to make a simple stool"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post assumes you know the basics of HTML and CSS.&lt;/p&gt;

&lt;p&gt;GitHub is a source-code repository; it also gives you a webpage for each of your repositories. The intention of this post is to show you how to make use of GitHub's hosting facility to build your website.&lt;/p&gt;

&lt;p&gt;GitHub uses Jekyll to render the pages on your website. &lt;/p&gt;

&lt;p&gt;This means, GitHub's publishing engine expects the same directory structure that Jekyll's publishing engine expects. Which is something like this, if you start off with the barest minimum files:&lt;/p&gt;

&lt;pre&gt;

- _layouts        # folder to contain HTML templates
  -- default.html
- css             # folder to contain stylesheets
  -- main.css
- topics          # folder to contain pages of the website
  -- page1.html
  -- page2.html
  -- page3.html
- _config.yml    # basic configuration info
- index.html     # landing page of the website

&lt;/pre&gt;

&lt;p&gt;Jekyll uses the Liquid template engine to create webpages. This means, you can use Liquid variables in your HTML pages, and during build time, the value of these variables will be inserted onto the page. So, for example, if you have something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;p&amp;gt;I graduated in {{ grad_year }} and have since worked with {{ company_1 }} ({{ comp1_start_year }} - {{ comp1_end_year }}), {{ company_2 }} ({{ comp2_start_year }} - {{ comp2_end_year }}), and {{ company_3 }} ({{ comp3_start_year }} - {{ comp3_end_year }}).&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;it'll be rendered on the page like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;I graduated in 2020 and have since worked with WB (2020 - 2025), YOLO (2025 - 2074), and FIK (2134 - 2135).&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can immediately see the possibilities that Liquid gives you, right? You can almost build dynamic webpages with a static site generator. Almost. Without needing to install or configure anything.&lt;/p&gt;

&lt;p&gt;So go ahead, create that GitHub repo and build a website. Once you're comfortable with this basic setup, you can explore the full power of the objects, tags, and filters of Liquid.&lt;/p&gt;

&lt;p&gt;If you need a template to take off running, I've created one for the files you'd need: &lt;a href="https://github.com/AninditaBasu/jekyll-github-starter-pack"&gt;jekyll-github-starter-pack&lt;/a&gt;. It also has a README to help you get started.&lt;/p&gt;

&lt;p&gt;Was this useful?&lt;/p&gt;

</description>
      <category>jekyll</category>
      <category>liquid</category>
      <category>github</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to move your Flask app from the local machine to the Heroku cloud</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Thu, 21 Nov 2019 11:40:55 +0000</pubDate>
      <link>https://dev.to/aninditabasu/how-to-move-your-flask-app-from-the-local-machine-to-the-heroku-cloud-egk</link>
      <guid>https://dev.to/aninditabasu/how-to-move-your-flask-app-from-the-local-machine-to-the-heroku-cloud-egk</guid>
      <description>&lt;p&gt;Why this post? &lt;/p&gt;

&lt;p&gt;Because I could not find any resource that tells me how to deploy a Flask app to Heroku through the Heroku web interface. &lt;em&gt;Through the web interface, not through the CLI&lt;/em&gt; 😒&lt;/p&gt;

&lt;p&gt;Also because the official Heroku starter pack for Flask has way too many files; it intimidated me no end. &lt;em&gt;Are so many files really needed&lt;/em&gt;, I asked myself 😓 And the Heroku documentation for that starter pack (and the documentation otherwise) assumes a level of knowledge that I do not have.&lt;/p&gt;

&lt;p&gt;Also because the Flask app that ran &lt;em&gt;perfectly&lt;/em&gt; on my laptop would &lt;em&gt;not&lt;/em&gt; work on Heroku and none of the resources Google threw at me could tell me how to solve it. I wanted something beyond the &lt;em&gt;hello world&lt;/em&gt; apps, something that took in a user input and returned a result. I went on to the 5th and 6th page of the search results, looking... 😞 &lt;em&gt;Why isn't this part clearly documented anywhere&lt;/em&gt;, I asked myself. &lt;/p&gt;

&lt;p&gt;So, this post. &lt;/p&gt;

&lt;p&gt;This post is for people like me, people who are just learning to code, are not professional coders, and will not use the CLI until you make them an offer they can't refuse. &lt;/p&gt;

&lt;p&gt;This post is for people who want minimal stuff on their laptops, and prefer to do things on the cloud through graphical user interfaces. UIs for the win 🎉&lt;/p&gt;

&lt;p&gt;This post assumes you know the basics of Python (and Flask). That you already know how to get a &lt;code&gt;Hello world&lt;/code&gt; app in Flask running on your local machine.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TL;DR&lt;/p&gt;

&lt;p&gt;(i) In your Flask code, replace &lt;code&gt;app.run()&lt;/code&gt; with host and port instructions.&lt;br&gt;
(ii) In your repo, have a pip file to &lt;code&gt;pip install&lt;/code&gt; the required packages at the Heroku end.&lt;br&gt;
(iii) In your repo, also have &lt;code&gt;Procfile&lt;/code&gt; and &lt;code&gt;requirements.txt&lt;/code&gt; to specify a web server for the app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What does the app do?&lt;/p&gt;

&lt;p&gt;It takes a user input, processes it, and returns the results of that process. To do so, it uses the Flask framework of Python.&lt;/p&gt;

&lt;p&gt;To test a Flask app locally, you use the &lt;code&gt;app.run()&lt;/code&gt; command. By default, Flask starts a web server on the local machine and uses port 5000 to deploy the app.&lt;/p&gt;

&lt;p&gt;To run the app on Heroku, three additional steps are needed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Heroku does not have a web server for Flask, so you need to tell it how to start a web server. This app uses &lt;code&gt;gunicorn&lt;/code&gt; as HTTP server. So, for the app to run on Heroku, it needs a &lt;code&gt;Procfile&lt;/code&gt; that contains the following command: &lt;code&gt;web: gunicorn flaskStarter:app&lt;/code&gt; where &lt;code&gt;web&lt;/code&gt; tells Heroku this is a web app, &lt;code&gt;gunicorn&lt;/code&gt; tells it to use that server for app deployment, &lt;code&gt;flaskStarter&lt;/code&gt; is the name of the Python program that contains the app code, and &lt;code&gt;app&lt;/code&gt; is the name of the app routine inside the code.&lt;/li&gt;
&lt;li&gt;Heroku needs to install &lt;code&gt;gunicorn&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; it compiles the app, and you tell it to do so through a file called &lt;code&gt;Pipfile&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Then, you need to modify your Python file to include the host and port info for app deployment. You do so by replacing &lt;code&gt;app.run()&lt;/code&gt; with the following lines of code:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;        &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"PORT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'0.0.0.0'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Both &lt;code&gt;Procfile&lt;/code&gt; and &lt;code&gt;Pipfile&lt;/code&gt; must be named exactly so, and not have any file extension.&lt;/p&gt;

&lt;p&gt;That's it. Now the app, which ran so beautifully on the local machine, will also run on Heroku.&lt;/p&gt;

&lt;p&gt;🚶 Armed with this knowledge, I'll now fine-tune an app that I am building around an API and deploy it to Heroku for the world to use ...&lt;/p&gt;

&lt;p&gt;If you'd like to get started with Heroku, I created a GitHub repo for the files you'd need: &lt;a href="https://github.com/AninditaBasu/flask-heroku-starter-pack"&gt;flask-heroku-starter-pack&lt;/a&gt;. And, here's the &lt;a href="https://flask-heroku-starter-app.herokuapp.com/"&gt;Heroku app&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>heroku</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Designing the database</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Wed, 14 Aug 2019 08:57:35 +0000</pubDate>
      <link>https://dev.to/aninditabasu/building-a-chatbot-with-the-ramp-stack-part-2-designing-the-database-131e</link>
      <guid>https://dev.to/aninditabasu/building-a-chatbot-with-the-ramp-stack-part-2-designing-the-database-131e</guid>
      <description>&lt;p&gt;My chatbot is going to answer queries on the Mahabharat, so my database will be a Mahabharat&lt;sup&gt;1&lt;/sup&gt; database. Let's design one 🚧&lt;/p&gt;

&lt;p&gt;I should be able to apply the design principles in this post to any story corpus, epic, or novel (and not &lt;i&gt;just&lt;/i&gt; the Mahabharat). The Bible, for example, or the Harry Potter series. 🌟⚡️&lt;/p&gt;

&lt;blockquote&gt;
&lt;dl&gt;
&lt;dt&gt;Who am I designing the database for?&lt;/dt&gt;
&lt;dd&gt;A chabot.&lt;/dd&gt;
&lt;dt&gt;Who will use the chatbot?&lt;/dt&gt;
&lt;dd&gt;Human beings.&lt;/dd&gt;
&lt;dt&gt;Why will they use the chatbot?&lt;/dt&gt;
&lt;dd&gt;To get quick info on the story.&lt;/dd&gt;
&lt;dt&gt;What kind of info?&lt;/dt&gt;
&lt;dd&gt;Info about the people in the epic, what they do, how they live day to day, how they die.&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;

&lt;p&gt;I know that my chatbot is not a story-telling bot; it is an info-supplying bot. How do human beings look for info? They do so by asking questions. &lt;/p&gt;

&lt;blockquote&gt;
&lt;dl&gt;
&lt;dt&gt;
&lt;u&gt;Why&lt;/u&gt; is the sky blue?&lt;/dt&gt;
&lt;dd&gt; &lt;/dd&gt;
&lt;dt&gt;
&lt;u&gt;How&lt;/u&gt; do I dance the foxtrot?&lt;/dt&gt;
&lt;dd&gt; &lt;/dd&gt;
&lt;dt&gt;
&lt;u&gt;When&lt;/u&gt; is that moron going to resign?&lt;/dt&gt;
&lt;dd&gt; &lt;/dd&gt;
&lt;dt&gt;
&lt;u&gt;Where&lt;/u&gt; were they when the lights went out?&lt;/dt&gt;
&lt;dd&gt; &lt;/dd&gt;
&lt;dt&gt;
&lt;u&gt;Who&lt;/u&gt; framed Peter Rabbit?&lt;/dt&gt;
&lt;dd&gt; &lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;

&lt;p&gt;Applying these questions to my project, I can see two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;That I need to group the information into categories&lt;/li&gt;
&lt;li&gt;That a category should answer one - and only one - type of question&lt;/li&gt;
&lt;li&gt;That an answer to a question in one category can lead to further questions that can belong to either the same category or to another&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I believe, in geek parlance these are known as &lt;i&gt;taxonomy&lt;/i&gt;, &lt;i&gt;ontology&lt;/i&gt;, and &lt;i&gt;normalisation&lt;/i&gt;?&lt;/p&gt;

&lt;p&gt;So, categories will be my database tables. The rows in the tables will be the Who, What, Where of that category. The columns will contain the information about one specific Who, What, Where. The info in one cell of one table can be exactly equal to the info in a cell of one or more tables. 💥&lt;/p&gt;

&lt;p&gt;My Mahabharat database is going to have the following categories (tables):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;persons&lt;/li&gt;
&lt;li&gt;families&lt;/li&gt;
&lt;li&gt;clans&lt;/li&gt;
&lt;li&gt;weapons&lt;/li&gt;
&lt;li&gt;killings&lt;/li&gt;
&lt;li&gt;places&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A character in the story (a person) can belong to persons, families, clans, weapons, and killings. In one table, a person can appear in one - and only one - row. In all other tables, that person can appear at several rows, but only once in each such row. &lt;/p&gt;

&lt;p&gt;I believe, in geek parlance this is known as &lt;i&gt;primary key&lt;/i&gt; and &lt;i&gt;foreign key&lt;/i&gt;?&lt;/p&gt;

&lt;p&gt;Now that I have an idea of what my database will look like, I should write it all down. So, here we go: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U2iiZzGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9sfbec8ouz5dhgcw5h2n.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U2iiZzGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9sfbec8ouz5dhgcw5h2n.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To sum up, for designing my database, I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ask what kind of questions my database will answer.&lt;/li&gt;
&lt;li&gt;Group the questions into categories.&lt;/li&gt;
&lt;li&gt;Create a table for each category.&lt;/li&gt;
&lt;li&gt;Turn the sub-groups of these categories into the table columns.&lt;/li&gt;
&lt;li&gt;Link one table to another through a common column.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, I'll create these tables in MySQL on my &lt;a href="https://dev.to/aninditabasu/building-a-chatbot-with-the-ramp-stack-part-1-preparing-my-raspberry-pi-1jai"&gt;RaspberryPi&lt;/a&gt; and populate them with the data.&lt;/p&gt;




&lt;p&gt;&lt;small&gt;Footnote:&lt;/small&gt;&lt;br&gt;
&lt;a&gt;&lt;/a&gt;&lt;small&gt;1. The Mahabharat is one of the two epics of ancient India, is the longest epic in the world, and is the epic that contains the Bhagvad Gita (a mini-book that's sacred to the Hindus).&lt;/small&gt;&lt;/p&gt;

</description>
      <category>databasedesign</category>
    </item>
    <item>
      <title>Preparing my Raspberry Pi</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Mon, 12 Aug 2019 09:45:11 +0000</pubDate>
      <link>https://dev.to/aninditabasu/building-a-chatbot-with-the-ramp-stack-part-1-preparing-my-raspberry-pi-1jai</link>
      <guid>https://dev.to/aninditabasu/building-a-chatbot-with-the-ramp-stack-part-1-preparing-my-raspberry-pi-1jai</guid>
      <description>&lt;p&gt;What is a RaMP stack, you might ask? It's my parody of the LAMP stack, where RaMP = RaspberryPi, MySQL, Python.&lt;/p&gt;

&lt;p&gt;Why a RaMP stack? Because I am looking for a &lt;u&gt;low-cost, low-space, low-weight&lt;/u&gt; alternative for my personal laptop, and because I want to keep the bot experiments completely separate from the stuff I have on either my work laptop or my personal laptop, and because, at some point of time, I dream of building my own Alexa-like voice bot...Also because I know basic Python and can pick up SQL.&lt;/p&gt;

&lt;p&gt;Here's a picture to show you how tiny a barebones RaspberryPi can be. &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fidk8wg8wkbhmrviqe1e8.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fidk8wg8wkbhmrviqe1e8.JPG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are my tentative steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set up my RaspberryPi.&lt;/li&gt;
&lt;li&gt;Design and create the databases.&lt;/li&gt;
&lt;li&gt;Design and create the bot app.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am neither a geek nor a coder; this journey will not be easy. This post is the first of a series where I share my learning, failures, and successes with you all. In these posts, I plan to focus more on the design considerations (the WHYs)  of the chatbot rather than the code aspects (the HOWs). &lt;/p&gt;

&lt;p&gt;This post is about making a RaspberryPi ready for my experiments.&lt;/p&gt;

&lt;p&gt;A RaspberryPi is just a CPU (a motherboard). To work with it, one needs a power source (a power cable), an input device (keyboard), and an output device (display monitor? TV?). One also needs to load the operating system on to the CPU, so one needs an external storage device (a microSD card) that contains the OS.&lt;/p&gt;

&lt;p&gt;I bought a &lt;a href="https://www.amazon.in/gp/product/B07C6SN8PL/ref=ppx_yo_dt_b_asin_title_o09_s00" rel="noopener noreferrer"&gt;starter kit&lt;/a&gt;, followed a YouTube video to guide me on how to put the RaspberryPi into its official case, and then looked around to plug stuff into the ports and get started.&lt;/p&gt;

&lt;p&gt;Rookie mistake.&lt;/p&gt;

&lt;p&gt;The starter kit did not have a VGA to HDMI adapter (and my monitors don't have HDMI ports, only VGA).&lt;/p&gt;

&lt;p&gt;Starter kits such as the one I bought are well-meaning but can contain stuff I don't need (and not contain stuff I need). Googling tells me it's cheaper to go for combo-boxes or starter kits than buying individual components, but I disagree. The very minimum things that I needed were these: the motherboard, a power source, and a microSD card loaded with the Raspbian OS. Had I bought just these, and a VGA-to-HDMI connector, I would've saved about eight hundred rupees.&lt;/p&gt;

&lt;blockquote&gt;So, here's a buying guide for you (I'm assuming you already have a monitor, a USB keyboard, and a USB mouse).
&lt;ol&gt;
&lt;li&gt;Buy these 2 items: RaspberryPi 3B+ motherboard and a 2.4Amp power adapter with microUSB plug. I bought model 3 B+; there's a model 4 out too if you want that.&lt;/li&gt;
&lt;li&gt;If you already have a spare microSD card that you can dedicate to your RaspberryPi, go to the next step. If not, buy one, preferably one pre-loaded with the Raspbian OS. Or, you can load the card with the Raspbian OS from &lt;a href="https://www.raspberrypi.org/downloads/raspbian/" rel="noopener noreferrer"&gt;raspberrypi.org&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;See what port your TV or monitor has, and buy either a VGA-to-HDMI connector or an HDMI-to-HDMI connector (RaspberryPi has an HDMI port).&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;I bought the correct display connector and plugged in the keyboard, mouse, and display. Then, I looked around for a port to plug in the microSD card.&lt;/p&gt;

&lt;p&gt;Another rookie mistake. &lt;/p&gt;

&lt;p&gt;The microSD port is on the reverse side of the motherboard; to get to it, one needs to turn the motherboard over. &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ffqwxyk7q36ys9y8pr5xw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ffqwxyk7q36ys9y8pr5xw.jpg"&gt;&lt;/a&gt;&lt;br&gt;
Which means, I had to unplug all of what I had earlier plugged in (because, I was scared of snagging one of those pins with a wire or something).&lt;/p&gt;

&lt;blockquote&gt;So, here's the correct order of plugging the components in:
&lt;ol&gt;
&lt;li&gt;Turn the motherboard over and plug in the microSD card very slowly into the slot.&lt;/li&gt;
&lt;li&gt;Plug the keyboard and the mouse into USB ports.&lt;/li&gt;
&lt;li&gt;Connect the display to the HDMI port.&lt;/li&gt;
&lt;li&gt;If you're going to use wired internet, plug the LAN cable into the ethernet port (I was going to use WiFi).&lt;/li&gt;
&lt;li&gt;Plug the power adapter into the microUSB port.&lt;/li&gt;
&lt;li&gt;Switch the display on. Then, switch the power adapter on (googling told me the power adapter should be plugged in last and switched on last).&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;And voila! My tiny nano micro computer blinked red and started up. On the screen, I selected the Raspbian OS, clicked &lt;b&gt;Install&lt;/b&gt;, followed the onscreen instructions, and then waited for the installation to be over (it took almost 15 minutes).&lt;/p&gt;

&lt;p&gt;Googling also told me to update the packages after they're installed, so after the installation was over, I ran the following commands:&lt;br&gt;
&lt;code&gt;sudo apt-get update&lt;/code&gt;, which took about 10 minutes to complete.&lt;br&gt;
&lt;code&gt;sudo apt-get upgrade&lt;/code&gt;, which took about 15 minutes to complete.&lt;/p&gt;

&lt;p&gt;Looks like I'm done setting up the computer. Next post, I'll talk about the chatbot back-end (which will be a MySQL database).  &lt;/p&gt;




&lt;p&gt;Meanwhile, since this is supposed to be my ultra-portable computer, I'll buy it an LCD touchscreen display.&lt;/p&gt;

&lt;p&gt;Also, since the RaspberryPi official case cuts off all access to the GPIO connector pins, I'll buy it a case that keeps the pins accessible. The pins are needed to plug the LCD display in, and also for all of the IoT stuff (assuming I go that way later).&lt;/p&gt;

&lt;p&gt;And, since I don't like the idea of having to turn the motherboard over every time I need to use a microSD card, I'll also buy it a USB microSD card reader.&lt;/p&gt;




</description>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>How a non-coder created an API (and some questions)</title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Wed, 15 Aug 2018 08:35:37 +0000</pubDate>
      <link>https://dev.to/aninditabasu/how-a-non-coder-created-an-api-and-some-questions-a89</link>
      <guid>https://dev.to/aninditabasu/how-a-non-coder-created-an-api-and-some-questions-a89</guid>
      <description>&lt;p&gt;APIs fascinate me. That you can ping an unknown system and get it to share its treasure-trove with you, for you to play around with, is something that I find utterly fascinating. The first APIs that I ever used were the Twitter APIs and the IBM Watson ones; I totally loved (love?) them.&lt;/p&gt;

&lt;p&gt;The other thing that I am fascinated by is Indology. However, APIs and Indology do not meet. While there are plenty of digital resources, freely available, on ancient India, none of these resources make available the data (treasure?) held in them in a manner that can be consumed by apps and programs.&lt;/p&gt;

&lt;p&gt;I had the books, I had the data. But I had no idea about how to make APIs (I'd only ever used them to make bots and apps).  So, I hunted around for an easy solution and found sheetlabs.com. Thus was born &lt;a href="https://aninditabasu.github.io/rigVeda/index.html"&gt;the vedic APIs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's the non-coder way to go about making APIs, I guess. In this post, I'd like to ask you coders a couple of questions (and also to shout out about my APIs because I am so thrilled about them :) ).&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 1
&lt;/h3&gt;

&lt;p&gt;Are nested arrays and lists a good idea, or no?&lt;br&gt;
My APIs are designed to return JSON data like this, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    {
        "mandal": 1,
        "sukta": 2,
        "sungby": "poet_name_1",
        "sungfor": "god_name_1",
        "meter": "meter_name_1"
    },
    {
        "mandal": 1,
        "sukta": 2,
        "sungby": "poet_name_2",
        "sungfor": "god_name_1",
        "meter": "meter_name_1"
    },
    {
        "mandal": 1,
        "sukta": 2,
        "sungby": "poet_name_2",
        "sungfor": "god_name_2",
        "meter": "meter_name_1"
    },
    {
        "mandal": 1,
        "sukta": 2,
        "sungby": "poet_name_2",
        "sungfor": "god_name_3",
        "meter": "meter_name_2"
    }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is it better if they're like this? And, why so?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    {
        "mandal": 1,
        "sukta": 2,
        "sungby": ["poet_name_1", "poet_name2"],
        "sungfor": ["god_name_1", "god_name2", "god_name_3"],
        "meter": ["meter_name_1", "meter_name_2", "meter_name_3", "meter_name_4"]
    }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Question 2
&lt;/h3&gt;

&lt;p&gt;What could be a low-cost setup to host my own database server that'll have the data tables, and then making them available through web calls? One option that I had thought about was getting a Raspberry Pi to host a PostgreSQL server, and throwing the database open for API calls. Advisable? Other options?&lt;/p&gt;

&lt;h3&gt;
  
  
  Question 3
&lt;/h3&gt;

&lt;p&gt;What are the steps to convert a database table into an API? Dumb question?&lt;/p&gt;

&lt;p&gt;I have tons of data on the Mahabharat that I want to turn into APIs, but the spreadsheets will go beyond the free limit of sheetlabs.com. Plus, some of the columns in one sheet could be linked to columns in another sheet. And I am looking for a more permanent solution anyway, so...thoughts?&lt;/p&gt;

</description>
      <category>api</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How bots tweet Urdu word meanings in English </title>
      <dc:creator>Anindita Basu</dc:creator>
      <pubDate>Thu, 01 Jun 2017 06:14:53 +0000</pubDate>
      <link>https://dev.to/aninditabasu/how-bots-tweet-urdu-word-meanings-in-english</link>
      <guid>https://dev.to/aninditabasu/how-bots-tweet-urdu-word-meanings-in-english</guid>
      <description>&lt;p&gt;In this post, I'll talk about how a bot tweets translations of Urdu words to English.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TL; DR: &lt;br&gt;1.  Use the JSON data returned freely by the well-documented Oxford Dictionaries API.&lt;br&gt;2. Tweet like &lt;a href="https://twitter.com/_alfaaz_%5D"&gt;@_alfaaz_&lt;/a&gt;&lt;a href="https://dev.tonote-1"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://dev.towhy-this-bot"&gt;Why this bot&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.tohow-the-bot-works"&gt;How the bot works&lt;/a&gt;&lt;br&gt;
    -  &lt;a href="https://dev.tohow-the-oxford-dictionary-api-works"&gt;How the Oxford Dictionaries API works&lt;/a&gt;&lt;br&gt;
    -  &lt;a href="https://dev.tothe-difficulties-in-using-the-api"&gt;The difficulties in using the API&lt;/a&gt;&lt;br&gt;
    -  &lt;a href="https://dev.tothe-workarounds"&gt;The workarounds&lt;/a&gt;&lt;br&gt;
    -  &lt;a href="https://dev.tohow-do-the-tweets-happen"&gt;How do the tweets happen&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.towhere-is-the-code"&gt;Where's the code&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.towhy-this-bot-again"&gt;Why this bot, again&lt;/a&gt;&lt;/p&gt;



&lt;h3&gt;
  
  
  Why this bot
&lt;/h3&gt;

&lt;p&gt;I know Urdu. At least, I &lt;em&gt;think&lt;/em&gt; I know Urdu, chiefly because I know the lyrics of practically every popular Hindi film song ever made. But film songs are ... poems, and there's this thing called poetic license, and then, not all words always mean what I might think they mean.&lt;/p&gt;

&lt;p&gt;And I am not alone. Dozens of people around me, growing up following the major religion in India (which is 'Films') know and quote lyrics off the cuff, but don't always know the exact meaning of certain words. For example, I (and hundreds of others) went through teenage and the rest of our lives thinking &lt;em&gt;jigar&lt;/em&gt; means heart. It doesn't. Nope.&lt;/p&gt;

&lt;p&gt;So, when I chanced upon the Oxford Dictionaries API, which includes an Urdu dictionaries endpoint, I thought, "Why not make a tweet bot?"&lt;/p&gt;

&lt;h3&gt;
  
  
  How the bot works
&lt;/h3&gt;

&lt;p&gt;It picks a Urdu words one by one from a list I give it, supplies those words to the Oxford Dictionary API endpoint, gets the JSON responses, parses the responses to pick the translations, and tweets the Urdu words and their English translations.&lt;/p&gt;

&lt;p&gt;Its requirements are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; A computer connected to the internet&lt;/li&gt;
&lt;li&gt; A token, token secret, consumer key, and consumer secret from Twitter&lt;/li&gt;
&lt;li&gt; An app ID and app key from Oxford Dictionaries&lt;/li&gt;
&lt;li&gt; A scripting environment to write and run the bot code in&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How the Oxford Dictionaries API works
&lt;/h4&gt;

&lt;p&gt;It serves a JSON response through REST endpoints that are well-documented&lt;a href="https://dev.tonote-2"&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The actual translations of a word are contained in a list of dictionary objects; the list is called &lt;code&gt;results&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--saPsg30o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/202thh03ilygxxjtunto.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--saPsg30o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/202thh03ilygxxjtunto.PNG" alt="https://thepracticaldev.s3.amazonaws.com/i/202thh03ilygxxjtunto.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each dictionary object in this &lt;code&gt;results&lt;/code&gt; list has a key called &lt;code&gt;lexicalEntries&lt;/code&gt;. If you drill down from there, you finally arrive at a list called &lt;code&gt;translations&lt;/code&gt; where a dictionary key called &lt;code&gt;text&lt;/code&gt; contains the actual translation.  The following image shows the complete sequence, with the translation highlighted in a red box :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iO7Dygqg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4mxrq0561yvno539bt4d.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iO7Dygqg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4mxrq0561yvno539bt4d.PNG" alt="https://thepracticaldev.s3.amazonaws.com/i/4mxrq0561yvno539bt4d.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A word can have several meanings and, therefore, several translations. How would one know how many meanings exist? Well, one looks at the number of items in the &lt;code&gt;senses&lt;/code&gt; list for every dictionary object in the &lt;code&gt;results&lt;/code&gt; list. Here's the hierarchy of &lt;code&gt;senses&lt;/code&gt;:&lt;br&gt;
&lt;code&gt;['results'] &amp;gt; ['lexicalEntries'] &amp;gt; ['entries'] &amp;gt; ['senses']&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  The difficulties in using this API
&lt;/h4&gt;

&lt;p&gt;The script. The difficulty is the script.&lt;/p&gt;

&lt;p&gt;Urdu, as spoken in its daily form in India, is indistinguishable from Hindi. Urdu, when written, is written in a script called Nastaliq. I don't know how to read Nastaliq&lt;a href="https://dev.tonote-3"&gt;&lt;sup&gt;3&lt;/sup&gt;&lt;/a&gt;. The Oxford Dictionaries API takes input only in the Nastaliq script. Uh oh! &lt;/p&gt;

&lt;h4&gt;
  
  
  The workarounds
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt; Learn how to read Nastaliq.[&lt;strong&gt;But&lt;/strong&gt;] Yeah, right, on top of everything else. It's because I don't know that script that I've been unable to look up a dictionary thus far but, surely, in this day and age of OneWorld, there is an easier way? After all, I can make out the letters with huge effort, surely that's sufficient?&lt;/li&gt;
&lt;li&gt; Use a transliteration service.[&lt;strong&gt;But&lt;/strong&gt;] I searched, but found nothing. The GoogleTransliterate API has been deprecated. Python (the language I can code in) has a &lt;code&gt;polyglot&lt;/code&gt; library but it refused to &lt;code&gt;pip&lt;/code&gt; install on my machine. I did not find a single resource that could take in a word written in Devanagari and give out that word in Nastaliq programmatically.&lt;/li&gt;
&lt;li&gt; Extract the Urdu word from one of the online dictionary resources that contain both the Urdu word and its transliterated English form, like the Platt's dictionary&lt;a href="https://dev.tonote-4"&gt;&lt;sup&gt;4&lt;/sup&gt;&lt;/a&gt; does: Ø¬Ú¯Ø± &lt;em&gt;jigar&lt;/em&gt;.[&lt;strong&gt;But&lt;/strong&gt;] None of these web resources are in any structured format such as XML or JSON. Not one.&lt;/li&gt;
&lt;li&gt; Build my own transliterator.[&lt;strong&gt;But&lt;/strong&gt;] Heh, like I can even write two lines of code without looking up a textbook... But wait. I found a Nastaliq-to-Roman mapping table on Medium&lt;a href="https://dev.tonote-5"&gt;&lt;sup&gt;5&lt;/sup&gt;&lt;/a&gt;. Maybe I could do something similar for tweeting, I thought, and parked away this idea for later. But this doesn't help me get spelling-perfect transliterations that a language dictionary can recognise.&lt;/li&gt;
&lt;li&gt; Use a readymade word-list.[&lt;strong&gt;But&lt;/strong&gt;]Oxford Dictionaries supplies ready-made wordlists for English. But not for Urdu.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Because none of these workarounds were feasible, I had to generate a word-list manually. I used Platt's dictionary to make my word-list. I would type the Urdu word in Roman script, and copy the Nastalikh version of it in my word-list.&lt;/p&gt;

&lt;h4&gt;
  
  
  How do the tweets happen
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt; The bot uses tokens to authenticate itself with Twitter and with Oxford Dictionaries.&lt;/li&gt;
&lt;li&gt; It picks a word from the word list and gets the translations from Oxford Dictionaries.&lt;/li&gt;
&lt;li&gt; It puts the translations on to a tweetable image, together with all of the letters in that word broken up and mapped to their Devanagari counterparts (see #4 under &lt;em&gt;Workarounds&lt;/em&gt;). It then tweets this image.&lt;/li&gt;
&lt;li&gt; [Enhancement, added later] It picks up the Devanagari version of the word (present in the same word-list), gets the Hindi meanings from Oxford Dictionaries, and tweets these meanings.&lt;/li&gt;
&lt;li&gt; It also feeds the word to Platt's dictionary, gets the URL of the search result, and tweets that URL.&lt;/li&gt;
&lt;li&gt; It then sleeps for an hour, and repeats steps 2 through 5 for as many times as there are words in the word-list.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Where's the code
&lt;/h3&gt;

&lt;p&gt;Why, on &lt;a href="https://github.com/AninditaBasu/_alfaaz_"&gt;GitHub&lt;/a&gt; of course. Where else?&lt;/p&gt;

&lt;h3&gt;
  
  
  Why this bot again?
&lt;/h3&gt;

&lt;p&gt;Because other resources - bot tweets, emailed WOTDs, non-bot tweets - are either boring or overwhelming. The design goals for this bot were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; do not overwhelm the noob&lt;/li&gt;
&lt;li&gt; tie a word to a fun context that every noob follower will likely know.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, that was the story about my first tweet bot. What do you think?&lt;/p&gt;



&lt;h6&gt;
  
  
  Note 1.
&lt;/h6&gt;

&lt;p&gt;&lt;em&gt;alfaaz&lt;/em&gt; is an Urdu word that means 'words'. (Urdu has a different word for the singular word 'word'; it is &lt;em&gt;lafz&lt;/em&gt;.)&lt;/p&gt;

&lt;h6&gt;
  
  
  Note 2.
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://developer.oxforddictionaries.com/documentation"&gt;Oxford Dictionaries API documentation&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Note 3.
&lt;/h6&gt;

&lt;p&gt;In its spoken form, Urdu is practically indistinguishable from Hindi. However, for writing, the two languages use different scripts. Hindi uses Devanagari; Urdu uses Nastaliq. The sentences in each language would be exactly the same, but written in two totally different writing styles, whose major differences are these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Nastaliq is written right-to-left; Devanagari, left-to-right.&lt;/li&gt;
&lt;li&gt; Nastaliq often does not use vowel markers; Devanagari is invariably phonetic and always with vowel markers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Note 4.
&lt;/h6&gt;

&lt;p&gt;&lt;a href="http://dsal.uchicago.edu/dictionaries/platts/"&gt;John Platt's Dictionary of Urdu, Classical Hindi, and English&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Note 5.
&lt;/h6&gt;


&lt;p&gt;&lt;a href="https://medium.com/@itsShanKhan/transliterate-urdu-to-roman-urdu-in-python-614953b1a4d5"&gt;Transliterate Urdu to Roman Urdu In Python&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;/p&gt;


</description>
    </item>
  </channel>
</rss>
