<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sarumathy P on Medium]]></title>
        <description><![CDATA[Stories by Sarumathy P on Medium]]></description>
        <link>https://medium.com/@sarumathyprabakaran?source=rss-e61a4cd0cf62------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*P6VOrrCSOEEHi1hR</url>
            <title>Stories by Sarumathy P on Medium</title>
            <link>https://medium.com/@sarumathyprabakaran?source=rss-e61a4cd0cf62------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 20:53:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sarumathyprabakaran/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My Internship Journey at Featurepreneur.]]></title>
            <link>https://medium.com/featurepreneur/my-internship-journey-at-featurepreneur-b9ffae452d8a?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9ffae452d8a</guid>
            <category><![CDATA[tactlabs]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[journey]]></category>
            <category><![CDATA[opportunity]]></category>
            <category><![CDATA[internships]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Mon, 05 Jun 2023 16:14:35 GMT</pubDate>
            <atom:updated>2023-06-05T16:14:35.747Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*vbB2JoSDiBFSS5Z-b6uGnw.png" /></figure><p>Embarking on an internship is a crucial milestone in any aspiring developer’s journey. From January 2022 to March 2023, I had the incredible opportunity to work as a <strong>Developer Intern</strong> at <strong>Featurepreneur</strong>, where I was immersed in a dynamic environment that fostered growth and learning. Throughout this internship, I honed my technical skills in Flask, FastAPI, Docker, Selenium, and AWS, while also developing essential soft skills. In this article, I will share my experiences, projects, and the valuable lessons I learned during my internship at Featurepreneur.</p><p><strong>Real-World Application Development:</strong></p><p>From the very start of my internship, I had the opportunity to work on real-world applications. Initially, I collaborated with my seniors, learning from their expertise as we completed tasks together. This hands-on experience allowed me to gain valuable insights into the development process.</p><p>As time progressed, I was entrusted with tasks that I completed by acquiring the necessary knowledge and skills.</p><p><strong>Collaborative Projects and Enhancing Featurepreneur’s Website</strong></p><p>During my internship at <a href="https://featurepreneur.com/">Featurepreneur</a>, I had the exciting opportunity to contribute to the company’s website and collaborate with fellow interns. Together, we worked on enhancing the website’s functionality by adding new features, such as browsing courses and managing credits.</p><p>Through collaborative efforts, we brainstormed ideas, shared insights, and collectively implemented these features to improve the user experience of Featurepreneur’s website.</p><p><strong>Automating Processes and Optimizing Data Collection:</strong></p><p>Effective data collection is crucial for businesses and projects as it provides valuable insights and information that drive decision-making and analysis. At Featurepreneur, we recognize the importance of data collection and leverage automation tools to streamline this process. Selenium and Sikuli are two powerful tools I utilized to automate data collection and enhance efficiency. The automation I did was fun and Interesting.</p><p><strong>Containerization with Docker</strong></p><p>During my internship at Featurepreneur, I had the opportunity to gain hands-on experience with Docker, a powerful containerization platform. Additionally, I had the privilege of attending sessions with experienced seniors who shared their expertise and insights, enabling me to further enhance my skills. In this article, I will share my experience of working with Docker and the valuable lessons I learned through collaborative sessions with senior professionals.</p><p><strong>DevOps and Cloud Journey:</strong></p><p>During my internship at Featurepreneur, I had an exciting introduction to cloud computing through Amazon Web Services (AWS). It was my first step into this dynamic field, where I got to explore the wide range of services offered by AWS, deploy applications, and pass on my knowledge to my junior colleagues. It was an enriching experience that allowed me to learn and grow while making complex concepts easy to understand for others</p><p><strong>Peer-to-Peer Learning:</strong></p><p>At Featurepreneur, we had a valuable practice called “<strong>Knowledge Transfer</strong>” or KT. This involved sharing our newly acquired knowledge of technologies with others, allowing us to both expand our own understanding and help others grow. Whenever we learned new technology, we would conduct KT sessions to transfer that knowledge to our colleagues. These sessions were interactive and informative, aiming to make complex concepts understandable and accessible to everyone. Through this process, we not only enriched our own knowledge but also contributed to the collective growth and learning within our team.</p><p><strong>Fun Games, Hackathons, and social Sessions:</strong></p><p>During our internship at Featurepreneur, we recognized the importance of taking breaks and fostering a positive work environment. To counter long periods of sitting or extended workdays, we incorporated fun games into our routine. These short breaks, typically lasting 30 to 45 minutes, provided an opportunity to unwind, relax, and engage in enjoyable activities together. In addition to the recreational breaks, we also organized social sessions to address societal issues and encourage open discussions.</p><p><strong>Punctuality:</strong></p><p>Being punctual is highly valued in workplaces. The company places a strong emphasis on adhering to the designated start time which is flexible. They take punctuality very seriously, expecting employees to join at the specified time without delay.</p><p>My internship journey at Featurepreneur was a transformative experience that allowed me to apply my knowledge, learn new technologies, and develop crucial skills for a career in software development. Working on real-world projects, collaborating with talented individuals, and overcoming challenges have shaped me both professionally and personally.</p><p>I am grateful for the hands-on opportunities, mentorship, and valuable skills I acquired during this internship. As I move forward in my career, I am confident that the experiences and lessons learned at Featurepreneur will serve as a solid foundation for my future endeavors.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9ffae452d8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/my-internship-journey-at-featurepreneur-b9ffae452d8a">My Internship Journey at Featurepreneur.</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing PDF Generation: Integrating Text and Graphics using PyPDF2 and reportlab.]]></title>
            <link>https://medium.com/featurepreneur/enhancing-pdf-generation-integrating-text-and-graphics-using-pypdf2-and-reportlab-9fa6bc6b856e?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fa6bc6b856e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pdf]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[text]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Wed, 31 May 2023 13:14:58 GMT</pubDate>
            <atom:updated>2023-05-31T13:14:58.546Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s digital era, the need for automated document generation is paramount, particularly when it comes to creating PDF files with dynamic content3. Python, with its versatile libraries and robust functionality, offers an efficient solution for generating dynamic PDFs. One such powerful library is <strong>PyPDF2</strong>, which allows for the manipulation and merging of PDF files. In combination with the <strong>reportlab</strong> library, Python provides a comprehensive toolkit for creating customized PDF documents from templates.</p><p>In this article, we will explore how to leverage these libraries to text in PDF.</p><p><strong>Installation</strong>:</p><pre>pip install PyPDF2 reportlab</pre><p>In <strong>Ubuntu</strong> <strong>20.04</strong>, If reportlab installation throws an error like this,</p><pre>  note: This error originates from a subprocess, and is likely not a problem with pip.<br>  ERROR: Failed building wheel for pycairo<br>Failed to build pycairo<br>ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects<br><br></pre><p>The error message suggests that the build process for “pycairo” is failing due to a missing dependency, specifically the “gcc” compiler.</p><p>To resolve this issue, you can try the following steps:</p><ol><li>Install the necessary build tools and development libraries by running the following command in the terminal:</li></ol><pre>sudo apt-get install build-essential</pre><p>This command installs essential build tools, including the “gcc” compiler, which is required to build “pycairo”.</p><p>Try installing the required dependencies again using the following commands and try installing reportlab again:</p><pre>pip install wheel<br>pip install pillow<br><br>pip install reportlab</pre><p>Once all the requirements are installed, The PDF file can be modified and dynamically generated using the class,</p><pre>from PyPDF2 import PdfWriter, PdfReader, Transformation<br>import io<br>from reportlab.pdfgen.canvas import Canvas<br><br>class GenerateFromTemplate:<br>    def __init__(self,template):<br>        self.template_pdf = PdfReader(open(template, &quot;rb&quot;))<br>        self.template_page= self.template_pdf.pages[0]<br><br>        self.packet = io.BytesIO()<br>        self.c = Canvas(self.packet,pagesize=(self.template_page.mediabox.width,self.template_page.mediabox.height))<br><br>    <br>    def addText(self,text,point):<br>        self.c.drawString(point[0],point[1],text)<br><br>    def merge(self):<br>        self.c.save()<br>        self.packet.seek(0)<br>        result_pdf = PdfReader(self.packet)<br>        result = result_pdf.pages[0]<br><br>        self.output = PdfWriter()<br><br>        op = Transformation().rotate(0).translate(tx=0, ty=0)<br>        result.add_transformation(op)<br>        self.template_page.merge_page(result)<br>        self.output.add_page(self.template_page)<br>    <br>    def generate(self,dest):<br>        outputStream = open(dest,&quot;wb&quot;)<br>        self.output.write(outputStream)<br>        outputStream.close()<br><br>&quot;&quot;&quot;<br>Use as:<br>gen = GenerateFromTemplate(&quot;template.pdf&quot;)<br>gen.addText(&quot;Hello!&quot;,(100,200))<br>gen.addText(&quot;PDF!&quot;,(100,300))<br>gen.merge()<br>gen.generate(&quot;Output.pdf&quot;)<br>&quot;&quot;&quot;</pre><p>The code can be broken down into 4 parts:</p><p><strong>Part 1: Importing Libraries and Class Initialization</strong></p><p>The first part of the code involves importing the necessary libraries and initializing the main class, “GenerateFromTemplate”.</p><pre>def __init__(self,template):<br>        self.template_pdf = PdfReader(open(template, &quot;rb&quot;))<br>        self.template_page= self.template_pdf.pages[0]<br><br>        self.packet = io.BytesIO()<br>        self.c = Canvas(self.packet,pagesize=(self.template_page.mediabox.width,self.template_page.mediabox.height))</pre><ul><li>Inside the class, the “init” method is defined, which initializes the class attributes when an object is created.</li><li>The method takes the “<strong>template</strong>” parameter, which represents the path to the template PDF file.</li><li>The template PDF is <strong>opened</strong> using the PdfReader class and stored in the “template_pdf” attribute.</li><li>The first page of the template PDF is extracted and stored in the “template_page” attribute.</li><li>An<strong> in-memory packet</strong> is created using the io.BytesIO() function and stored in the “packet” attribute.</li><li>A Canvas object is created using the packet and the size of the template page, and stored in the “c” attribute.</li></ul><p>A canvas represents a drawing surface that allows you to add various graphical elements, such as text, images, shapes, and lines, to a PDF document. It provides a way to position and draw these elements on a specific page or area within the PDF.</p><p><strong>Part 2: Adding Text to the Template</strong></p><p>The second part of the code involves adding text to the template PDF.</p><pre>def addText(self,text,point):<br>        self.c.drawString(point[0],point[1],text)</pre><ul><li>The method takes two parameters: “text” (the content to be added) and “point” (the coordinates where the text should be placed).</li><li>Inside the method, the “drawString” function from the Canvas class is used to draw the text on the canvas.</li><li>The “drawString” function takes the x and y coordinates (point[0] and point[1]) and the text as arguments and <strong>writes the text at the specified position on the canvas instance created</strong>.</li></ul><p><strong>Part 3: Merging the Content</strong></p><p>The third part of the code involves merging the template PDF with the dynamically generated content.</p><pre>def merge(self):<br>        self.c.save()<br>        self.packet.seek(0)<br><br>        result_pdf = PdfReader(self.packet)<br>        result = result_pdf.pages[0]<br><br>        self.output = PdfWriter()<br><br>        op = Transformation().rotate(0).translate(tx=0, ty=0)<br>        result.add_transformation(op)<br><br>        self.template_page.merge_page(result)<br>        self.output.add_page(self.template_page)</pre><ul><li>Inside the method, the “save” function of the Canvas class is called to <strong>save the content drawn</strong> on the canvas.</li><li>The “seek” method of the packet object is used to<strong> reset the position of the in-memory packet</strong> to the beginning.</li><li>A PdfReader object is created using the packet, and the resulting PDF is stored in the “<strong>result_pdf</strong>” variable.</li><li>The first page of the result PDF is extracted and stored in the “result” variable.</li><li>A PdfWriter object is created and stored in the “output” attribute.</li><li>A Transformation object is created to define any transformations to be applied to the result page (in this case, <strong>no rotation or translation</strong>).</li><li>The result page is merged with the template page using the “merge_page” method of the template page object.</li><li>The merged page is added to the output using the “add_page” method.</li></ul><p><strong>Part 4: Generating the Final PDF</strong></p><p>The fourth part of the code involves generating the final PDF by writing the merged content to a destination file.</p><pre>def generate(self,dest):<br>        outputStream = open(dest,&quot;wb&quot;)<br>        self.output.write(outputStream)<br>        outputStream.close()</pre><ul><li>The method takes the “dest” parameter, which represents the path and filename of the output PDF file.</li><li>Inside the method, an output stream is opened in write binary mode using the “open” function.</li><li>The merged content stored in the “output” attribute is written to the output stream using the “write” method.</li><li>The output stream is closed using the “close” method.</li></ul><p>For <strong>example</strong>, I have a PDF file like this, and I am gonna add some text to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*PpMkeAUwOIJ2zT9U9Llxbw.png" /></figure><p>I created an Instance of the class GenerateFromTemplate and wrote some text to it. I found the position (x,y coordinates) by the Trial and Error method.</p><pre>gen = GenerateFromTemplate(&quot;template.pdf&quot;)<br><br>gen.addText(&quot;Hello!, I am Ensify&quot;,(270,900))<br><br>gen.merge()<br>gen.generate(&quot;Output.pdf&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMZxenLyqDVeLX488IERFA.png" /></figure><p><strong>Increasing Font Size:</strong></p><p>You can modify the addText method as per your requirements. For Example,</p><pre>    def addText(self,text,point, font_family= &quot;Helvetica-Bold&quot;,font_size=25):<br>        self.c.setFont(font_family, font_size)<br>        self.c.drawString(point[0],point[1],text)</pre><p>The addText method now accepts additional parameters font_size, font_familywhich determines the size of the font and the font family. By increasing the font_size, the text will appear thicker. You can adjust the font_size value as needed to achieve the desired thickness for the text.</p><p>These arguments are passed as keyword arguments, If not explicitly specified in the function call, they will take the value specified in the function definition, i.e., <strong>Helvetica</strong>-<strong>Bold</strong> — Font family and <strong>25</strong> — font size.</p><p>Now, calling the method</p><pre><br><br>gen = GenerateFromTemplate(&quot;dog.pdf&quot;)<br><br>gen.addText(text=&quot;Hello!! I am Buji&quot;,point=(270,900), font_family= &quot;Times-Roman&quot;,font_size=25)<br>gen.addText(text=&quot;A Happy Pet Dog&quot;,point=(270,850), font_size=22)<br><br>gen.merge()<br>gen.generate(&quot;Output.pdf&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*f_0_B19DC1UTvYGRd8tJSQ.png" /></figure><p><strong>Adding Graphics:</strong></p><p>Now, let us add some pictures to our pdf file. This can be done using drawImage method of Canvas class. Define a method addGraphics inside the class GenerateFromTemplate,</p><pre>    def addGraphics(self, point, img):<br>        self.c.drawImage(image=img, x=point[0],y=point[1])</pre><p>You can also decrease or increase the size of the image to be added,</p><pre>from reportlab.lib.utils import ImageReader #add this import statement together with other imports<br><br>    def addGraphics(self, point, img, scale =1):<br><br>        img = ImageReader(img)<br>        img_width, img_height = img.getSize()<br>    <br>        self.c.drawImage(image=img, x=point[0],y=point[1], width= img_width*scale, height=img_height*scale)</pre><ul><li>The addGraphics method now takes an additional optional parameter called scale, which represents the scaling factor for the image.</li><li>Within the drawImage function, we multiply the original width and height of the image by the scale factor to determine the new width and height of the image in the PDF.</li><li>By adjusting the scale value, you can decrease or increase the size of the image proportionally. A scale value less than 1 will decrease the size, while a scale value greater than 1 will increase it.</li></ul><p>Calling the method,</p><pre>gen = GenerateFromTemplate(&quot;dog.pdf&quot;)<br><br>gen.addText(text=&quot;Hello!! I am Buji&quot;,point=(270,900), font_family= &quot;Times-Roman&quot;,font_size=25)<br>gen.addText(text=&quot;A Happy Pet Dog&quot;,point=(270,850), font_size=22)<br><br>gen.addGraphics(point= (120,780),img=&quot;doglogo.jpeg&quot;, scale=0.5)<br>gen.merge()<br><br>gen.generate(&quot;Output.pdf&quot;)</pre><p>In this example, the doglogo.jpegwill be added to the PDF at the coordinates (120, 780) with its size reduced to <strong>half</strong> of its original dimensions(scale = 0.5).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*0DtyuF8wkbPGyEfYlV-GUw.png" /></figure><p>Thus, With the Python libraries PyPDF2 and reportlab, automating PDF generation becomes a straightforward process. By leveraging the provided GenerateFromTemplate class, developers can easily create dynamic and customized PDFs from templates. The flexibility and functionality offered by these libraries empower users to generate professional-looking documents programmatically, saving time and effort.</p><p><strong>References</strong>: <a href="https://stackoverflow.com/a/75675378/21978566">https://stackoverflow.com/a/75675378/21978566</a></p><p>Hope this helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fa6bc6b856e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/enhancing-pdf-generation-integrating-text-and-graphics-using-pypdf2-and-reportlab-9fa6bc6b856e">Enhancing PDF Generation: Integrating Text and Graphics using PyPDF2 and reportlab.</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From JSON to CSV to Parquet: The Rise of Apache Parquet as the Ultimate Data Storage Solution.]]></title>
            <link>https://medium.com/featurepreneur/from-json-to-csv-to-parquet-the-rise-of-apache-parquet-as-the-ultimate-data-storage-solution-196c28375847?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/196c28375847</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[parquet]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Wed, 31 May 2023 13:12:01 GMT</pubDate>
            <atom:updated>2023-05-31T13:12:01.434Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="parquet vs json vs csv" src="https://cdn-images-1.medium.com/max/763/1*PFeIrtiJUYoVtmRxOUd9bw.png" /></figure><p>The ability to store and analyze enormous amounts of data effectively is crucial in the world of <strong>big data processing</strong> and analytics. A potent remedy for overcoming these difficulties has emerged in the form of Apache <strong>Parquet</strong>, a columnar storage file format. In this article, we’ll examine Parquet, its role in the big data universe, and the noteworthy advantages and benefits it provides for data storage and the analysis of various file formats (CSV, JSON, Parquet).</p><p>What is <strong>Columnar data storage</strong>?</p><p><strong>Columnar data storage</strong> is a method of organizing and storing data in a database or file format where data is stored and accessed by columns rather than rows. In traditional row-based storage, data is stored and retrieved in a row-wise manner, where each record or row contains values for all columns. In contrast, columnar storage stores the values of each column together, creating separate storage areas for each column.</p><p>In a columnar storage format, all values of a particular column are stored contiguously, allowing for efficient compression and encoding techniques specific to that column’s data type.</p><p><strong>What is Parquet?</strong></p><p>Apache Parquet is an open-source columnar storage file format designed to store and process large-scale datasets efficiently. It was developed as a collaborative effort by the Apache Software Foundation, with a focus on optimizing performance and enabling high-speed data analysis on big data platforms.</p><p>Here’s an example of a student dataset using the columns Roll No, Registration No, Name, Department, and Section:</p><p>In Parquet, the data would be stored column-wise, like this:</p><pre>Column: Roll No<br>[149, 150, 151, ...]<br><br>Column: Registration No<br>[3123187, 3123188, 3123189, ...]<br><br>Column: Name<br>[Dora, Buji, Lisa, ...]<br><br>Column: Department<br>[Computer Science, Electrical Engineering, Mechanical Engineering, ...]<br><br>Column: Section<br>[A, B, C, ...]</pre><p>In this example, each <strong>column</strong> represents a <strong>specific attribute</strong> of the student data. The values for each attribute are stored <strong>separately</strong> and <strong>consecutively</strong> within their respective columns.</p><p>With this columnar storage format, the dataset benefits from the <strong>advantages</strong> of Parquet:</p><ol><li><strong>Efficient Compression</strong>: Parquet’s compression techniques can exploit patterns and similarities within each column. For instance, Roll No and Registration No might have certain patterns or ranges that can be compressed effectively. This helps reduce the overall storage requirements of the dataset.</li><li><strong>Selective Column Reading</strong>: With Parquet, selective column reading is possible. If you only need to access specific columns, such as Roll No and Name, only those columns would be read from the disk. This reduces I/O operations and improves query performance, especially when dealing with large datasets.</li><li><strong>Column-Level Operations</strong>: Parquet’s columnar storage allows for efficient column-level operations. You can perform computations, aggregations, or filtering operations on individual columns, leveraging vectorized operations and parallel processing. This enables faster and more efficient data analysis.</li></ol><p><strong>Purpose in Big Data Processing and Analytics: </strong>Parquet plays a crucial role in big data processing and analytics by providing a highly optimized storage format. It addresses the limitations of traditional row-oriented storage formats by organizing and compressing data column by column instead of row by row.</p><p><strong>Analysis of various file formats (csv, json, parquet):</strong></p><p>Now, I have a dataset in JSON format.</p><pre>os.path.getsize(&quot;path-to-the-file&quot;)/1000000</pre><p>This function from the os module gives the size of the file passed as an argument. It gives the size of the file in bytes, which can be converted to MB by dividing it by 10⁶.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*RD1VM_kuQrss_EnpaRBMqg.png" /></figure><p>The JSON is converted to CSV using the code,</p><pre>def json_to_csv(file):<br>    df = pd.read_json(file)<br>    df.to_csv(&#39;data.csv&#39;)<br><br><br>json_to_csv(&#39;data.json&#39;)</pre><p>Now, the size of the files ,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*EZM7S_33av_qQy7Hj9f7BQ.png" /></figure><p>So, there is a noticeable decrease in the file size for storing the same set of data in CSV as in JSON.</p><p>Next, we shall move on to parquet.</p><pre><br>def json_to_parquet():<br>    data = pd.read_json(&#39;data.json&#39;) <br>    data.to_parquet(&#39;data.parquet&#39;)</pre><p>This function converts the JSON file to parquet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*MqLif3fo-Zyk8NHLAQxwGg.png" /></figure><pre>data.json File Size: 325.487323 MB<br><br>data.csv File Size: 191.802363 MB<br><br>data.parquet File Size: 61.8331 MB</pre><p>When comparing the file sizes of the <strong>data.json, data.csv, and data.parquet</strong> files, it is evident that there are significant differences in their storage requirements.</p><p>The <strong>data.json</strong> file, with a size of 325 MB, stands out as the <strong>largest</strong> among the three formats. This can be attributed to the nature of JSON, which utilizes a plain text representation with <strong>explicit field names</strong> and values stored in a hierarchical structure. Although JSON is a widely used and human-readable format, its larger file size indicates that it may consume <strong>more disk space</strong> compared to other formats.</p><p>On the other hand, the <strong>data.csv</strong> file has a size of 191 MB. While CSV files are known for their simplicity and widespread usage for tabular data, their file sizes tend to be <strong>larger</strong> due to the <strong>plain text</strong> representation. Each record is stored as a row, with values separated by commas. Although CSV is straightforward to work with, the larger file size suggests that it may occupy more storage space.</p><p>In contrast, the <strong>data.parquet</strong> file demonstrates the advantages of the Parquet format. With a <strong>considerably smaller size</strong> of 61 MB, Parquet stands out as an efficient <strong>columnar</strong> storage file format. By storing data column by column rather than by row, Parquet achieves better compression ratios and reduces storage requirements. Additionally, Parquet incorporates advanced compression techniques, which contribute to its <strong>smaller file size</strong>. The selective column reading capability of Parquet further enhances its efficiency, as only the necessary columns are accessed, resulting in <strong>faster query performance </strong>and minimized disk I/O operations.</p><p>In conclusion, the analysis shows that <strong>Parquet</strong> outperforms both CSV and JSON in terms of file size and storage efficiency. Parquet’s columnar storage and advanced compression enable a significantly smaller file size compared to CSV, making it an <strong>ideal choice</strong> for big data environments. JSON, on the other hand, tends to have larger file sizes due to its plain text representation and lack of compression.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=196c28375847" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/from-json-to-csv-to-parquet-the-rise-of-apache-parquet-as-the-ultimate-data-storage-solution-196c28375847">From JSON to CSV to Parquet: The Rise of Apache Parquet as the Ultimate Data Storage Solution.</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Personalize Your Ubuntu Login Page: A Guide to Changing the Login Screen Name.]]></title>
            <link>https://medium.com/featurepreneur/personalize-your-ubuntu-login-page-a-guide-to-changing-the-login-screen-name-e8a579cae77?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8a579cae77</guid>
            <category><![CDATA[login-screen]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[names]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Wed, 31 May 2023 13:08:45 GMT</pubDate>
            <atom:updated>2023-05-31T13:08:45.419Z</atom:updated>
            <content:encoded><![CDATA[<p>The login page is the gateway to your Ubuntu system, providing a secure access point for users. In this guide, we will walk you through the process of changing the login screen name on your Ubuntu system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*KV0QPqaAUslD7eOgRi9FOQ.png" /></figure><p>My login name is <strong>Saru</strong> and I want to change it to <strong>SaruMathy.</strong></p><p><strong>Step 1</strong>: Open your terminal (use Ctrl + Alt + T)</p><p><strong>Step 2</strong>: Run the following command.</p><pre>$ sudo gedit /etc/passwd</pre><p>Here gedit is the text editor. You can use any text editor in place of gedit. After executing this command, it asks for the password. When the password request comes up, <strong>type the password anyway, even though nothing is showing up</strong> then hit Enter when finished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*SkNEljNSdoCpePtAUBn5bQ.png" /></figure><p>This opens a file named “passwd” in the text editor you entered.</p><p>Press<strong> Ctrl+F </strong>and start <strong>searching</strong> for your login name. You will find a line like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*5QI_rU_PyD3C1LSBMLJ88A.png" /></figure><p>The name which appears before 3 commas i.e., Saru is my Login page name.</p><p><strong>Step 3</strong>: Edit the existing name.</p><p><strong>Step 4</strong>: Save the file and Exit.</p><p>Now Press WindowsLogo + L or Logout to Verify.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*kcFolS-YbZsGWNc42qzD6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*timBjUUTYFUCPMPRvQEO5Q.png" /></figure><p>Yeah…Now we have changed our login page name Successfully.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8a579cae77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/personalize-your-ubuntu-login-page-a-guide-to-changing-the-login-screen-name-e8a579cae77">Personalize Your Ubuntu Login Page: A Guide to Changing the Login Screen Name.</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Local File Operations Made Easy: Convert Images to PDFs and Merge PDFs Securely with Python.]]></title>
            <link>https://medium.com/featurepreneur/local-file-operations-made-easy-convert-images-to-pdfs-and-merge-pdfs-securely-with-python-d70bca518ff3?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/d70bca518ff3</guid>
            <category><![CDATA[easy]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[merge-pdf]]></category>
            <category><![CDATA[pdf-converter]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Mon, 29 May 2023 13:44:30 GMT</pubDate>
            <atom:updated>2023-05-29T13:44:30.188Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are concerned about<strong> uploading files online</strong> to convert images to PDFs or merge PDFs, this article is specifically written to address your concerns. In it, I will provide you with code that allows you to perform these tasks on your <strong>local computer</strong>. This way, you can ensure the <strong>security</strong> of your files and documents without having to rely on online platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*_7ZXpUQLIT-TiT5ywpnJdA.png" /></figure><p><strong>AGENDA</strong>:</p><ul><li>Image to PDF</li><li>PDF to Image</li><li>Merge PDFs</li><li>Split PDFs</li></ul><ol><li><strong>Image(s) to PDF:</strong></li></ol><pre>#images are converted to a single pdf.<br><br>import os<br>import img2pdf<br><br>name = &quot;your_pdf_name.pdf&quot;<br>images = [&quot;image1.png&quot;,&quot;image2.png&quot;, &quot;image3.jpg&quot;]<br><br>with open(name,&quot;wb&quot;) as f:<br>    f.write(img2pdf.convert(images))<br><br><br>file_size = os.path.getsize(name)<br>file_size_kb = file_size / 1024<br>print(f&quot;Size of {name}: {file_size_kb:.2f} KB&quot;)</pre><p>Make sure you edit the variable name and the list images as per your need. This code makes use of img2pdf Python library which you have to install.</p><p>Installation:</p><pre>pip install img2pdf</pre><p>Code Explanation:</p><ul><li>Using a with statement and the open() function, a new PDF file is created with the specified name (&quot;your_pdf_name.pdf&quot;). Note that the file should be opened in “Binary format” which is specified as wb</li><li>The img2pdf.convert() the function is used to convert the images listed in the images variable into PDF format.</li><li>The converted PDF data is then written to the newly created PDF file using the write() method of the opened file object (f).</li><li>The code uses the os.path.getsize() function to retrieve the size of the generated PDF file.</li><li>The file size is then divided by 1024 to convert it from bytes to kilobytes and stored in the variable file_size_kb.</li><li>Finally, the code prints the size of the PDF file by formatting the file_size_kb variable and displaying it with two decimal places, along with a message.</li></ul><p>Changes you have to make:</p><ul><li>Change the name of the pdf. — The name variable</li><li>Change the content of images (Relative path or absolute path of the image) — the images variable.</li></ul><p>Note:</p><ul><li>Execute the program using</li></ul><pre>python &lt;python_file_name&gt;.py</pre><ul><li>You can convert a single image to PDF or multiple images to PDF.</li><li>For the command pip install to work, you need to have pip installed in your system. If an error occurs even if u have Python, then you can uninstall Python and install Python from <a href="http://www.python.org/">www.python.org</a> or you can install pip separately.</li><li>If you get this kind of message when executing the program,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*DW5tjIIGNmwHElDVWj0cuw.png" /></figure><p>Converting an image with an alpha channel and computing a separate soft mask (/SMask) image to store transparency in a PDF does not automatically compromise its validity or make it fraudulent. The use of transparency and soft masks is a common practice in PDF documents and image manipulation.</p><p><strong>2. PDF to Images:</strong></p><pre>#pdf to images<br><br># POPPLER_PATH = os.path.join(os.getcwd(),r&quot;dependencies\poppler\Library\bin&quot;)<br># The above line is only for WIndows users <br><br><br>from pdf2image import convert_from_path<br>import os<br><br>name = &#39;your_file_name.pdf&#39;<br>pages = convert_from_path(name, 200)<br><br>i=1<br>for page in pages:<br>    page.save(f&#39;output_image{i}.jpg&#39;, &#39;JPEG&#39;)<br>    <br>    file_size = os.path.getsize(f&#39;out{i}.jpg&#39;)<br>    file_size_kb = file_size / 1024<br>    print(f&quot;Size of {f&#39;output_image{i}.jpg&#39;}: {file_size_kb:.2f} KB&quot;)<br>    i+=1</pre><p>Installation:</p><pre>pip install pdf2image</pre><p>Windows and Mac Users will have to install Poppler additionally. Refer to the link below and install dependencies according to your OS.</p><p><a href="https://pypi.org/project/pdf2image/">pdf2image</a></p><p><strong>For Windows users</strong>,</p><p>After downloading Poppler navigate to the bin folder (inside the Library folder) and copy the path. Store this path as POPPLER_PATH and pass it as the argument for the convert function. For Example,</p><pre><br>POPPLER_PATH = r&quot;C:\path\to\poppler-xx\library\bin&quot;<br>pages = convert_from_path(name ,poppler_path = POPPLER_PATH)</pre><p>Code Explanation:</p><ul><li>The code uses the convert_from_path() function from the pdf2image module to convert the pages of the PDF file named &quot;certs.pdf&quot; into images.</li><li>Each page is converted with a resolution of 200 pixels.</li><li>A loop is used to iterate through each converted image.</li><li>Inside the loop, the save() method is used to save each image with a unique file name, such as &quot;output_image1.jpg&quot;, &quot;output_image2.jpg&quot;, etc.</li><li>The code then retrieves the size of each saved image using the os.path.getsize() function.</li><li>The file size is divided by 1024 to convert it from bytes to kilobytes and stored in the variable file_size_kb.</li><li>Within the loop, the code prints the size of each saved image by formatting the file_size_kb variable and displaying it with two decimal places, along with a message.</li><li>The loop continues for each image, incrementing the counter i each time to provide a unique name for the images.</li></ul><p><strong>Changes you have to make</strong>:</p><ol><li>Change name variable. — The path of the PDF file you want to convert into images. (Relative path enough).</li></ol><p><strong>3. Merge PDFs:</strong></p><pre><br>#MERGE ALL PDFS INTO SINGLE PDF<br><br><br><br>from PyPDF2 import PdfMerger<br>import os<br><br>merger  = PdfMerger()<br><br>name = &quot;merged_pdf_file_name.pdf&quot;<br><br>pdfs = [&#39;my_file1.pdf&#39;,&#39;my_file2.pdf&#39;,&#39;my_file3.pdf&#39;]<br><br>for pdf in pdfs:<br>    merger.append(pdf)<br><br>merger.write(name)<br><br><br>file_size = os.path.getsize(name)<br>file_size_kb = file_size / 1024<br>print(f&quot;Size of {name}: {file_size_kb:.2f} KB&quot;)<br><br><br>merger.close()<br><br>                                           </pre><p>Installation:</p><pre>pip install PyPDF2</pre><p>Code Explanation:</p><ul><li>The code creates a PdfMerger object named merger from the PyPDF2 module. This object will be used to merge multiple PDF files.</li><li>The variable name is set to &quot;merged_pdf_file_name.pdf&quot;. You can change it to the desired name for your merged PDF file.</li><li>The variable pdfs is a list that contains the names of the input PDF files that you want to merge.</li><li>Using a loop, each PDF file listed in the pdfs variable is appended to the merger object using the append() method. This adds the content of each PDF to the merger, combining them into a single PDF.</li></ul><p>Other useful methods of Merger Class:</p><pre>merger.merge(&lt;position&gt;, &quot;pdf_file.pdf&quot;)</pre><p>This method is used to merge the specified PDF document (pdf_file.pdf) into the existing merged document at a <strong>specific position</strong>. The first argument represents the index position at which the PDF will be merged. It means that the pages of the pdf document will be inserted after the page at the indexpositionin the merged document. All the existing pages after the specified index will be <strong>shifted to accommodate</strong> the new pages.</p><pre>merger.append(&quot;pdf_file_name.pdf&quot;, pages=(0, 3))  # pages with pg.nos 1,2,3 will be added the end.</pre><p>The append() method is used to add specific pages from a PDF document (pdf_file_name.pdf) to the end of the merged document. This example pages=(0, 3) specifies that pages with indices 0 to 3 (exclusive) from the “pdf_file_name.pdf” document will be appended to the merged document. It means that only the <strong>selected pages</strong> will be added to the end of the existing merged document without affecting the order of existing pages.</p><pre>merger.append(pdf, pages=(0, 6, 2)) # pages with pgno. 1,3, 5 will be added at the end</pre><p>This variant of the append() method allows you to specify a <strong>non-contiguous range of pages</strong> to be appended. In this example, pages=(0, 6, 2) this means that pages with indices (not page numbers) 0, 2, and 4 will be appended to the merged document. It follows a similar syntax to the range() function in Python, where the third argument specifies the step size or interval between pages.</p><ul><li>The write() method is called on the merger object, with the name variable specifying the file name for the merged PDF. This writes the merged PDF content to the specified file.</li><li>The code uses the os.path.getsize() function to retrieve the size of the generated merged PDF file.</li><li>The file size is then divided by 1024 to convert it from bytes to kilobytes and stored in the variable file_size_kb.</li><li>Finally, the code prints the size of the merged PDF file by formatting the file_size_kb variable and displaying it with two decimal places, along with a message.</li><li>The merger an object is closed using the close() method, ensuring that any resources associated with it are released.</li></ul><p><strong>Changes you have to make</strong>:</p><ol><li>The variable name — Change it to the desired name for your merged PDF file.</li><li>The list variable pdfs — The names( If they are present in the same directory) or the paths (Relative/Absolute path) of the pdf files you want to merge.</li></ol><p><strong>4. Split PDFs:</strong></p><pre># split pdfs<br><br>from PyPDF2 import PdfReader, PdfWriter<br>import os<br><br>def split(path, name_of_split):<br>    pdf = PdfReader(path)<br>    for page in range(len(pdf.pages)):<br><br>        pdf_writer = PdfWriter()<br>        pdf_writer.add_page(pdf.pages[page])<br><br>        output = f&#39;{name_of_split}{page}.pdf&#39;<br>        with open(output, &#39;wb&#39;) as output_pdf:<br>            pdf_writer.write(output_pdf)<br>            <br>        file_size = os.path.getsize(output)<br>        file_size_kb = file_size / 1024<br>        print(f&quot;Size of {output}: {file_size_kb:.2f} KB&quot;)<br><br><br><br>if __name__ == &#39;__main__&#39;:<br>    path = &#39;path_file_to_be_splited.pdf&#39;<br>    name_of_the_split = &quot;any_name&quot;<br>    split(path, name_of_the_split)</pre><p>This code converts each individual page of the specified PDF into separate PDFs.</p><p>Installation:</p><pre>pip install PyPDF2</pre><p>Code Explanation:</p><ul><li>The code defines a function called split that takes two parameters: path (the path of the PDF file to be split) and name_of_split (a string representing the base name for the split files).</li><li>The code uses the PdfReader class from PyPDF2 to read the PDF file specified by the path parameter.</li><li>Using a loop, the code iterates over each page of the input PDF using the range() function and the length of pdf.pages (The number of pages in the PDF).</li><li>Inside the loop, a new PdfWriter object is created using PdfWriter(). This object will be used to write each individual page of the split PDF files.</li><li>The current page is added to the pdf_writer using the add_page() method, obtained from the pdf.pages[page] reference.</li><li>An output file name is created by appending the current page number to the name_of_split parameter.</li><li>The pdf_writer content is written to the output PDF file using a with statement and the write() method of the opened file object.</li><li>Then the size of the file is calculated and printed.</li></ul><p>Suppose you want to split a PDF of 6 pages into 2, one having 5 pages and the other having the last page only,</p><pre>from PyPDF2 import PdfReader, PdfWriter<br>import os<br><br>def split(path, name_of_split):<br>    pdf = PdfReader(path)<br><br>    # Split PDF into two parts: 5 pages and 1 page<br>    pdf_part1 = PdfWriter()<br>    for page in range(5):<br>        pdf_part1.add_page(pdf.pages[page])<br><br>    pdf_part2 = PdfWriter()<br>    pdf_part2.add_page(pdf.pages[5])<br><br>    # Write the split PDFs to separate files<br>    output1 = f&#39;{name_of_split}_part1.pdf&#39;<br>    with open(output1, &#39;wb&#39;) as output_pdf1:<br>        pdf_part1.write(output_pdf1)<br><br>    output2 = f&#39;{name_of_split}_part2.pdf&#39;<br>    with open(output2, &#39;wb&#39;) as output_pdf2:<br>        pdf_part2.write(output_pdf2)<br>    <br>    # Determine the sizes of the split PDF files<br>    file_size1 = os.path.getsize(output1)<br>    file_size_kb1 = file_size1 / 1024<br>    print(f&quot;Size of {output1}: {file_size_kb1:.2f} KB&quot;)<br><br>    file_size2 = os.path.getsize(output2)<br>    file_size_kb2 = file_size2 / 1024<br>    print(f&quot;Size of {output2}: {file_size_kb2:.2f} KB&quot;)<br><br>if __name__ == &#39;__main__&#39;:<br>    path = &#39;path_file_to_be_splited.pdf&#39;<br>    name_of_split = &quot;any_name&quot;<br>    split(path, name_of_split)</pre><p><strong>Changes you have to make:</strong></p><ol><li>The path variable — The name or the path of the PDF to be split.</li><li>name_of_split — To identify the split pages.</li></ol><p>GitHub Repository for this:</p><p><a href="https://github.com/SarumathyPrabakaran/pdf-file-manipulation-scripts">https://github.com/SarumathyPrabakaran/pdf-file-manipulation-scripts</a></p><p>Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d70bca518ff3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/local-file-operations-made-easy-convert-images-to-pdfs-and-merge-pdfs-securely-with-python-d70bca518ff3">Local File Operations Made Easy: Convert Images to PDFs and Merge PDFs Securely with Python.</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dive into the World of PostgreSQL: Beginners Guide with Docker]]></title>
            <link>https://medium.com/featurepreneur/dive-into-the-world-of-postgresql-beginners-guide-with-docker-74ac09ae9ea8?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ac09ae9ea8</guid>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Sun, 28 May 2023 06:20:43 GMT</pubDate>
            <atom:updated>2023-05-28T06:20:43.116Z</atom:updated>
            <content:encoded><![CDATA[<p>PostgreSQL is an open-source relational database management system (RDBMS) known for its robustness, scalability, and extensibility. It is favored by developers and enterprises for building scalable and high-performance applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*s19AjD6IFfcGCFgphiooAQ.png" /></figure><p>There are many ways to create and manage a PostgreSQL database such as</p><ul><li>Installing PostgreSQL directly on your operating system and using tools like psql (the PostgreSQL command-line interface) or graphical user interfaces (GUIs) like pgAdmin to interact with and manage your PostgreSQL database.</li><li>Using Package Managers like <strong>apt</strong> (Ubuntu or Debian - based systems), Homebrew (Mac), etc.</li><li>Using Cloud-based Services like <strong>Amazon RDS</strong> for PostgreSQL, Google Cloud SQL for PostgreSQL, and Azure Database for PostgreSQL.</li><li>Using Docker.</li></ul><p>This article focuses on creating and managing PostgreSQL databases using <strong>Docker</strong>.</p><p>Docker is a containerization platform that allows you to package apps along with their dependencies in lightweight containers. Using PostgreSQL with Docker provides several benefits, such as easy setup, portability, and isolation.</p><p><strong>AGENDA</strong>:</p><ol><li>Create a Docker Container with a PostgreSQL image.</li><li>Connect to the PostgreSQL server and create a DB.</li><li>A simple TODO app with Flask to demonstrate the working.</li></ol><p><strong>Create a Docker Container with PostgreSQL image</strong>:</p><p>Step 1: Install Docker.</p><p>For <strong>Ubuntu</strong> users, use the following commands to install docker.</p><pre>sudo apt install docker.io</pre><p>Type the following to verify the installation</p><pre>sudo docker</pre><p>For Windows Users, visit the docker’s official documentation and follow the steps to install docker in your system.</p><p><a href="https://docs.docker.com/desktop/install/windows-install/"></a></p><p>Step 2: Pull the PostgreSQL image</p><p>Once Docker is installed, the next step is to pull the PostgreSQL image from Docker Hub. You can do this by running the following command in the terminal:</p><pre>sudo docker pull postgres</pre><pre>sudo docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*0hbWvqf0NeaMK73REnkejg.png" /></figure><p>Step 3: Create a docker container.</p><pre>sudo docker run --name &lt;container-name&gt; -e POSTGRES_PASSWORD=&lt;password&gt; -d -p &lt;port&gt;:&lt;port&gt; postgres</pre><p><strong>container-name</strong>: any name for your Postgres container.</p><p><strong>password</strong>: strong password for the PostgreSQL superuser.</p><p>For example,</p><pre>sudo docker run --name pg11 -e POSTGRES_PASSWORD=test123 -d -p 5432:5432 postgres</pre><ul><li>sudo: This command is used to run the subsequent command with administrative privileges.</li><li>docker run: This command starts a new Docker container.</li><li>--name pg11: It assigns the name &quot;pg11&quot; to the container.</li><li>-e POSTGRES_PASSWORD=test123: This sets the environment variable POSTGRES_PASSWORD to &quot;test&quot;, specifying the password for the PostgreSQL superuser.</li><li>-d: It runs the container in detached mode, which means it runs in the background.</li><li>-p 5432:5432: This maps the container&#39;s port 5432 (default PostgreSQL port) to the host&#39;s port 5432, allowing connections from the host machine to the PostgreSQL server running inside the container.</li><li>postgres: This specifies the Docker image that we have pulled.</li></ul><p>This command will create a new Docker container with the PostgreSQL image and start the PostgreSQL server inside it.</p><p>Verify if the container is created using the command,</p><pre>docker ps</pre><p><strong>Connect to the PostgreSQL Server:</strong></p><p>Start the docker container.</p><pre>sudo docker start &lt;container-name&gt;<br>sudo docker exec -it &lt;container-name&gt; bash<br>psql -h &lt;host-ip&gt; -p &lt;port-no&gt; -U &lt;user-name&gt;</pre><p>Replace &lt;container-name&gt; with the name you specified in the above step.</p><p>Example:</p><pre>sudo docker start pg11<br>sudo docker exec -it pg11 bash<br>psql -h 0.0.0.0 -p 5432 -U postgres</pre><ul><li>docker start: This command starts a stopped container or a newly created one.</li><li>docker exec: This command runs a command within a running container.</li><li>-it: It attaches an interactive terminal to the container.</li><li>pg11: It specifies the container to execute the command in.</li><li>bash: This is the command to be executed inside the container, which opens a Bash shell.</li><li>psql: This command starts the PostgreSQL command-line interface.</li><li>-h 0.0.0.0: It specifies the host IP address to connect to. Here, it is set to 0.0.0.0, which means all available network interfaces.</li><li>-p 5432: This specifies the port number (5432) to connect to.</li><li>-U postgres: It specifies the username (postgres) to connect with.</li></ul><p>You should now be connected to the PostgreSQL server through the PostgreSQL command-line interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*m1axbg59A3Efd8IDOnbwRQ.png" /></figure><p>Once connected to the PostgreSQL server, you can execute SQL commands to create databases, and tables, and perform other operations as needed.<br>For example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*uMp2lX1Lssw1BLqmxWYqkA.png" /></figure><pre>create database saru;</pre><p>This command creates a database with the name “saru”</p><pre>\c saru;</pre><p>This connects to the database “Saru”</p><pre>create table Todos(id int primary key , title varchar(234));</pre><p>The above SQL command creates a table Todo with fields id and title.</p><p>Use \d to list all the tables in the database “saru”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*rH7bW07p4oKm1YMcCHDswA.png" /></figure><p>Use a select statement to query all the rows in the table</p><pre>select * from &lt;table-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*4b9oSa573f9p2yoGcYz3EQ.png" /></figure><p><strong>A simple TODO app with Flask:</strong></p><p>We are now going to make a to-do app that makes use of the Postgres DB that we have created.</p><p>Make sure you <strong>run your Postgres container</strong> in a separate terminal.</p><p>Let&#39;s create a simple Flask web interface where users can submit a to-do item through a form. The submitted items are stored in a <strong>PostgreSQL</strong> database using SQLAlchemy. <strong>Flask-SQLAlchemy</strong> is a Flask extension that provides integration between Flask and SQLAlchemy, a powerful and popular Object-Relational Mapping (ORM) library for Python.</p><p>To connect a Flask app with DB,</p><p>the SQLALCHEMY_DATABASE_URI configuration variable is set to specify the connection details for a PostgreSQL database or any other.</p><pre>app.config [&#39;SQLALCHEMY_DATABASE_URI&#39;] = &#39;postgresql://&lt;username&gt;:&lt;password&gt;@&lt;host&gt;:5432/&lt;db-name&gt;&#39;</pre><ul><li>&lt;username&gt;: Replace this with the username for your PostgreSQL database.</li><li>&lt;password&gt;: Replace this with the password for the specified username.</li><li>&lt;host&gt;: Replace this with the hostname or IP address where your PostgreSQL server is running.</li><li>&lt;db-name&gt;: Replace this with the name of the PostgreSQL database you want to connect to.</li></ul><p>Steps:</p><ol><li>Import necessary modules.</li><li>Instantiate Flask class and set SQLALCHEMY_DATABASE_URI to configure the PostgreSQL database connection.</li><li>Create a class representing the database schema for the todo table.</li><li>Set up a route for rendering the HTML template and processing POST requests</li><li>Define a route to display and process the post request.</li><li>Don&#39;t forget to create a html file to display and submit the form.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/176/1*Ov9rnGlf9lG3V0G7Fm8Jkw.png" /></figure><pre>from flask import Flask, render_template,  request<br>from flask_sqlalchemy import SQLAlchemy<br><br><br>app = Flask(__name__)<br>app.config[&#39;SQLALCHEMY_DATABASE_URI&#39;] = &#39;postgresql://postgres:test123@0.0.0.0:5432/saru&#39;<br>app.config[&#39;SQLALCHEMY_TRACK_MODIFICATIONS&#39;] = False<br>db = SQLAlchemy(app)<br><br><br>class Todo(db.Model):<br>    __tablename__ = &#39;todos&#39;<br>    id = db.Column(db.Integer, primary_key=True)<br>    title = db.Column(db.String(80), nullable=False)<br><br>    def __repr__(self):<br>        return f&#39;&lt;Todo {self.id}&gt;&#39;<br>    def __init__(self, id, title):<br>        self.id = id<br>        self.title = title<br>    <br><br>@app.route(&#39;/&#39;,methods = [&#39;GET&#39;,&#39;POST&#39;])<br>def index():<br>   <br>    objs = db.session.query(Todo).all() <br><br>    if request.method == &quot;POST&quot;:<br>        now = request.form.get(&quot;todo&quot;)<br><br>        now_id = db.session.query(Todo.id).all()<br>        todo_obj =  Todo(len(now_id)+1,now)<br>        <br>        db.session.add(todo_obj)<br>        db.session.commit()<br>        <br>        objs = db.session.query(Todo).all() <br>        <br> <br>    return render_template(&#39;index.html&#39;, l = objs)<br><br>if __name__ == &quot;__main__&quot;:<br>    <br>    app.run(debug = True, port = 5003)</pre><p>Methods and concepts related to the SQLAlchemy db.session object:</p><ol><li>db.session.add(&lt;obj&gt;): This method is used to add an object to the session. It stages the object to be inserted into the database during the next commit operation.</li><li>db.session.commit(): This method commits all pending changes in the session to the database. It performs inserts, updates, and deletes based on the staged objects in the session.</li><li>db.session.delete(&lt;obj&gt;): This method marks an object for deletion in the session. The object will be deleted from the database during the next commit operation.</li><li>db.session.query(&lt;Class&gt;): This method is used to construct a new query object for a given class. It allows you to perform database queries and retrieve objects of that class.</li><li>db.session.query(&lt;Class&gt;).filter(condition): This method is used to apply a filter condition to a query. It narrows down the result set by specifying criteria that the objects must meet. The condition parameter is an expression that defines the filter condition.</li><li>db.session.query(&lt;Class&gt;).all(): This method executes the query and retrieves all objects of the specified class from the database as a list. It returns all rows from the table associated with the class.</li></ol><p>db.session the object provides a way to interact with the database within an SQLAlchemy session. You can add objects to the session using add(), commit changes with commit(), delete objects withdelete(), construct queries using query(), apply filters with filter(), and retrieve query results using methods like all(). These methods form the core functionality for interacting with the database using SQLAlchemy in a Flask application.</p><p><strong>index.html file:</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;MY TODOS&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;form action = &quot;/&quot;, method = &quot;post&quot;&gt;<br>        Your todo:<br>        &lt;input type=&quot;text&quot; name=&quot;todo&quot; id = &quot;todo&quot;&gt;<br>        &lt;button type = &quot;submit&quot;&gt;SUBMIT&lt;/button&gt;<br>    &lt;/form&gt;<br>    <br>    &lt;ul&gt;<br>        {% for i in l %}<br>        &lt;li&gt; {{i.title}}&lt;/li&gt;<br>        {% endfor %}<br>    &lt;/ul&gt;<br>    <br>&lt;/body&gt;<br>&lt;/html&gt;</pre><ol><li>Inside the &lt;body&gt; section, there is an &lt;form&gt; element that allows users to submit a to-do. It has an action attribute set to /, which indicates that the form will be submitted to the root URL of the application. The method attribute is set to postindicate that the form will use the POST HTTP method to send data.</li><li>Inside the form, there is a text input field named “todo” with an associated label “Your todo:”. Users can enter the to-do text in this field.</li><li>There is a submit button labeled “SUBMIT” that users can click to submit the form</li><li>{% for i in l %} : This is a template expression in Jinja2 (a template engine used by Flask) that iterates over a list of todos (l in the Flask view function) and assigns each todo object to the variable i.</li><li>Within the loop, each todo’s title is displayed as a list item using {{ i.title }}, where i represents the current to-do object.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*1lC-j2E2P9VCVySUtp0aaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*fMY5g8ya5e7Jixy8Rbioeg.png" /></figure><p>Note:</p><ol><li>To exit from psql , Type \q or exit . You need to type exit two times to exit from psql and Bash.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*84yKQAjZ3d_coUvq_hnOFA.png" /></figure><p>2. One can also use psycopg2 and sqlalchemy to connect with Postgres db using Python.</p><p>3. Make sure you commit everything after making changes for them to reflect in your database db.session.commit().</p><p><strong>GitHub repository</strong> for this:</p><p><a href="https://github.com/SarumathyPrabakaran/todo-app">https://github.com/SarumathyPrabakaran/todo-app</a></p><p>Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ac09ae9ea8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/dive-into-the-world-of-postgresql-beginners-guide-with-docker-74ac09ae9ea8">Dive into the World of PostgreSQL: Beginners Guide with Docker</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serving with speed: Static Files in FastAPI]]></title>
            <link>https://medium.com/featurepreneur/serving-with-speed-static-files-in-fastapi-66af61c203e9?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/66af61c203e9</guid>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[rendering]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Sun, 28 May 2023 06:14:51 GMT</pubDate>
            <atom:updated>2023-05-28T06:14:51.616Z</atom:updated>
            <content:encoded><![CDATA[<p>FastAPI is a modern web framework for building APIs with Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*iqYhViDyDPWVnXntluV8EQ.png" /></figure><p>FASTAPI represents a significant advancement in API development technology for Python developers. Its ability to leverage Python’s type hints and async/await syntax to deliver high-performance APIs makes it a compelling choice for developers who want to build scalable, production-ready APIs quickly and efficiently.</p><p>This article focuses on serving static files in FastAPI by importing images to our app that reside in a directory.</p><p>In FastAPI, static files such as images, CSS files, JavaScript files, or PDFs are typically served directly by the web server instead of being handled by your application code. This improves performance and allows the webserver to efficiently serve these static files.</p><p>Let&#39;s first create a FastAPI endpoint to render our template(index.html)</p><pre>from fastapi import FastAPI, Request<br>from fastapi.templating import Jinja2Templates<br>import uvicorn<br><br><br>app = FastAPI()<br><br>templates = Jinja2Templates(directory=&quot;templates&quot;)<br><br>@app.get(&#39;/&#39;)<br>def index(request: Request):<br>    return templates.TemplateResponse(&quot;index.html&quot;, {&quot;request&quot;: request})<br><br>if __name__ == &quot;__main__&quot;:<br>    <br>    uvicorn.run(<br>        &quot;main:app&quot;,<br>        host    = &quot;0.0.0.0&quot;,<br>        port    = 8036, <br>        reload  = True<br>    )</pre><p>To know about rendering templates, Refer to this article</p><p><a href="https://medium.com/featurepreneur/fastapi-render-template-redirection-c98a26ae1e2a?source=your_stories_page-------------------------------------">https://medium.com/featurepreneur/fastapi-render-template-redirection-c98a26ae1e2a</a></p><p>Directory Structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*VUCv4BzaE0qNQQAHNXrwcg.png" /></figure><p>Here is the index.html file to display the name “Image Gallery”.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;<br>    integrity=&quot;sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi&quot; crossorigin=&quot;anonymous&quot;&gt;<br>    &lt;title&gt;Image Gallery&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;div class=&quot;container mt-5&quot;&gt;<br>        &lt;h1 class=&quot;text-center mb-5&quot;&gt;Image Gallery&lt;/h1&gt;<br>    &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>This file makes use of Bootstrap 5 for styling.</p><p>Run the program using the command</p><pre>python app.py</pre><p>After running the program locally, when a request is made using the URL http://0.0.0.0:8036,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T0IiAVqAemuJtwpn8zsAYw.png" /></figure><p>Now, Let&#39;s create a folder called “static” and add images to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*HElWFScBw74DnOu1rGAT2A.png" /></figure><p>I have downloaded a few images and added them to the static folder. Now let&#39;s see how to render them.</p><pre>app.mount(&quot;/static&quot;, StaticFiles(directory=&quot;static&quot;), name=&quot;static&quot;)</pre><p>This line of code is used to mount a static file directory in FastAPI.</p><ul><li>app: Refers to the FastAPI application instance.</li><li>.mount(): Method used to mount a specific path to a directory.</li><li>&quot;/static&quot;: The URL path or endpoint at which the static files will be served. In this case, it&#39;s /static.</li><li>StaticFiles(directory=&quot;static&quot;): An instance of the StaticFiles the class provided by FastAPI. It is responsible for serving the static files from the specified directory. Should be imported as</li></ul><pre>from fastapi.staticfiles import StaticFiles</pre><ul><li>directory=&quot;static&quot;: Specifies the directory from which static files will be served. In this example, it&#39;s the &quot;static&quot; directory relative to the location of the FastAPI script or application.</li><li>name=&quot;static&quot;: An optional name that can be given to the mounted static files. It is used to reference the mounted files elsewhere in the application if needed.</li></ul><p>With this code, any files placed in the “static” directory will be accessible via the /static URL path. For example, if we have a file named &quot;dog1.jpg&quot; in the &quot;static&quot; directory, it can be accessed /static/dog1.jpg in the browser. The entire code after mounting the folder static is given below.</p><pre>from fastapi import FastAPI, Request<br>from fastapi.templating import Jinja2Templates<br>import uvicorn<br><br>from fastapi.staticfiles import StaticFiles<br><br>app = FastAPI()<br><br>templates = Jinja2Templates(directory=&quot;templates&quot;)<br><br>app.mount(&quot;/static&quot;, StaticFiles(directory=&quot;static&quot;), name=&quot;static&quot;)<br><br><br>@app.get(&#39;/&#39;)<br>def index(request: Request):<br>    return templates.TemplateResponse(&quot;index.html&quot;, {&quot;request&quot;: request})<br><br><br>if __name__ == &quot;__main__&quot;:<br>    <br>    uvicorn.run(<br>        &quot;app:app&quot;,<br>        host    = &quot;0.0.0.0&quot;,<br>        port    = 8036, <br>        reload  = True<br>    )</pre><p>Let&#39;s check if this is working. I have to use the following URL to view the dog2 image.</p><pre>http://0.0.0.0:8036/static/dog2.jpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEukLszcM8VH_okvQLBiaw.png" /></figure><p>To access them in our HTML file,</p><pre>&lt;img src=&quot;{{ url_for(&#39;static&#39;, path=&#39;path_to_image.jpg&#39;) }}&quot; class=&quot;img-fluid&quot; alt=&quot;alternate-name&quot;&gt;</pre><p>In this example, the img tag is set to display an image with the path &#39;path_to_image.jpg&#39;. You can replace &#39;path_to_image.jpg&#39; with the actual path of the image file, you want to display. Additionally, you can set the class attribute to &quot;img-fluid&quot; responsive image behavior and set the alt attribute to the desired alternate name or description for accessibility purposes. The entire code of index.html,</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;<br>    integrity=&quot;sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi&quot; crossorigin=&quot;anonymous&quot;&gt;<br>    &lt;title&gt;Image Gallery&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;div class=&quot;container mt-5&quot;&gt;<br>        &lt;h1 class=&quot;text-center mb-5&quot;&gt;Image Gallery&lt;/h1&gt;<br>        &lt;div class=&quot;row&quot;&gt;<br>            {% for image_number in range(1, 11) %}<br>                &lt;div class=&quot;col-md-4&quot;&gt;<br>                    &lt;img src=&quot;{{ url_for(&#39;static&#39;, path=&#39;dog&#39; ~ image_number ~ &#39;.jpg&#39;) }}&quot; class=&quot;img-fluid&quot; alt=&quot;Dog {{ image_number }}&quot;&gt;<br>                &lt;/div&gt;<br>            {% endfor %}<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Here, the index.html file is modified to use Jinja2 templating syntax and access the static images:</p><p>The {% for %} the loop is used to iterate over the numbers 1 to 10 using the range(1, 11) function to retrieve our dog1,dog2 … dog10.jpg. Inside the loop, the img tag uses the url_for function to generate the URL for each static image. The image source is constructed by concatenating the string, the current, and the file extension &#39;.jpg&#39;. During 1st iteration, the image tag will look like the following to render the dog1 image.</p><pre>&lt;img src=&quot;{{ url_for(&#39;static&#39;, path=&#39;dog1.jpg&#39;) }}&quot; class=&quot;img-fluid&quot; alt=&quot;Dog {{ image_number }}&quot;&gt;</pre><p>In the code snippet above, the ~ the operator is used to concatenating the strings &#39;dog&#39;, the image_number variable, and &#39;.jpg&#39; to form the complete path of the image. The resulting path will be something like &#39;dog1.jpg&#39;, &#39;dog2.jpg&#39;, and so on.</p><p>Now let&#39;s run the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGcMYB7VIVYfi596djSbWQ.png" /></figure><p>Now, when I access the FastAPI application at http://localhost:8036/, the index.html the template is rendered, and the images &quot;dog1.jpg&quot; to &quot;dog10.jpg&quot; are displayed in a grid layout on the webpage.</p><p>GitHub repository for this app:</p><p><a href="https://github.com/SarumathyPrabakaran/image-gallery">https://github.com/SarumathyPrabakaran/image-gallery</a></p><p>Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66af61c203e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/serving-with-speed-static-files-in-fastapi-66af61c203e9">Serving with speed: Static Files in FastAPI</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the power of sikuliX: Automate with vision]]></title>
            <link>https://medium.com/featurepreneur/unleashing-the-power-of-sikulix-automate-with-vision-15936255bc6e?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/15936255bc6e</guid>
            <category><![CDATA[java-jar]]></category>
            <category><![CDATA[gui]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[sikulix]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Sun, 28 May 2023 06:10:53 GMT</pubDate>
            <atom:updated>2023-05-28T06:10:53.260Z</atom:updated>
            <content:encoded><![CDATA[<p>SikuliX is a powerful tool for <strong>GUI automation</strong>, and it can be a valuable addition to your automation toolkit, especially when dealing with applications that lack API support or require visual interaction.</p><p>SikuliX is an open-source automation tool that uses visual recognition to interact with graphical user interfaces (GUIs). It allows you to automate tasks by writing scripts that simulate user interactions based on visual patterns or images on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*jr-d4YOfuCLKTz-cXhXC8Q.png" /></figure><p>It provides a scripting interface in Python and Java, allowing you to write automation scripts using familiar programming languages. It can locate and click buttons, type text, perform mouse actions, and more, based on the patterns or images you define.</p><p><strong>AGENDA</strong>:</p><ol><li>SikuliX Installation</li><li>Running 1st Script in Sikulix IDE</li><li>Methods and Utilities in SikuliX</li><li><strong>SikuliX Installation</strong>:</li></ol><p>Head Over to the link, <a href="https://launchpad.net/sikuli/+download">https://launchpad.net/sikuli/+download</a></p><p>Download the jar file as per your OS. After downloading, open your terminal and cd into the path where u have downloaded your SikuliX jar file. Then Execute the command to open the SikuliX IDE.</p><pre>java -jar &lt;downloaded_sikuli_file_name&gt;.jar </pre><p>The &lt;file_name&gt; should be replaced with the one you have downloaded. In my case, It is</p><pre>java -jar sikulixide-2.0.5-lux.jar </pre><p>Make sure that you have Java installed in your system before you run this command. This command will open the sikuliX IDE for scripting.</p><p>If you encounter any errors like these, The IDE still opens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*NFX0preLWF4I5nly3Tqw1Q.png" /></figure><p>But If you want to get rid of these errors, You can try doing the below instructions.</p><ol><li>Failed to load module “canberra-gtk-module”: This error usually occurs when the “libcanberra-gtk-module” package is missing or not properly installed on your system. This module is related to sound events in GTK-based applications but is not directly related to Sikuli. To resolve this error, you can try installing the “libcanberra-gtk-module” package using your system’s package manager. For example, on Ubuntu or Debian-based systems, you can run the following command:</li></ol><pre> sudo apt-get install libcanberra-gtk-module</pre><p>2. SikuliIDEI18N: no locale for en_IN: This error occurs when the “en_IN” locale is not available on your system. Sikuli attempts to set the English (India) locale by default, but if it’s not available, this error can occur. One solution is to set a different locale explicitly. To do this, you can open a terminal and run the following command:</p><pre>export LC_ALL=C</pre><p>This command sets the “C” locale, which is a generic and commonly supported locale.</p><p>After resolving these errors, you should be able to launch Sikuli and use it without encountering these specific issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*wAzzDADKhnjvt1-leIJBQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J_C7qh5nS24SiTreV4snyw.png" /></figure><p>This is how it looks. You can spot “Run” at the top right corner of your IDE.</p><p><strong>2. Running 1st Script in Sikulix IDE:</strong></p><pre>click(&lt;picture&gt;)<br>doubleClick(&lt;picture&gt;)</pre><p>You have to pass the picture you want to click or double-click as an argument. You can do this by Inserting already saved images using the “Insert Image” option in your taskbar or the easiest way is to click “<strong>Take Screenshot</strong>”. The moment you click Take Screenshot, your IDE minimizes and a copy of your screen appears and you will be able to select an area of your screen to take the screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRKUNbZE7vN2GRMA71AGRg.png" /></figure><p>If you click Run, the IDE minimizes and starts executing the commands one by one.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.loom.com%2Fembed%2F2f10cc40c11e4bdfaecea5e49eda3280&amp;display_name=Loom&amp;url=https%3A%2F%2Fwww.loom.com%2Fshare%2F2f10cc40c11e4bdfaecea5e49eda3280&amp;image=https%3A%2F%2Fcdn.loom.com%2Fsessions%2Fthumbnails%2F2f10cc40c11e4bdfaecea5e49eda3280-1685124721049.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=loom" width="1280" height="960" frameborder="0" scrolling="no"><a href="https://medium.com/media/823bc242f641caa1879c5ba407f580ae/href">https://medium.com/media/823bc242f641caa1879c5ba407f580ae/href</a></iframe><p>You can also use for loop (syntax same as Python) to execute tasks a number of times. For example,</p><pre>for i in range(0,2):<br><br>    doubleClick(&quot;1685124458192.png&quot;)<br><br>    click(&quot;1685124477167.png&quot;)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.loom.com%2Fembed%2Fe7f7191d784d46b2958bf39e13b4b9cc&amp;display_name=Loom&amp;url=https%3A%2F%2Fwww.loom.com%2Fshare%2Fe7f7191d784d46b2958bf39e13b4b9cc&amp;image=https%3A%2F%2Fcdn.loom.com%2Fsessions%2Fthumbnails%2Fe7f7191d784d46b2958bf39e13b4b9cc-1685125542103.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=loom" width="1280" height="960" frameborder="0" scrolling="no"><a href="https://medium.com/media/f060830cce72b969d759ced8f745153f/href">https://medium.com/media/f060830cce72b969d759ced8f745153f/href</a></iframe><p><strong>Logs:</strong></p><p>Logs are visible at the right half of the editor after executing a script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*vgBu0B2dKvofnCCq9muHtA.png" /></figure><p><strong>3. Methods and Utilities in SikuliX:</strong></p><ul><li>Simulate keyboard Input:</li></ul><p>To simulate keyboard input in Sikuli, you can use the type() function. The type() function allows you to input text or special keys as if they were typed on the keyboard.</p><p>Sikuli requires the specific key names provided by its Key class, such as Key.ENTER, Key.TAB, etc., to represent special keys.</p><p>Remember to import the Key class from the Sikuli module at the beginning of your script:</p><pre>from sikuli import Key</pre><p>Here are the examples:</p><p>Typing Text:</p><pre>type(&quot;Hello, world!&quot;)  # Types the text &quot;Hello, world!&quot;</pre><p>Pressing Enter:</p><pre>type(Key.ENTER)  # Presses the Enter key</pre><p>Pressing Tab:</p><pre>type(Key.TAB)  # Presses the Tab key</pre><p>Backspace:</p><pre>type(&quot;Helli&quot; + Key.BACKSPACE + &quot;o&quot;)  # Types &quot;Hello&quot; by deleting the last character and replacing it with &quot;o&quot;</pre><p>Combining Keys:</p><pre>type(Key.CTRL, &quot;a&quot;)  # Presses the Ctrl key and types &quot;a&quot;</pre><p>Some common functions used in Sikuli:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*MaPyrcsi5RT4138sq991bw.png" /></figure><p>Overall, Sikuli is particularly useful when automating tasks that involve GUI-based applications, such as testing, repetitive tasks, or workflow automation.</p><p>Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15936255bc6e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/unleashing-the-power-of-sikulix-automate-with-vision-15936255bc6e">Unleashing the power of sikuliX: Automate with vision</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamline Your AWS Infrastructure: An Introduction to CloudFormation.]]></title>
            <link>https://medium.com/featurepreneur/streamline-your-aws-infrastructure-an-introduction-to-cloudformation-22bff58ee1ef?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/22bff58ee1ef</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[stack]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloudformation]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 15:55:54 GMT</pubDate>
            <atom:updated>2023-03-27T15:55:54.087Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS CloudFormation is a tool that helps you <strong>provision and manages resources </strong>on Amazon Web Services (AWS) in a declarative way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*S4vUO9wztRHBuFHR.jpg" /></figure><p>In simple terms, when you want to create a new AWS infrastructure for your application or modify an existing one, you need to specify what resources you want to create, their configurations, and their relationships with each other. Doing this manually can be time-consuming and error-prone, especially if you have a complex infrastructure.</p><p>AWS CloudFormation allows you to <strong>automate</strong> this process by defining your <strong>infrastructure as code</strong>. You can use a template, which is a JSON or YAML file, to describe your resources and their configurations. CloudFormation then takes care of provisioning and configuring these resources for you, in the right order, and in a reliable and repeatable way.</p><p>Here, I will be using YAML files to create, manage and delete stacks.</p><ol><li><strong>Creating a Stack:</strong></li></ol><p>YAML Code to Create a Stack with a single ec2 Instance:</p><pre>Resources:<br>  MyCloudFormationEC2:<br>    Type: AWS::EC2::Instance<br>    Properties:<br>      InstanceType: t2.micro<br>      ImageId: ami-0ab0629dba5ae551d<br>      Tags:<br>        - Key: &quot;Name&quot;<br>          Value: &quot;firstInstance&quot;</pre><p>This YAML-formatted CloudFormation template defines a CloudFormation resource named “MyCloudFormationEC2”.The Resources section is a <strong>mandatory section </strong>of a CloudFormation template, which defines the AWS resources to be created and managed by the stack. In this case, a single resource is defined with the logical name &quot;MyCloudFormationEC2”.</p><p>The Type property specifies the AWS resource type of the CloudFormation resource. Syntax:</p><pre>AWS::ProductIdentifier::ResourceType</pre><p>Eg: To create an S3 Bucket, you have to specify AWS::S3::Bucket . To create a Security group, you have to use AWS::EC2::SecurityGroup.</p><p>Here, The EC2 instance created will have the following specifications:</p><ul><li>Instance Type: t2.micro (Defines Hardware specifications of the Instance)</li><li>Amazon Machine Image (AMI): ami-0ab0629dba5ae551d (OS of the Instance)</li><li>Tags: a key-value pair where the key is “Name” and the value is “first-instance”(Name of the EC2 Instance).</li></ul><p>By using this CloudFormation template, an EC2 instance with the default VPC will be launched in the specified region. However, it’s important to note that the other properties of the EC2 instance, such as security groups, subnets, and storage, are not specified in this template. If you want, you can specify. Else, it will assume default values.</p><p>Note: This file should be saved with .yaml extension.</p><p>Now, let us try uploading this file to AWS CloudFormation Management Console. Head over to the AWS CloudFormation console page. Click Create Stack. Now you will land on a page like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*fkpYdGdWuVaNvcR7.png" /></figure><p>If you want to use a sample template provided by AWS, you can use it by selecting ‘Use a sample template’ and choosing a desired option among the listed options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*-9galXfWjWrXEhz_.png" /></figure><p>Here, we will be using the ‘Template is ready’ option and uploading our own template.</p><p>We can upload our code template in 2 ways.</p><ol><li>We can put the YAML(or JSON) file into an S3 bucket and provide the s3 URL.</li><li>Upload the file directly by selecting “Upload a template file”.</li></ol><p>Here, we are going to upload the above given YAML file. After choosing the file, you will see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*JPfD-bMBaGxUdxww.png" /></figure><p>Click ‘View in Designer’ to check if your template is valid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/0*VZCAJ_9Bb-c_SMaP.png" /></figure><p>You can click that ‘tick’ symbol to validate your template. If any errors, it will show you and you can edit the template and save it. Else, it will show “<strong>Template is valid</strong>”. Then u can click that ‘cloud-with-up-arrow’ symbol to create a stack. Then click next. Then, you will have to enter your stack name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*aXXvk7JNO2ZZl7lC.png" /></figure><p>Then for all others, you can specify if u want. Else, the default will be assumed. I am leaving everything as default. After clicking a bunch of next, You will be asked to “<strong>Submit</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/0*-OivD8SWagXfAmEB.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*-ITwGZIS8BKvNkJZ.png" /></figure><p>You will have to wait for a few seconds for the creation to complete. After that, you can go to EC2 to find your instance running there which you have created using CloudFormation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*LKab0uHSqwwbGA4p.png" /></figure><p>We have now successfully created an EC2 Instance using CloudFormation.</p><p><strong>2. Deleting stack:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/0*fV0nlOR1tLqzD6hA.png" /></figure><p>As mentioned there, if you delete the stack, then all the resources created under the stack will be deleted automatically.</p><p><strong>3. Update Stack:</strong></p><p>If you want to update your stack, you can do so by clicking the ‘Update’ button which you will find if you select your Stack. You can use either of the three options to update your stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*bPQ01D-UlwrGvqJP.png" /></figure><p>Then follow the same steps to create your updated stack. You can view <strong>Change Set</strong> before updating your stack.</p><p><strong>Change Set:</strong></p><p>It shows how a change gonna affect your existing resources when you try to update your stack.</p><ul><li>If you try to change the name of the instance, It is not gonna terminate your instance.</li><li>If you change your instance type, same.</li><li>But, if you change your AMI Id, then your instance will be terminated and start again. This may lead to data loss.</li></ul><p>Thank you. Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22bff58ee1ef" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/streamline-your-aws-infrastructure-an-introduction-to-cloudformation-22bff58ee1ef">Streamline Your AWS Infrastructure: An Introduction to CloudFormation.</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unleashing the Power of AWS with Boto3: A Beginner’s Guide]]></title>
            <link>https://medium.com/featurepreneur/unleashing-the-power-of-aws-with-boto3-a-beginners-guide-2c15fa976eac?source=rss-e61a4cd0cf62------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c15fa976eac</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[boto3]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[featurepreneur]]></category>
            <category><![CDATA[boto3-python]]></category>
            <dc:creator><![CDATA[Sarumathy P]]></dc:creator>
            <pubDate>Sun, 05 Mar 2023 15:45:05 GMT</pubDate>
            <atom:updated>2023-03-05T15:45:05.761Z</atom:updated>
            <content:encoded><![CDATA[<p>Boto3 is a Python library that provides a simple and easy-to-use interface for developers to interact with various Amazon Web Services (AWS) using Python code. It allows developers to programmatically access and manipulate AWS resources, such as EC2 instances, and S3 buckets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/0*tlcH6FyRM-z9r5m2" /></figure><p>Boto3 acts as a bridge between Python code and AWS services, making it easier for developers to integrate and automate their applications with AWS.</p><p>This article covers:</p><ul><li>Connecting to AWS using the AWS Command Line Interface (CLI).</li><li>Installation of boto3</li><li>Basic examples and use cases of the Boto3 library.</li></ul><p>Here are the steps to <strong>connect</strong> your system to AWS using the AWS CLI:</p><ol><li>Install the AWS CLI on your system if it’s not already installed. You can download and install the CLI from the AWS documentation here https://aws.amazon.com/cli/</li><li>Configure the AWS CLI by running the following command and entering your AWS access key ID, secret access key, and default region when prompted.</li></ol><pre>aws configure</pre><p>3. Verify that the CLI is properly configured by running the following command:</p><pre>aws ec2 describe-instances</pre><p>If your CLI is correctly configured, this command should return a list of all the EC2 instances in your AWS account.</p><p>4. Install the Boto3 library by running the following command:</p><pre>pip install boto3</pre><p>Note that because the AWS CLI is already configured with your access key and secret access key, you do not need to specify them again in your Python code.</p><p><strong>Examples:</strong></p><ol><li><strong>Printing the Names and states of all the EC2 instances</strong></li></ol><pre>import boto3<br><br>ec2 = boto3.resource(&#39;ec2&#39;)<br><br>for instance in ec2.instances.all():<br>    print(instance.id, instance.state)`</pre><ul><li>import boto3: This line imports the boto3 library, which is the AWS SDK (A collection of software development tools and libraries provided by AWS) for Python.</li><li>ec2 = boto3.resource(&#39;ec2&#39;): This line creates an EC2 resource object using the boto3.resource method. The ec2 an object is used to interact with EC2 resources in the current AWS account.</li><li>for instance in ec2.instances.all():: This line starts a for loop that iterates over all EC2 instances in the current AWS account. The ec2.instances.all() method returns a collection of Instance objects that represent all EC2 instances in the current account.</li><li>print(instance.id, instance.state): This line prints the ID and state of each EC2 instance in the current account. The instance.id and instance.state attributes of each Instance object are used to access the ID and state of the current instance in the loop.</li></ul><p>The reason why this code runs without any access keys is that boto3 uses the AWS credentials stored on the system to access AWS resources. If the system has valid AWS credentials with the necessary permissions to interact with EC2 resources, then the code will run without any issues. Else the code will raise an error.</p><p>2. <strong>Get the name of the specific EC2 instance</strong></p><pre>import boto3<br><br>ec2 = boto3.resource(&#39;ec2&#39;)<br><br>instance = ec2.Instance(&#39;your_instance_id&#39;)<br><br>for tag in instance.tags:<br>    if tag[&#39;Key&#39;] == &#39;Name&#39;:<br>        name = tag[&#39;Value&#39;]<br>        break<br>else:<br>    name = &#39;Instance has no name&#39;<br><br>print(name)</pre><p>Replace &#39;your_instance_id&#39; with the ID of the EC2 instance, you want to retrieve the name. This code retrieves the tags associated with the instance and looks for a tag with the key &#39;Name&#39;. If it finds a matching tag, it retrieves the tag&#39;s value as the name. If it does not find a matching tag, it sets the name to &#39;Unnamed&#39;.</p><p>3. <strong>Buckets count in your S3</strong> :</p><pre>import boto3<br><br>s3 = boto3.client(&#39;s3&#39;)<br><br>bucket_list = s3.list_buckets()<br>count = 0<br>for bucket in bucket_list[&#39;Buckets&#39;]:<br>    #print(bucket)<br>    count+=1<br>print(count)</pre><p>list_buckets the method outputs a dictionary like this:</p><pre>{<br>    &quot;ResponseMetadata&quot;: {<br>        &quot;RequestId&quot;: &quot;....&quot;,<br>        &quot;HostId&quot;: &quot;.....&quot;,<br>        &quot;HTTPStatusCode&quot;: 200,<br>        &quot;HTTPHeaders&quot;: {<br>            &quot;x-amz-id-2&quot;: &quot;....&quot;,<br>            &quot;x-amz-request-id&quot;: &quot;...&quot;,<br>            &quot;date&quot;: &quot;Sun,05 Mar 2023 07: 29: 17 GMT&quot;,<br>            &quot;content-type&quot;: &quot;application/xml&quot;,<br>            &quot;transfer-encoding&quot;: &quot;chunked&quot;,<br>            &quot;server&quot;: &quot;AmazonS3&quot;<br>        },<br>        &quot;RetryAttempts&quot;: 0<br>    },<br>    &quot;Buckets&quot;: [<br>        {<br>            &quot;Name&quot;: &quot;&lt;bucket1name&gt;-loaction&quot;,<br>            &quot;CreationDate&quot;: &quot;&lt;yourbucketcreationdate&gt;&quot;<br>        },<br>        {<br>            &quot;Name&quot;: &quot;&lt;bucket2name&gt;-loaction&quot;,<br>            &quot;CreationDate&quot;: &quot;&lt;yourbucketcreationdate&gt;&quot;<br>        }<br>    ],<br>    &quot;Owner&quot;: {<br>        &quot;ID&quot;: &quot;someid&quot;<br>    }<br>}</pre><p><strong>4. Upload a file into your S3 bucket</strong></p><pre>import boto3<br><br><br>s3 = boto3.client(&#39;s3&#39;)<br><br>s3.upload_file(&#39;/home/saru/Desktop/hello.txt&#39;, &#39;my-first-bucket&#39;, &#39;text-files-object&#39;)</pre><p>The boto3.client(&#39;s3&#39;) the line creates a client object for the S3 service.</p><p>The s3.upload_file() the method is then called, which uploads a file to an S3 bucket. The method takes three arguments.</p><p>Syntax:</p><pre>upload_file(&lt;local-file-path&gt;, &lt;s3-bucket-name&gt;, &lt;s3-objectkey-name&gt;)</pre><p>Therefore, the code is uploading the file located at ‘/home/saru/Desktop/hello.txt’ to the S3 bucket named ‘my-first-bucket’ and assigning the S3 object key ‘text-files-object’ to the uploaded file.</p><p>5. <strong>Creating CloudFormation Stack</strong></p><pre>import boto3<br><br>cloudformation = boto3.client(&#39;cloudformation&#39;)<br><br>stack_name     = &#39;my-ec2-stack-1&#39;<br><br>template_body  = &#39;&#39;&#39;<br>Resources:<br>  SaruEC2Instance3:<br>    Type: AWS::EC2::Instance<br>    Properties:<br>      InstanceType: t2.micro<br>      ImageId: ami-0ab0629dba5ae551d<br>      Tags:<br>        - Key: &quot;Name&quot;<br>          Value: &quot;mythirdInstance&quot;<br>&#39;&#39;&#39;<br><br># Create the stack<br>response = cloudformation.create_stack(<br>    StackName    = stack_name,<br>    TemplateBody = template_body<br>)<br><br># Print the stack creation response<br>print(response)</pre><p>This code when executed creates a stack named “my-ec2-stack-1” in AWS CloudFormation with a single EC2 instance named ‘mythirdInstance’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*Q-R-ZW8JWNMhGH93dwpiDg.png" /></figure><p>Thus, Boto3 allows you to automate tasks that would otherwise need to be done manually in the AWS Management Console. This can save time and reduce the chance of human error. But one needs to be more careful while writing the code. In case of any error in the naming conventions(Eg: no space should be given in stack name), the program fails to do its expected job. Make sure all the naming conventions are correctly followed before you execute the code.</p><p>Thank you. Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c15fa976eac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/featurepreneur/unleashing-the-power-of-aws-with-boto3-a-beginners-guide-2c15fa976eac">Unleashing the Power of AWS with Boto3: A Beginner’s Guide</a> was originally published in <a href="https://medium.com/featurepreneur">featurepreneur</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>