<?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: K-adesh123</title>
    <description>The latest articles on DEV Community by K-adesh123 (@kadesh123).</description>
    <link>https://dev.to/kadesh123</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4259529%2F860cebc3-a791-49ab-8543-d976a24fe682.png</url>
      <title>DEV Community: K-adesh123</title>
      <link>https://dev.to/kadesh123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kadesh123"/>
    <language>en</language>
    <item>
      <title>How I Built a Markdown-to-Blogger Publishing Pipeline with Python and Google OAuth 2.0</title>
      <dc:creator>K-adesh123</dc:creator>
      <pubDate>Tue, 24 Nov 2026 07:59:06 +0000</pubDate>
      <link>https://dev.to/kadesh123/how-i-built-a-markdown-to-blogger-publishing-pipeline-with-python-and-google-oauth-20-5322</link>
      <guid>https://dev.to/kadesh123/how-i-built-a-markdown-to-blogger-publishing-pipeline-with-python-and-google-oauth-20-5322</guid>
      <description>&lt;p&gt;&lt;em&gt;By Fashel Creations | FASHSYST — Digital Systems Builder and Cloud/DevOps Engineer&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Building cloud and automation projects is only part of the work. If I cannot explain what I built, why I made particular decisions, or how I verified the results, the project is much less useful as an engineering portfolio.&lt;/p&gt;

&lt;p&gt;I wanted a repeatable way to document technical projects without manually copying and reformatting each article in a blogging dashboard. So I built a small Python-based publishing workflow that turns a Markdown article into an &lt;strong&gt;unpublished Blogger draft&lt;/strong&gt;, ready for review.&lt;/p&gt;

&lt;p&gt;This is the first version of that system, built and tested in WSL Ubuntu with Python, Google OAuth 2.0, the Blogger API, and GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: technical writing shouldn't require repeating the same work
&lt;/h2&gt;

&lt;p&gt;As I build projects in cloud infrastructure, CI/CD, and business automation, each project produces explanations, commands, screenshots, and troubleshooting lessons.&lt;/p&gt;

&lt;p&gt;I want those records to remain useful in three places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;, as version-controlled engineering documentation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My technical blog&lt;/strong&gt;, as a readable explanation of the problem and solution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My interview preparation&lt;/strong&gt;, as proof that I understand the decisions and trade-offs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The manual approach would be to write in one place, copy the text into another platform, fix the formatting, and repeat it for every article. I decided to automate the transfer while keeping final publication under human control.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture
&lt;/h2&gt;

&lt;p&gt;Here is the actual workflow we implemented:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Markdown article (.md)
        |
        v
Python command-line script
        |
        v
Validate article path and read content
        |
        v
Extract heading + convert Markdown to HTML
        |
        v
Ask author to confirm draft creation
        |
        v
Load or refresh Google OAuth credentials
        |
        v
Google Blogger API v3
        |
        v
Create unpublished Blogger draft
        |
        v
Review in Blogger before publishing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two key Python files in the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;blogger_auth.py&lt;/code&gt; handles the Google OAuth authorization process and checks access to Blogger.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;blogger_publish.py&lt;/code&gt; reads a selected article, converts it to HTML, and creates an unpublished draft through the API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The distinction matters:&lt;/strong&gt; authentication establishes authorized access; the publishing script performs the specific operation using that access.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tools and why I chose them
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Role in the workflow&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Python&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Processes files and makes API calls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Markdown&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Keeps technical writing lightweight and version-controlled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Python &lt;code&gt;markdown&lt;/code&gt; package&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Converts Markdown into HTML&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Google OAuth 2.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Grants authorized access without hardcoding a Google password&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Blogger API v3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Creates the draft programmatically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Git and GitHub&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Track code, articles, and verified project evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;WSL Ubuntu and VS Code&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Local development environment&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I chose a command-line workflow first because it is simple to inspect, inexpensive to run locally, and easy to extend later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Authorize the application with Google OAuth
&lt;/h2&gt;

&lt;p&gt;The first challenge was getting Python to communicate with the correct Blogger account.&lt;/p&gt;

&lt;p&gt;After enabling the Blogger API and configuring a Google OAuth desktop client, I used Google's Python client libraries to complete the browser authorization flow.&lt;/p&gt;

&lt;p&gt;The authentication script requests the Blogger permission scope:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="no"&gt;SCOPES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"https://www.googleapis.com/auth/blogger"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When authorization succeeds, the program stores the resulting token locally and can reuse or refresh it in later runs.&lt;/p&gt;

&lt;p&gt;The token file lives under &lt;code&gt;credentials/token.json&lt;/code&gt; on my machine. It is &lt;strong&gt;not&lt;/strong&gt; part of the public GitHub repository.&lt;/p&gt;

&lt;p&gt;I verified that the API connection could list the blog before moving to article creation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Store articles separately from application code
&lt;/h2&gt;

&lt;p&gt;My first working test used HTML written directly inside the Python publishing script. That proved the API could create a draft, but it was not reusable.&lt;/p&gt;

&lt;p&gt;I improved the design by moving article content into a separate &lt;code&gt;articles/&lt;/code&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fashsyst-technical-publishing/
├── articles/
│   ├── publishing-test.md
│   └── markdown-to-blogger-automation.md
├── blogger_auth.py
├── blogger_publish.py
├── .gitignore
└── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This separates &lt;strong&gt;content&lt;/strong&gt; from the &lt;strong&gt;logic that delivers it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now I can create a new Markdown article without changing the Python script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Validate and convert Markdown
&lt;/h2&gt;

&lt;p&gt;The publishing script accepts a Markdown file path as a command-line argument. It checks that the file exists, has a &lt;code&gt;.md&lt;/code&gt; extension, contains text, and resolves to a path inside the intended articles directory.&lt;/p&gt;

&lt;p&gt;Then the script uses the first Markdown level-one heading as the Blogger title.&lt;/p&gt;

&lt;p&gt;A simplified excerpt of the conversion step looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;article_path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&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="s2"&gt;"fenced_code"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tables"&lt;/span&gt;&lt;span class="p"&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;p&gt;For example, the Markdown heading:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Building a repeatable workflow
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;becomes an HTML heading that Blogger can display.&lt;/p&gt;

&lt;p&gt;This allows articles to contain structured explanations, bullet points, technical tables, and code examples while remaining easy to edit in VS Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Create a draft through the Blogger API
&lt;/h2&gt;

&lt;p&gt;After preparing the article, the script explicitly asks whether to create a draft.&lt;/p&gt;

&lt;p&gt;Once confirmed, it uses the authenticated Blogger client to submit the title and HTML content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;post&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"kind"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"blogger#post"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&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="n"&gt;blogId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;BLOG_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;isDraft&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&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;p&gt;The setting &lt;code&gt;isDraft=True&lt;/code&gt; is deliberate. &lt;strong&gt;The automation prepares the article, but it does not publish it publicly without review.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The program then displays the title and Blogger post ID so I can verify the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Verify the result instead of assuming it worked
&lt;/h2&gt;

&lt;p&gt;I ran an initial API integration test, followed by a separate test that read a Markdown file.&lt;/p&gt;

&lt;p&gt;The second test created a Blogger draft titled &lt;strong&gt;“Building an Automated Technical Publishing System with Python.”&lt;/strong&gt; I checked the Blogger Posts dashboard and confirmed the entry was marked &lt;strong&gt;Draft&lt;/strong&gt;.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz6r9487jj27z1ypsdt3f.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz6r9487jj27z1ypsdt3f.jpg" alt="Blogger dashboard confirming the unpublished Markdown-generated draft" width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also initialized a dedicated Git repository, verified that credentials and the Python virtual environment were ignored, and pushed the code to GitHub.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fldy2gqf6vu1hrw5ws0g0.jpg" 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fldy2gqf6vu1hrw5ws0g0.jpg" alt="Initial FASHSYST technical publishing repository push" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These checks matter because a successful-looking terminal command is not enough evidence on its own. I wanted to verify both the remote result in Blogger and the contents actually stored in GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security decisions and lessons learned
&lt;/h2&gt;

&lt;p&gt;A publishing system needs more than working API calls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Keep credentials outside source control.&lt;/strong&gt; My &lt;code&gt;.gitignore&lt;/code&gt; excludes &lt;code&gt;credentials/&lt;/code&gt;, &lt;code&gt;token.json&lt;/code&gt;, &lt;code&gt;.env&lt;/code&gt; files, and &lt;code&gt;.venv/&lt;/code&gt;. I checked Git's staged file list before the first commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Review what Git will commit.&lt;/strong&gt; The commands &lt;code&gt;git diff --cached --name-only&lt;/code&gt; and &lt;code&gt;git status&lt;/code&gt; helped me inspect staged files. Ignore rules do not remove secrets already committed in Git history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Preserve an approval step.&lt;/strong&gt; This prototype creates an unpublished Blogger draft and requires a human to review and publish it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Verify the remote outcome.&lt;/strong&gt; I inspected the Blogger dashboard instead of treating an API response as the only proof of success.&lt;/p&gt;

&lt;p&gt;There are also limitations. A confirmed run currently creates a new draft each time, so repeating a command can create duplicates. The code has no automated test suite, no scheduled execution, and no built-in API retry strategy yet. The destination blog ID is still configured in the Python script.&lt;/p&gt;

&lt;p&gt;Those are engineering improvements to address, not features I can claim are already implemented.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would improve next
&lt;/h2&gt;

&lt;p&gt;My next development milestones are to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add automated tests for file validation, title extraction, and Markdown conversion.&lt;/li&gt;
&lt;li&gt;Make the destination blog configurable without editing application code.&lt;/li&gt;
&lt;li&gt;Add structured error handling and duplicate-draft protection.&lt;/li&gt;
&lt;li&gt;Run safe validation checks in GitHub Actions before merging changes.&lt;/li&gt;
&lt;li&gt;Extend approved article distribution to other platforms while preserving the original source.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I also maintain a project study guide so I can explain how the workflow operates, what could fail, and how I would troubleshoot it in an interview.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bigger lesson
&lt;/h2&gt;

&lt;p&gt;This was a small project, but it changed how I think about technical content creation.&lt;/p&gt;

&lt;p&gt;Instead of treating documentation as something to do after a project is finished, I am making it part of the engineering process: &lt;strong&gt;build, verify, document, explain, and improve.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That process helps me grow real DevOps competence while building a portfolio that reflects systems I have actually implemented.&lt;/p&gt;

&lt;p&gt;You can explore the code, documentation, architecture, and verification evidence in the &lt;a href="https://github.com/K-adesh123/fashsyst-technical-publishing" rel="noopener noreferrer"&gt;FASHSYST Technical Publishing Automation GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;FASHSYST builds digital systems. Fashel Creations shares the skills and thinking behind building them.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>devops</category>
      <category>automation</category>
      <category>blogger</category>
    </item>
  </channel>
</rss>
