<?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>Forem: Tek Kshetri</title>
    <description>The latest articles on Forem by Tek Kshetri (@iamtekson).</description>
    <link>https://forem.com/iamtekson</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%2F289577%2F7c390b78-4215-446d-a133-8491a72230c4.jpeg</url>
      <title>Forem: Tek Kshetri</title>
      <link>https://forem.com/iamtekson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/iamtekson"/>
    <language>en</language>
    <item>
      <title>How to calculate land use area change over time in GEE?</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Wed, 08 Jan 2025 17:31:35 +0000</pubDate>
      <link>https://forem.com/iamtekson/how-to-calculate-land-use-area-change-over-time-in-gee-37bk</link>
      <guid>https://forem.com/iamtekson/how-to-calculate-land-use-area-change-over-time-in-gee-37bk</guid>
      <description>&lt;p&gt;In this article, I am going to write about how to generate land use area changes over time using Google Earth Engine (GEE). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/n81J_00oSMI" rel="noopener noreferrer"&gt;VIDEO TUTORIAL&lt;/a&gt; || &lt;a href="https://github.com/iamtekson/GEE-tutorial/blob/main/003_timeseries_graph/saudi_ndvi_temporal_area.js" rel="noopener noreferrer"&gt;FULL CODE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1. Input Dataset&lt;/p&gt;

&lt;p&gt;For this example, I am going to use the &lt;strong&gt;Landsat&lt;/strong&gt; Imagery. I am going to use &lt;strong&gt;Landsat 4-9&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;2. Preprocess Imagery&lt;/p&gt;

&lt;p&gt;Pre-processing imagery steps include selecting the appropriate image (cloud-free images), and mosaic and taking a mean or median value, clip image to an area of interest.&lt;/p&gt;

&lt;p&gt;3. Calculate Area&lt;/p&gt;

&lt;p&gt;The next step is to iterate over each year from 1984 to calculate the area of the appropriate area pixel. If no image was suitable in particular imagery, remove that from the analysis and replace the value with nan.&lt;/p&gt;

&lt;p&gt;4. Generate Graph&lt;/p&gt;

&lt;p&gt;In the final step, we can easily generate the graph using the &lt;code&gt;ui.Chart&lt;/code&gt; module. The final output graph will look something like below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjtqp4a8g1wtg8p8zhxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjtqp4a8g1wtg8p8zhxu.png" alt="Vegetation area timeseries" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gee</category>
      <category>landuse</category>
      <category>ndvi</category>
      <category>area</category>
    </item>
    <item>
      <title>Generate files and folder structures of your code</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Fri, 23 Jun 2023 04:02:27 +0000</pubDate>
      <link>https://forem.com/iamtekson/generate-files-and-folder-structures-of-your-code-3158</link>
      <guid>https://forem.com/iamtekson/generate-files-and-folder-structures-of-your-code-3158</guid>
      <description>&lt;p&gt;I recently found a cool way to generate the file and folder structure inside your root project directory. In order to generate the folder structure, you need to follow following steps,&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Download &lt;code&gt;tree&lt;/code&gt; package
&lt;/h3&gt;

&lt;p&gt;If you are in &lt;code&gt;mac&lt;/code&gt;, type following code in your terminal,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;tree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are in &lt;code&gt;ubuntu&lt;/code&gt;, type following code in your terminal,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;tree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Navigate to the root directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/Downloads/my-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Make sure to change the path.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  3. Explore tree command
&lt;/h3&gt;

&lt;p&gt;If you want to generate the files and folder structure in your working directory, just type &lt;code&gt;tree&lt;/code&gt; command in terminal and it will print out the files and folders in proper structure,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But, most of the time, our project might contain some of the unnecessary things such as, &lt;code&gt;node_modules&lt;/code&gt;, &lt;code&gt;python_venv&lt;/code&gt; etc. In that case, you might want to avoid those folders or files. In order to avoid those, simply wright the following code,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-not&lt;/span&gt; &lt;span class="nt"&gt;-path&lt;/span&gt; &lt;span class="s1"&gt;'*/\.*'&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; .gitignore | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; 3- | tree &lt;span class="nt"&gt;--fromfile&lt;/span&gt; &lt;span class="nt"&gt;--prune&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let me explain the code for you,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;find . -type f -not -path '*/\.*'&lt;/code&gt;: This command recursively finds all the files (&lt;code&gt;-type f&lt;/code&gt;) in the current directory (&lt;code&gt;.&lt;/code&gt;) and its subdirectories. The &lt;code&gt;-not -path '*/\.*'&lt;/code&gt; part excludes hidden files such as &lt;code&gt;.git&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;grep -v -F -f .gitignore&lt;/code&gt;: This command filters out the files and directories listed in the &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;cut -c 3-&lt;/code&gt; command removes the first two characters from each line of input, effectively removing the &lt;code&gt;"./"&lt;/code&gt; prefix in each path.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;tree --fromfile --prune&lt;/code&gt;: This command reads the file and directory structure from the output of the previous commands and displays it using the &lt;code&gt;tree&lt;/code&gt; command. The &lt;code&gt;--prune&lt;/code&gt; option excludes the empty directories from the output.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I got the following result from above script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── __init__.py
├── file1.ipynb
├── file2.ipynb
├── requirements.txt
├── script_json
│   ├── test1.json
│   └── test2.json
├── version1.ipynb
└── version2.ipynb

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope this post is informative for you. If you like this blog, please support me by subscribing to my YouTube channel: &lt;a href="https://www.youtube.com/c/iamtekson"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>automation</category>
      <category>tree</category>
      <category>bash</category>
      <category>programming</category>
    </item>
    <item>
      <title>Generate and Add a new SSH key to your GitHub account</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Wed, 13 Jul 2022 09:35:54 +0000</pubDate>
      <link>https://forem.com/iamtekson/generate-and-add-a-new-ssh-key-to-your-github-account-39ob</link>
      <guid>https://forem.com/iamtekson/generate-and-add-a-new-ssh-key-to-your-github-account-39ob</guid>
      <description>&lt;p&gt;When working with a GitHub repository, you'll often need to identify yourself to GitHub using your username and password. An &lt;code&gt;SSH key&lt;/code&gt; is an alternate way to identify yourself that doesn't require you to enter you username and password every time. To add such key, you need to generate it on your PC. To generate and add it to GitHub, you need to follow following steps,&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Generate the SSH key
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;SSH key&lt;/code&gt; can be generated using &lt;code&gt;ssh-keygen&lt;/code&gt; command using git bash as below,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;replace &lt;em&gt;&lt;a href="mailto:your_email@example.com"&gt;your_email@example.com&lt;/a&gt;&lt;/em&gt; with your actual email address.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Add your SSH key to GitHub
&lt;/h2&gt;

&lt;p&gt;By default, the &lt;code&gt;SSH key&lt;/code&gt; will be stored in the home directory. Now, you need to copy the public key. The public key can be seen using &lt;code&gt;cat&lt;/code&gt; command as below,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the public key from terminal. The final step is to add it to the GitHub. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Facc6qbi8q8ckw0z88hud.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Facc6qbi8q8ckw0z88hud.png" alt="SSH key add to github"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To add it, go to your GitHub profile &lt;code&gt;settings&lt;/code&gt; &amp;gt; &lt;code&gt;SSH and GPG keys&lt;/code&gt; &amp;gt; &lt;code&gt;new SSH key&lt;/code&gt;, add title for your key and paste the public key in &lt;code&gt;Key&lt;/code&gt; box.&lt;/p&gt;

&lt;p&gt;I hope this post is informative for you. If you like this blog, please support me by subscribing to my YouTube channel: &lt;a href="https://www.youtube.com/c/iamtekson" rel="noopener noreferrer"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>ssh</category>
      <category>tutorial</category>
      <category>git</category>
    </item>
    <item>
      <title>Write and Publish Python Code Documentation Automatically</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Mon, 11 Jul 2022 09:10:31 +0000</pubDate>
      <link>https://forem.com/iamtekson/write-and-publish-python-code-documentation-automatically-2bng</link>
      <guid>https://forem.com/iamtekson/write-and-publish-python-code-documentation-automatically-2bng</guid>
      <description>&lt;p&gt;We all know that programmers write code but many of us are not aware that they read more than write. The clean code will be easier to read. In this article, I am going to explain about the process of writing and publishing the python code documentation easy and effective way. Below is the table of content,&lt;/p&gt;

&lt;p&gt;1. Write the standard docstring&lt;br&gt;
2. Install Sphinx&lt;br&gt;
3. Initialize Sphinx&lt;br&gt;
4. Update the &lt;code&gt;conf.py&lt;/code&gt; file&lt;br&gt;
5. Auto generate the &lt;code&gt;rst&lt;/code&gt; file&lt;br&gt;
6. Build HTML&lt;br&gt;
7. Publish the documentation online&lt;br&gt;
8. Reference&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 1. Write the standard docstring
&lt;/h2&gt;

&lt;p&gt;Good programmers prefer to write the logic behind each class, methods, function etc using comments. In python, the best way to add the comments for the functions or class is to write in docstring format. Later, it can be used by documentation automation tools like &lt;a href="https://www.sphinx-doc.org/en/master/" rel="noopener noreferrer"&gt;sphnix&lt;/a&gt; to generate the document. But for the automation, you should follow the &lt;a href="https://realpython.com/documenting-python-code/" rel="noopener noreferrer"&gt;standard docstring guideline&lt;/a&gt;. Here is the small example of good docstring example,&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;add&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;y&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Function to add two numbers 

        Parameters
        ----------
        x: int
            First number to add
        y: int
            Second number to add

        Returns
        -------
        int
            The sum of x and y
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 2. Install sphinx
&lt;/h2&gt;

&lt;p&gt;Now next step is to install the sphnix. It can be installed easily using &lt;code&gt;pip&lt;/code&gt; command,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

pip &lt;span class="nb"&gt;install &lt;/span&gt;sphinx


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 3. Initialize the sphinx
&lt;/h2&gt;

&lt;p&gt;In the root directory of your project, run &lt;code&gt;sphinx-quickstart&lt;/code&gt; to initialize the sphinx source directory to create a default configuration. I prefer to have separated directory for &lt;code&gt;build&lt;/code&gt; and &lt;code&gt;source&lt;/code&gt;, I hope you will also do the same.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

sphinx-quickstart


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Below image is the example of my &lt;code&gt;sphinx-quickstart&lt;/code&gt;,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjhgp0ammkqnzdg2drm80.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjhgp0ammkqnzdg2drm80.png" alt="sphinx-quickstart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As shown above, running the sphinx-build command creates a &lt;code&gt;Makefile&lt;/code&gt;, a &lt;code&gt;make.bat&lt;/code&gt; file, as well as &lt;code&gt;build&lt;/code&gt; and &lt;code&gt;source&lt;/code&gt; directories.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 4. Update the &lt;code&gt;conf.py&lt;/code&gt; file
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;conf.py&lt;/code&gt; file is inside the &lt;code&gt;source&lt;/code&gt; folder which describes the sphinx configurations to control the documentation. Here, I recommend you to overwrite the following things,&lt;/p&gt;

&lt;h3&gt;
  
  
  Add project information
&lt;/h3&gt;

&lt;p&gt;In the project information section, you need to update about &lt;code&gt;copyright&lt;/code&gt;, &lt;code&gt;author&lt;/code&gt;, &lt;code&gt;release&lt;/code&gt; etc. Following is the example of my project information,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;

&lt;span class="c1"&gt;# -- Project information -----------------------------------------------------
&lt;/span&gt;
&lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;GeoTile&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;copyright&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2022, Tek Kshetri&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Tek Kshetri&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;

&lt;span class="c1"&gt;# The full version, including alpha/beta/rc tags
&lt;/span&gt;&lt;span class="n"&gt;release&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0.1.0&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Add extensions
&lt;/h3&gt;

&lt;p&gt;By default, there will be no extension added to the documentation. You have to add at least following extension to generate the documentation&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;extensions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
   &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sphinx.ext.doctest&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sphinx.ext.autodoc&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sphinx.ext.autosummary&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sphinx.ext.napoleon&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Update theme
&lt;/h3&gt;

&lt;p&gt;The default theme for sphinx is &lt;a href="https://alabaster.readthedocs.io/en/latest/" rel="noopener noreferrer"&gt;alabaster&lt;/a&gt;. There are several other themes are available, but personally, I like &lt;code&gt;pydata_sphinx_theme&lt;/code&gt;. To change the theme, you need to install it first using terminal,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

pip &lt;span class="nb"&gt;install &lt;/span&gt;pydata_sphinx_theme


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And update it to the &lt;code&gt;conf.py&lt;/code&gt; file,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;

&lt;span class="c1"&gt;# html theme for documentation
&lt;/span&gt;&lt;span class="n"&gt;html_theme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pydata_sphinx_theme&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;There are several ways to customize this theme. If you are interested, please check the &lt;a href="https://pydata-sphinx-theme.readthedocs.io/en/latest/" rel="noopener noreferrer"&gt;official documentation of &lt;code&gt;pydata_sphinx_theme&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Specify the location of the python modules
&lt;/h3&gt;

&lt;p&gt;At the top of the &lt;code&gt;conf.py&lt;/code&gt; file, you will see some commented line of code. If your python code path is outside the documentation directory (Most of the case is like this), you have to specify the path to the code like below,&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;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;
&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&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;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;../..&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;

&lt;p&gt;Here is my folder structure,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n466ku9kl7z20o5u6cu.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n466ku9kl7z20o5u6cu.png" alt="Folder structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 5. Auto generate the &lt;code&gt;rst&lt;/code&gt; file
&lt;/h2&gt;

&lt;p&gt;Sphinx generates the HTML documentation from reStructuredText (rst) files. To autogenerate the rst files, run the sphinx-apidoc command using following syntax:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

sphinx-apidoc &lt;span class="nt"&gt;-o&lt;/span&gt; &amp;lt;OUTPUT_PATH&amp;gt; &amp;lt;MODULE_PATH&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In my case, the output directory is &lt;code&gt;source&lt;/code&gt;, and the module directory is &lt;code&gt;testCode&lt;/code&gt;. I have to run following command from documentation root folder,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

sphinx-apidoc &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt; ../testCode


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above command will create at least two files, &lt;code&gt;modules.rst&lt;/code&gt; and &lt;code&gt;test.rst&lt;/code&gt;. You can open it with any text editor and see the configuration or manually edit the things as well. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 6. Build HTML
&lt;/h2&gt;

&lt;p&gt;Before building the HTML document, we need to insert the &lt;code&gt;modules.rst&lt;/code&gt; file to &lt;code&gt;source/index.rst&lt;/code&gt; file &lt;code&gt;toctree&lt;/code&gt;. Please add the &lt;code&gt;API reference &amp;lt;modules&amp;gt;&lt;/code&gt; to &lt;code&gt;toctree&lt;/code&gt; as below,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

.. toctree::
   :maxdepth: 2
   :caption: Test Documentation

   API reference &amp;lt;modules&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After that run the following command from your documentation root directory,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

make html


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will generate the &lt;code&gt;html&lt;/code&gt; file inside the &lt;code&gt;build&lt;/code&gt; directory. You can open it with any browser to check the documentation. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 7. Publish the documentation online
&lt;/h2&gt;

&lt;p&gt;To publish the documentation, I am going to use &lt;a href="https://readthedocs.org/" rel="noopener noreferrer"&gt;Read the Docs&lt;/a&gt; open-source solution. Using &lt;code&gt;read the docs&lt;/code&gt;, you can publish your documentation free of cost. Here is the guideline for publishing,&lt;/p&gt;

&lt;h3&gt;
  
  
  Create account
&lt;/h3&gt;

&lt;p&gt;If you don't have &lt;code&gt;read the docs&lt;/code&gt; account, &lt;a href="https://readthedocs.org/accounts/signup/" rel="noopener noreferrer"&gt;create account&lt;/a&gt; and login to the read the docs site. &lt;/p&gt;

&lt;h3&gt;
  
  
  Import project
&lt;/h3&gt;

&lt;p&gt;In your user dashboard, there is option to &lt;strong&gt;Import a Project&lt;/strong&gt;. Click the option, again click on &lt;strong&gt;Import Manually&lt;/strong&gt; button. Add the project name, repository URL (GitHub url to your documentation), and default branch and click next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F367ceofyr3c2pji4hsr4.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F367ceofyr3c2pji4hsr4.png" alt="Project details(read the docs)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Again add the extra details about your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxq32rh1ob10ofqmwx5q.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxq32rh1ob10ofqmwx5q.png" alt="extra details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The final step is to build the version and view the docs,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0abqnuyte59m0c6lqyp7.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0abqnuyte59m0c6lqyp7.png" alt="Read the docs build"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you did everything correctly, live version of your documentation will be rendered after clicking view docs button.&lt;/p&gt;

&lt;p&gt;I hope this blog post is informative for you. If you like this blog, please support me by subscribing to my YouTube channel: &lt;a href="https://www.youtube.com/c/iamtekson" rel="noopener noreferrer"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a&gt;&lt;/a&gt; 8. Reference
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://realpython.com/documenting-python-code/" rel="noopener noreferrer"&gt;Documenting python code (Blog post)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sphinx-doc.org/en/master/tutorial/automatic-doc-generation.html" rel="noopener noreferrer"&gt;Automatic documentation generation from code (official documentation)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docutils.sourceforge.io/rst.html" rel="noopener noreferrer"&gt;RST documentation guidline&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>docstring</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Upload large file to GitHub</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Fri, 08 Jul 2022 02:32:59 +0000</pubDate>
      <link>https://forem.com/iamtekson/upload-large-file-to-github-37me</link>
      <guid>https://forem.com/iamtekson/upload-large-file-to-github-37me</guid>
      <description>&lt;p&gt;To upload large file to GitHub, follow the following steps,&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Install and select LFS file
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git lfs &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="c"&gt;# I am adding the deep learning model file&lt;/span&gt;
git lfs track &lt;span class="s2"&gt;"*.h5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Commit and push to the GitHub
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git lfs push &lt;span class="nt"&gt;--all&lt;/span&gt; origin main

git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-am&lt;/span&gt; &lt;span class="s2"&gt;"add large file"&lt;/span&gt;
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Solve large file upload issue
&lt;/h2&gt;

&lt;p&gt;If you already tried to upload the file and facing &lt;em&gt;remote: error: File model.h5 is 270.75 MB; this exceeds GitHub's file size limit of 100.00 MB&lt;/em&gt; similar issue, It can be solved by following method,&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Reset &lt;code&gt;git&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset HEAD~&amp;lt;HOWEVER MANY COMMITS YOU WERE BEHIND&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If you want to go before one commit: &lt;code&gt;git reset HEAD~1&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt; Check git log: &lt;code&gt;git log&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Check status and push
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status

git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>github</category>
      <category>file</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
    <item>
      <title>Release Conda package from PyPI</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Fri, 01 Jul 2022 02:46:42 +0000</pubDate>
      <link>https://forem.com/iamtekson/release-conda-package-from-pypi-4m8g</link>
      <guid>https://forem.com/iamtekson/release-conda-package-from-pypi-4m8g</guid>
      <description>&lt;p&gt;To add the PyPI package to conda distribution (&lt;code&gt;conda-forge&lt;/code&gt;), you need to follow the following method,&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Fork the &lt;a href="https://github.com/conda-forge/staged-recipes"&gt;staged-recipes repository&lt;/a&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  2. Create configuration files
&lt;/h3&gt;

&lt;p&gt;After creating the fork in your GitHub, first step is to clone your fork,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/iamtekson/staged-recipes.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Please replace the git clone &lt;code&gt;URL&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, add the &lt;code&gt;LICENSE&lt;/code&gt; and &lt;code&gt;meta.yaml&lt;/code&gt; file inside &lt;code&gt;recipes/yourPackageName&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;Below is the example of MIT license file,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MIT License

Copyright (c) 2020, Tek Kshetri

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside &lt;code&gt;meta.yaml&lt;/code&gt; file, you need to write your package configuration. The easiest way is to copy the file from &lt;code&gt;example &amp;gt; meta.yaml&lt;/code&gt; file and edit it. Here is the example of &lt;code&gt;geoserver-rest&lt;/code&gt; package,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="nv"&gt;set name = 'geoserver-rest' %&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;
&lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="err"&gt;%&lt;/span&gt; &lt;span class="nv"&gt;set version = '0.1.0' %&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;
&lt;span class="na"&gt;package&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;name|lower&lt;/span&gt; &lt;span class="pi"&gt;}}&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;version&lt;/span&gt; &lt;span class="pi"&gt;}}&lt;/span&gt;

&lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz&lt;/span&gt;
  &lt;span class="na"&gt;sha256&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;625327b23ee2ee77e839272b04d0b6e81b7dc98e0713e4e23d003a1bf2461551&lt;/span&gt;

&lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;noarch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python&lt;/span&gt;
  &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;PYTHON&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-m&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;pip&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;install&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-vv"&lt;/span&gt;

&lt;span class="na"&gt;requirements&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;python &amp;gt;=3.6&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pip&lt;/span&gt;

  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;python &amp;gt;=3.6&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pip&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;gdal&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;seaborn&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pycurl&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;psycopg2&lt;/span&gt;

&lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;geo&lt;/span&gt;
  &lt;span class="na"&gt;commands&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pip check&lt;/span&gt;
  &lt;span class="na"&gt;requires&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pip&lt;/span&gt;

&lt;span class="na"&gt;about&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;home&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/gicait/geoserver-rest&lt;/span&gt;
  &lt;span class="na"&gt;license&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;MIT&lt;/span&gt;
  &lt;span class="na"&gt;license_file&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;LICENSE&lt;/span&gt;
  &lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;package&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;for&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;management&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;of&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;geospatial&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;in&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;GeoServer."&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;The geoserver-rest package is useful for the management for geospatial data in GeoServer. The package is useful for the creating, updating and deleting geoserver workspaces, stores, layers, and style files.&lt;/span&gt;
  &lt;span class="na"&gt;dev_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/gicait/geoserver-rest&lt;/span&gt;

&lt;span class="na"&gt;extra&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;recipe-maintainers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;iamtekson&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Submit the pull request
&lt;/h3&gt;

&lt;p&gt;This is the final step. Now you have to create the new branch, push code to your fork and submit the pull request. Below is the code for creating new branch and push code,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch myPackageName
git checkout myPackageName

git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"added myPackageName to conda-forge"&lt;/span&gt;
git push &lt;span class="nt"&gt;--set-upstream&lt;/span&gt; origin myPackageName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, check your GitHub account and submit the pull request. After submitting the pull request, some of the test functions (GitHub actions) will automatically run and you will notify if there is any mistake. &lt;/p&gt;

&lt;p&gt;If your pull request merged, that means your package can be install using conda distribution as well. You can check the package availability by using conda installation as below,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; conda-forge myPackageName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Check this pull request for your reference: &lt;a href="https://github.com/conda-forge/staged-recipes/pull/14143"&gt;https://github.com/conda-forge/staged-recipes/pull/14143&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Congratulations! you finally managed to publish your package to conda distribution. If you like this blog, please support me by subscribing to my YouTube channel: &lt;a href="https://www.youtube.com/c/iamtekson"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>anaconda</category>
      <category>python</category>
      <category>pypi</category>
      <category>package</category>
    </item>
    <item>
      <title>Publish Package to PyPI and Release Version Automation Using GitHub Actions</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Thu, 30 Jun 2022 09:05:59 +0000</pubDate>
      <link>https://forem.com/iamtekson/publish-package-to-pypi-and-release-new-version-using-github-actions-108k</link>
      <guid>https://forem.com/iamtekson/publish-package-to-pypi-and-release-new-version-using-github-actions-108k</guid>
      <description>&lt;p&gt;Manually creating tags, publishing the package and creating the GitHub release is time consuming repetitive task. Creating the version means, same version should be used to create the release and also to publish the package to PyPI library. In this article, I am going to automate this process. Please follow the following steps to automate such task,&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create the API token from PyPI
&lt;/h2&gt;

&lt;p&gt;The API token can be created from &lt;a href="https://pypi.org/manage/account/" rel="noopener noreferrer"&gt;PyPI user account setting&lt;/a&gt;. After creating the token, it will be listed out in the API key section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzct2uchmx3eyhoytvhs.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzct2uchmx3eyhoytvhs.png" alt="create API token from pypi"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Add API key to the GitHub secret
&lt;/h2&gt;

&lt;p&gt;Now, you need to add the same to the GitHub repository secret. To add that, you need to go to the repository setting, then click on &lt;code&gt;Secrets &amp;gt; actions &amp;gt; New repository secret&lt;/code&gt;. Add the name of the secret as &lt;code&gt;PYPI_API_TOKEN&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtf1ffzx8winrs4j6qpa.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdtf1ffzx8winrs4j6qpa.png" alt="add GitHub secret"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Add the YML file to GitHub Workflow
&lt;/h2&gt;

&lt;p&gt;In the repository, create &lt;code&gt;.github/workflows/release_to_pypi.yml&lt;/code&gt; file. In this file, you need to write the configuration code for publishing your package. Write the following code into release file to get start,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish ${package_name} to PyPI / GitHub&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v*"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first name key denotes the name of the task. The second chunk, &lt;code&gt;on&lt;/code&gt; key denotes on which condition this condition should run. In above case, whenever the tag starting with letter &lt;code&gt;v&lt;/code&gt; is pushed into GitHub, this action will run. &lt;/p&gt;

&lt;p&gt;Now add the jobs for this action,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build-n-publish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build and publish to PyPI&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout source&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Set up Python&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-python@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;python-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3.x"&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build source and wheel distributions&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;python -m pip install --upgrade build twine&lt;/span&gt;
          &lt;span class="s"&gt;python -m build&lt;/span&gt;
          &lt;span class="s"&gt;twine check --strict dist/*&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish distribution to PyPI&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pypa/gh-action-pypi-publish@master&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;__token__&lt;/span&gt;
          &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.PYPI_API_TOKEN }}&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create GitHub Release&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;create_release&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/create-release@v1&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt; &lt;span class="c1"&gt;# This token is provided by Actions, you do not need to create your own token&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;tag_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.ref }}&lt;/span&gt;
          &lt;span class="na"&gt;release_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.ref }}&lt;/span&gt;
          &lt;span class="na"&gt;draft&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
          &lt;span class="na"&gt;prerelease&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get Asset name&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;export PKG=$(ls dist/ | grep tar)&lt;/span&gt;
          &lt;span class="s"&gt;set -- $PKG&lt;/span&gt;
          &lt;span class="s"&gt;echo "name=$1" &amp;gt;&amp;gt; $GITHUB_ENV&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload Release Asset (sdist) to GitHub&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;upload-release-asset&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-release-asset@v1&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;upload_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.create_release.outputs.upload_url }}&lt;/span&gt;
          &lt;span class="na"&gt;asset_path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist/${{ env.name }}&lt;/span&gt;
          &lt;span class="na"&gt;asset_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ env.name }}&lt;/span&gt;
          &lt;span class="na"&gt;asset_content_type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/zip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These all things are the default things for publishing the package to the PyPI library and to release the GitHub version. You simply copy and paste this code to &lt;code&gt;release_to_pypi.yml&lt;/code&gt; library. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I only want to address two things here, the first one is, in the password key(&lt;code&gt;password: ${{ secrets.PYPI_API_TOKEN }}&lt;/code&gt;), the secrets we created in previous step is going to use. Make sure the name of the secret creating in the GitHub repository matched to the name of the above variable. Another things is, the GITHUB_TOKEN key (&lt;code&gt;GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}&lt;/code&gt;), this secret is provided by GitHub actions, you don't need to create your own token. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you only want to publish package to PyPI (Do not want to release in GitHub, feel free to remove the last two section from above code, i.e.,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt; &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create GitHub Release&lt;/span&gt;
        &lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;create_release&lt;/span&gt;
        &lt;span class="s"&gt;uses&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/create-release@v1&lt;/span&gt;
        &lt;span class="s"&gt;env&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt; &lt;span class="c1"&gt;# This token is provided by Actions, you do not need to create your own token&lt;/span&gt;
   &lt;span class="err"&gt;     &lt;/span&gt;&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;tag_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.ref }}&lt;/span&gt;
          &lt;span class="na"&gt;release_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.ref }}&lt;/span&gt;
          &lt;span class="na"&gt;draft&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
          &lt;span class="na"&gt;prerelease&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Get Asset name&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;export PKG=$(ls dist/ | grep tar)&lt;/span&gt;
          &lt;span class="s"&gt;set -- $PKG&lt;/span&gt;
          &lt;span class="s"&gt;echo "name=$1" &amp;gt;&amp;gt; $GITHUB_ENV&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Upload Release Asset (sdist) to GitHub&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;upload-release-asset&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-release-asset@v1&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;upload_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.create_release.outputs.upload_url }}&lt;/span&gt;
          &lt;span class="na"&gt;asset_path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist/${{ env.name }}&lt;/span&gt;
          &lt;span class="na"&gt;asset_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ env.name }}&lt;/span&gt;
          &lt;span class="na"&gt;asset_content_type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;application/zip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Test whether it will work or not
&lt;/h2&gt;

&lt;p&gt;Finally, it is time to test our workflow whether it will work or not. To test it, first of all, lets create the version in using &lt;code&gt;git&lt;/code&gt;,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag -a "v0.0.1-beta" -m "beta version testing"
git push --tags
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After pushing this &lt;code&gt;tag&lt;/code&gt; to the GitHub, it should trigger your GitHub action something like below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc07irnvkdgh1sn9ywx1k.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc07irnvkdgh1sn9ywx1k.png" alt="GitHub action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! you are successfully integrated this automation.&lt;/p&gt;

&lt;p&gt;If you like this blog, please support me by subscribing to my YouTube channel: &lt;a href="https://www.youtube.com/c/iamtekson" rel="noopener noreferrer"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>python</category>
      <category>package</category>
      <category>action</category>
    </item>
    <item>
      <title>How to migrate database into production server in Django</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Fri, 20 May 2022 06:57:31 +0000</pubDate>
      <link>https://forem.com/iamtekson/how-to-migrate-your-development-database-to-production-in-django-1j86</link>
      <guid>https://forem.com/iamtekson/how-to-migrate-your-development-database-to-production-in-django-1j86</guid>
      <description>&lt;p&gt;I search a lot about how to migrate the Django model as well as whole data from the development database to production, and I found lots of explanation about it (One of the good explanations is &lt;a href="https://stackoverflow.com/a/10860413/9354344"&gt;here&lt;/a&gt;) but did not find the easy solution. For this problem, I come up with my solution and I am explaining in this blog how to do that. Before moving to the core thing about this blog, I just want to raise one question and my thought about it.&lt;/p&gt;

&lt;h5&gt;
  
  
  Do I need to push my migration file to GitHub?
&lt;/h5&gt;

&lt;p&gt;All individuals have their own perspectives. I was also confused about what is the best practice in beginning of my Django journey. After reading &lt;a href="https://stackoverflow.com/a/67986271/9354344"&gt;this answer from&lt;/a&gt;, I tried to push my migrations as well. But I think it is not a good way, so I removed the migrations from GitHub.&lt;/p&gt;

&lt;p&gt;Okay, now lets start the core thing step by step:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create the backup for your database
&lt;/h3&gt;

&lt;p&gt;The first step is to create the database backup. In my case, I am using the PostgreSQL database. To create the backup file, I simply need to run the following command in the terminal,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pg_dump &lt;span class="nt"&gt;-U&lt;/span&gt; postgres &lt;span class="nt"&gt;-h&lt;/span&gt; localhost &lt;span class="nt"&gt;-d&lt;/span&gt; database &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; db_backup_2022_05_20.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;where, &lt;code&gt;postgres&lt;/code&gt; is the database user, &lt;code&gt;localhost&lt;/code&gt; is the database host, &lt;code&gt;database&lt;/code&gt; is the database name and &lt;code&gt;db_backup_2022_05_20.sql&lt;/code&gt; is the backup file name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. Migrate the Django models to the server
&lt;/h3&gt;

&lt;p&gt;Since this blog is only about how to migrate the database (not about the whole procedure of how to publish the Django site into production), I am only focusing on the database migration. After pulling the code to the server, the first step is to migrate the database tables and schema only by using the Django command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# make migrations&lt;/span&gt;
python manage.py makemigrations

&lt;span class="c"&gt;# migrate models&lt;/span&gt;
python manage.py migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Migrate the data
&lt;/h3&gt;

&lt;p&gt;If you want the clean database to initialize the production environment, it is a good way to go, no further action is needed. But if you want to move all the data from the developer environment to production, you need to restore the development database. To do so, if you go with the normal method, you might get an error due to a foreign key, and also duplicated data issue. But to prevent this action and restore data only, the &lt;code&gt;psql&lt;/code&gt; provides a nice command line. You just need to do the following,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pg_restore &lt;span class="nt"&gt;-U&lt;/span&gt; postgres &lt;span class="nt"&gt;-h&lt;/span&gt; IP &lt;span class="nt"&gt;-d&lt;/span&gt; database &lt;span class="nt"&gt;--disable-triggers&lt;/span&gt; &lt;span class="nt"&gt;--data-only&lt;/span&gt; db_backup_2022_05_12.sql     
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Where, &lt;code&gt;postgres&lt;/code&gt; is the database user, &lt;code&gt;ip&lt;/code&gt; is the server IP address, &lt;code&gt;database&lt;/code&gt; is the database name and &lt;code&gt;db_backup_2022_05_12.sql&lt;/code&gt; is the backup file location. If you want to know more about the pg_restore command, please check &lt;a href="https://www.postgresql.org/docs/current/app-pgrestore.html"&gt;this official documentation&lt;/a&gt;. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This step might throw some error messages or warnings as well, but you can simply ignore those.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. What next?
&lt;/h3&gt;

&lt;p&gt;If you want to update the Django model, you can first test your model in the development environment. To update those changes on production, you just need to migrate the model as below on the server,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# make migrations&lt;/span&gt;
python manage.py makemigrations

&lt;span class="c"&gt;# migrate models&lt;/span&gt;
python manage.py migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The migration file from the development and production environment will be different. If you check both databases from development and production, you will find the different data in the &lt;code&gt;django_migration&lt;/code&gt; table. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Congratulations! you finally migrated the database with all the data from the development environment to production. &lt;/p&gt;

&lt;p&gt;If you like this blog, please support me by subscribing to my YouTube channel: &lt;a href="https://www.youtube.com/c/iamtekson"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>migration</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Docker remove all image, volume, container</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Fri, 13 May 2022 03:08:29 +0000</pubDate>
      <link>https://forem.com/iamtekson/docker-remove-all-image-volume-container-3j54</link>
      <guid>https://forem.com/iamtekson/docker-remove-all-image-volume-container-3j54</guid>
      <description>&lt;p&gt;Here I am going to write about removing docker images, volumes and containers. To do so, first of all, you need to shutdown the docker container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose down
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, you can follow following method to remove required things,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# To remove all the containers&lt;/span&gt;
docker &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;docker ps &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# To remove all the docker images&lt;/span&gt;
docker rmi &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;docker images &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# To remove all the volumes&lt;/span&gt;
docker volume &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;docker volume &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# To delete everything&lt;/span&gt;
docker system prune &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;--volumes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>docker</category>
      <category>image</category>
      <category>container</category>
      <category>dockercompose</category>
    </item>
    <item>
      <title>Flood mapping using Sentinel 1 Imagery on Snap Toolbox</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Thu, 05 May 2022 02:04:44 +0000</pubDate>
      <link>https://forem.com/iamtekson/flood-mapping-using-sentinel-1-imagery-on-snap-toolbox-3obd</link>
      <guid>https://forem.com/iamtekson/flood-mapping-using-sentinel-1-imagery-on-snap-toolbox-3obd</guid>
      <description>&lt;p&gt;The sentinel 1 imagery is the freely available SAR dataset. The dataset can be downloaded from the &lt;a href="https://scihub.copernicus.eu/"&gt;Copernicus Open Access Hub&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The snap Toolbox is an open source software for processing the sentinel products. The snap software provides the interactive GUI to process the raster dataset. &lt;/p&gt;

&lt;p&gt;A flood is an overflow of water that submerges land that is usually dry. It is very common type of hazard which mainly occur in rainy season. The flood mapping can help to plan and mitigate the risk.&lt;/p&gt;

&lt;p&gt;In this article, I am going to write about the flood mapping technique using SAR dataset provided by sentinel 1 imagery on Snap Toolbox. The overall methodology for flood mapping will be looks like this,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Need to upload an methodology image&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Download data and load it into Snap Toolbox
&lt;/h3&gt;

&lt;p&gt;You can download the data freely from &lt;a href="https://scihub.copernicus.eu/"&gt;Copernicus Open Access Hub&lt;/a&gt;. You need to download the data before and after flood event. Lets say, if the flood event happen in July 31, you need sentinel 1 dataset before July 31 and after July 31. You can filter the data as below,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Draw the boundary on your study area.&lt;/li&gt;
&lt;li&gt;Under mission sentinel 1, select satellite platform as &lt;code&gt;S1A_*&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select product type as &lt;code&gt;GRD&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click the search button&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YtSMDS8t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r95z93x0101veni4nox9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YtSMDS8t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r95z93x0101veni4nox9.png" alt="Image description" width="669" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The downloaded data will be in &lt;code&gt;.zip&lt;/code&gt; format. Don't worry, Snap Toolbox can read the data directly from &lt;code&gt;.zip&lt;/code&gt; format. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please note that before applying any correction, the data will load in random orientation. I mean, the map will not be north oriented.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Mask data to the Area of Interest
&lt;/h3&gt;

&lt;p&gt;To mask the dataset, you need to zoom the dataset to your area of interest. Under &lt;code&gt;raster&lt;/code&gt; menu, you will find the &lt;code&gt;Subset&lt;/code&gt; option, from where you can crop the data to the required area. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To view two image side by side, you might need to &lt;code&gt;view &amp;gt; syncronise image views&lt;/code&gt; and &lt;code&gt;Window &amp;gt; Tile evenly&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Multilooking
&lt;/h3&gt;

&lt;p&gt;It is the process for reducing the size of the image. It might also reduce some spackles on the image. It is totally optional, if you need the high resolution output, don't do this step. The multilooking feature is available here: &lt;code&gt;Radar &amp;gt; SAR Utilities &amp;gt; Multilooking&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Radiometric Calibration
&lt;/h3&gt;

&lt;p&gt;The objective of SAR calibration is to provide imagery in which the pixel values can be directly related to the radar backscatter of the scene. Though uncalibrated SAR imagery is sufficient for qualitative use, calibrated SAR images are essential to quantitative use of SAR data. The feature is available here: &lt;code&gt;Radar &amp;gt; Radiometric &amp;gt; Calibrate&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sfh6BQTf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxf5hxfzx61zvgoe6a7h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sfh6BQTf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxf5hxfzx61zvgoe6a7h.png" alt="radiometric calibration" width="435" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to visualize the image more nicely, you can convert it to the dB by simply &lt;code&gt;right click on the image &amp;gt; Linear to/from dB&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lF63LSii--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5v3tbogypl7fropynfa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lF63LSii--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5v3tbogypl7fropynfa.png" alt="Radiometric correction" width="316" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Terrain correction
&lt;/h3&gt;

&lt;p&gt;Due to topographical variations of a scene and the tilt of the satellite sensor, distances can be distorted in the SAR images. Image data not directly at the sensor’s Nadir location will have some distortion. Terrain corrections are intended to compensate for these distortions so that the geometric representation of the image will be as close as possible to the real world. After applying this correction, the image will be correctly oriented. You can leave all the parameters as default value. This feature is available here: &lt;code&gt;Radar &amp;gt; Geometry &amp;gt; Terrain correction &amp;gt; Range Doppler Terrain Correction&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VNTkZVdG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wipys7ycepyzoe5n1aq9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VNTkZVdG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wipys7ycepyzoe5n1aq9.png" alt="Terrain correction" width="508" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create stack
&lt;/h3&gt;

&lt;p&gt;After applying the radiometric and geometric correction, you need to create the composite band, i.e. need to stack the both images into one. To do so, you need to convert the image to band and save the product. After that, you need to create the stack, the tool is available here: &lt;code&gt;Radar &amp;gt; Coregistration &amp;gt; Stack Tools &amp;gt; Create Stack&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CjVOz-Wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xrkj2fzwm03hg4rcc3yu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CjVOz-Wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xrkj2fzwm03hg4rcc3yu.png" alt="Create stack" width="636" height="294"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J2Fxmoxc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v932luzdahc8l9g0us6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J2Fxmoxc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v932luzdahc8l9g0us6v.png" alt="Create stack method" width="689" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that now you can visualize the products and see the difference between two maps. For better visualization you can make the RGB image using &lt;code&gt;window &amp;gt; Open RGB Image Window&lt;/code&gt; as below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RBEU7MId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft4dbyq5e0ssx1xrjsgn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RBEU7MId--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft4dbyq5e0ssx1xrjsgn.png" alt="RGB image builder" width="419" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your final product will look like this,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LXInSSl9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jc7wgo2p41ehn410krom.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LXInSSl9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jc7wgo2p41ehn410krom.png" alt="Flood map" width="800" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you like this blog, please subscribe to my YouTube channel for more contents related to GIS and Remote Sensing topics: &lt;a href="https://www.youtube.com/c/iamtekson"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://youtu.be/derOXkPCH80"&gt;ESA Echoes in Space - Hazard: Flood mapping with Sentinel-1&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>sentinel1</category>
      <category>flood</category>
      <category>snap</category>
    </item>
    <item>
      <title>How to Access Jupyter Notebook Remotely on Webbrowser</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Tue, 19 Oct 2021 08:16:51 +0000</pubDate>
      <link>https://forem.com/iamtekson/how-to-access-jupyter-notebook-remotely-on-webbrowser-3jje</link>
      <guid>https://forem.com/iamtekson/how-to-access-jupyter-notebook-remotely-on-webbrowser-3jje</guid>
      <description>&lt;p&gt;To access the remote jupyter notebook, you need to install and setup the jupyter notebook on server first. You can install the jupyter notebook using &lt;a href="https://www.geeksforgeeks.org/how-to-install-anaconda-on-windows/" rel="noopener noreferrer"&gt;this tutorial&lt;/a&gt;. Now you can see the available options from jupyter notebook using this command,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

jupyter notebook &lt;span class="nt"&gt;--help&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You will see the output like below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xdgtri5camveoh4n5pp.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xdgtri5camveoh4n5pp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you scroll little bit below, you will see the &lt;code&gt;--ip&lt;/code&gt; and &lt;code&gt;--port&lt;/code&gt; options as well,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9xe4705m2mwwj0ktr80b.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9xe4705m2mwwj0ktr80b.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Protect notebook with password
&lt;/h3&gt;

&lt;p&gt;To protect jupyter notebook with the password, you need to type following command,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

jupyter notebook password


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The reason for you to make password is, When you access Jupyter notebook server on web browser, You have to enter the password.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run the jupyter notebook on server
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

jupyter notebook –no-browser –ip&lt;span class="o"&gt;=&lt;/span&gt;”your server IP Address” –port&lt;span class="o"&gt;=&lt;/span&gt;8888


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Replace the ip address by your ip in above code.&lt;/p&gt;

&lt;p&gt;From now, your notebook can be access from remote web-browsers.&lt;/p&gt;

&lt;p&gt;you can go to chrome and type, &lt;a href="http://0.0.0.0:8888" rel="noopener noreferrer"&gt;http://{your ip address}:8888&lt;/a&gt; to access the same jupyter notebook.&lt;/p&gt;

&lt;p&gt;Congratulations! You successfully setup the jupyter notebook on the remote server.&lt;/p&gt;

&lt;p&gt;If you like this blog, please subscribe to my youtube channel: &lt;a href="https://www.youtube.com/c/iamtekson" rel="noopener noreferrer"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>jupyter</category>
      <category>python</category>
      <category>anaconda</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Installation of GDAL on jupyter notebook</title>
      <dc:creator>Tek Kshetri</dc:creator>
      <pubDate>Tue, 19 Oct 2021 07:54:54 +0000</pubDate>
      <link>https://forem.com/iamtekson/installation-of-gdal-on-jupyter-notebook-p5d</link>
      <guid>https://forem.com/iamtekson/installation-of-gdal-on-jupyter-notebook-p5d</guid>
      <description>&lt;p&gt;Installation of &lt;code&gt;GDAL&lt;/code&gt; in windows machine is always a challenging task. But anaconda environment on python makes it easier to install through &lt;code&gt;conda&lt;/code&gt; distribution. In this blog, I will write about the installation of &lt;code&gt;GDAL&lt;/code&gt; on jupyter notebook.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create conda environment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda create &lt;span class="nt"&gt;--name&lt;/span&gt; venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating the virtual environment, by default it will install some of the packages. &lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Installation of gdal
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; conda-forge gdal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Installation of ipykernel
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;conda &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; anaconda ipykernel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Add ipykernel and run jupyternotebook
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; ipykernel &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--user&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;venv
jupyter notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! You successfully installed the GDAL on jupyter notebook.&lt;/p&gt;

&lt;p&gt;If you like this blog, please subscribe to my youtube channel: &lt;a href="https://www.youtube.com/c/iamtekson"&gt;https://www.youtube.com/c/iamtekson&lt;/a&gt;&lt;/p&gt;

</description>
      <category>jupyter</category>
      <category>gdal</category>
      <category>python</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
