<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>python on Amin Alaee</title>
    <link>https://aminalaee.github.io/tags/python/</link>
    <description>Recent content in python on Amin Alaee</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 29 Jun 2023 12:00:06 +0100</lastBuildDate><atom:link href="https://aminalaee.github.io/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Pytest async tests and fixtures</title>
      <link>https://aminalaee.github.io/posts/2023/pytest-async-tests/</link>
      <pubDate>Thu, 29 Jun 2023 12:00:06 +0100</pubDate>
      
      <guid>https://aminalaee.github.io/posts/2023/pytest-async-tests/</guid>
      <description>Async tests and fixtures Pytest already has the official pytest-asyncio plugin which allows you to write async tests and fixtures.
According to pytest-asyncio docs, you can have an async test with an async fixture like this:
from typing import Any, AsyncGenerator import pytest import pytest_asyncio from httpx import AsyncClient @pytest_asyncio.fixture async def client() -&amp;gt; AsyncGenerator[AsyncClient, Any]: async with AsyncClient() as c: yield c @pytest.mark.asyncio async def test_api_call(client: AsyncClient) -&amp;gt; None: response = await client.</description>
    </item>
    
    <item>
      <title>Python requests Connection Pool</title>
      <link>https://aminalaee.github.io/posts/2023/python-requests-persistent-connections/</link>
      <pubDate>Thu, 16 Feb 2023 12:00:47 +0100</pubDate>
      
      <guid>https://aminalaee.github.io/posts/2023/python-requests-persistent-connections/</guid>
      <description>Summary Recently I was working on a project that integrated with some internal and external APIs using HTTP requests. You probably have heard about or worked with the requests library in Python which is probably the de-facto HTTP client package which is much easier to work with compared to the built-in HTTP module of Python.
The previous implementation in our project was using the requests library and for each new request it did something like requests.</description>
    </item>
    
    <item>
      <title>Pydantic Settings with AWS Secrets Manager</title>
      <link>https://aminalaee.github.io/posts/2023/pydantic-settings-secret-manager/</link>
      <pubDate>Thu, 26 Jan 2023 16:53:06 +0100</pubDate>
      
      <guid>https://aminalaee.github.io/posts/2023/pydantic-settings-secret-manager/</guid>
      <description>Intro If you are already familiar with Pydantic, one of the useful components of Pydantic is the Settings Management. This will allow you to read settings variables from different sources and parse and validate them into class(es) using Pydantic.
Let&amp;rsquo;s see a minimal example. First we need to set up the variable:
$ export API_KEY=xxx And then we can read it into the Settings class with:
from pydantic import BaseSettings class Settings(BaseSettings): api_key: str print(Settings().</description>
    </item>
    
    <item>
      <title>Python JSON Logging</title>
      <link>https://aminalaee.github.io/posts/2022/python-json-logging/</link>
      <pubDate>Wed, 14 Sep 2022 15:09:46 +0200</pubDate>
      
      <guid>https://aminalaee.github.io/posts/2022/python-json-logging/</guid>
      <description>How to do simple JSON logging in Python?</description>
    </item>
    
  </channel>
</rss>
