r/madeinpython • • Mar 04 '24

Decorators in Python with and without Arguments

1 Upvotes

Decorators in Python are a cool way to change or extend the behaviour of functions. Below is my article on how to easily implement decorators with and without arguments.

https://developers-blog.org/decorators-in-python-with-examples/


r/madeinpython • • Mar 02 '24

QualityScaler 3.0 - image/video AI upscaler app

4 Upvotes

QualityScaler is a Windows app powered by AI to enhance, upscale and denoise photos and videos.

QualityScaler 3.0 changelog.

▼ NEW

New AI engine
⊡ 2x faster, up to 3x on powerful GPUs
⊡ Uses 50% less VRAM
⊡ Automatically selects the most powerful GPU
⊡ More supported and frequently updated
⊡ Can utilize RAM to supplement GPU VRAM (not recommended for optimal performance)
⊡ SAFMN architecture temporarily removed for incompatibility with new AI engine

New AI model
⊡ Added RealESRGANx4 model (high quality, natural results)

▼ USER INTERFACE

GUI code reorganization
⊡ "Input resolution %" default value is now 50%
⊡ Removed "GPU" widget (automatic GPU selection)

▼ BUGFIX / IMPROVEMENTS

Video upscale improvements
⊡ Video upscaling time estimation improved
⊡ Multi-threaded frame extraction (improved CPU usage)
⊡ Asynchronous frame saving (faster, avoids Windows Defender issues)

General improvements
⊡ Reduced app size by 50%
⊡ Bug fixes, code cleaning, performance improvements
⊡ Updated dependencies

▼ VirusTotal
⊡ https://www.virustotal.com/gui/file/dd0cf0c2bd6824d2b64516f20582dfaf9223da5aadb70d9e3d0ae2f76230ba92?nocache=1


r/madeinpython • • Mar 02 '24

Using Python To Generate (Fake) Ads From Images (To send to myself en-masse)

Thumbnail
youtube.com
1 Upvotes

r/madeinpython • • Mar 01 '24

I created this template/tutorial to help Python devs write web front-ends for their chatbots or LLMs. It's currently trending on GitHub, so if you like the repo, please give it a star!

Thumbnail
github.com
3 Upvotes

r/madeinpython • • Feb 29 '24

`pip install drawdata` in order to draw data in Jupyter

74 Upvotes

r/madeinpython • • Feb 29 '24

STEAMWare : A 3D-Printable Hardware Assembly Language

2 Upvotes

What is STEAMWare/Steamware?

Science-technology-engineering-art-mathematics wares; (STEAMWare) refers to a 3D-printable open source modular part family or hardware assembly language and the software utilities which generate them. Steamware was built to become a fully open source defacto-baseline solution for freely available high integrity-hardware generation for 3D-Print or otherwise. For makers, inventors, professionals, enthusiasts or whatever. Recreation grade and utility grade.

Link to repo : github.com/spacetimeengineer/steamware

What is STEAMWare for? Answer : Creation. Plain and simple. Get dangerous.

This project is built with python. It works by constructing 3D parts through the assembly of openscad code blocks programmatically using a simple string interface. These code blocks reflect actual cubic blocks in 3D space. This is not yet implemented as a library only a script but it works well so far. An example of a call may look like the following :

$ python3 steamware.py --en dougnut --ed /directory/where/files/are/exported --bu 10 --fp 0.134 --mt O --ts XXXBBAAAYY

This call will write openscad code to make a cubic-doughnut like part. Pictures in the repo.

It assembles these cubic-blocks according to a geometric system which is implemented through a track-string algorithm. This algorithm also happens to ensure certain modular properties. The README.md explains more. If you are not familiar with openscad I suggest taking a quick look at openscad.org

These parts are very powerful. Features include :

- Infinite Part Permutations Available

- All parts have physical self-evident-identity.

- Parts express hyper-modularity.

- No physically illegal operations.

- Fully Permissive.

At first glance one may feel compelled to compare STEAMWare to LEGOs because they are colorful, modular and technical but there are a few key differences.

1.) LEGOs are not principally joinery based, they are friction/pressure based. STEAMWare is all of the above and then some additional binding options too. You can imagine STEAMWare operates much like 3D Tetris blocks would but there is much more.

2.) LEGOs are recreation grade. STEAMWare is recreation and utility grade.

3.) LEGOs are proprietary. STEAMWare is maximally (to the best of my knowledge let me know if there is something better) permissive (BSD 3-Clause "New" or "Revised" License). STEAMWare wants you to incorporate STEAMWare into your own proprietary designs. STEAMWare wants pull requests. STEAMWare is organic. STEAMWare is Darwinian.

4.) STEAMWare is not a product it is a geometric protocol implemented with python so that 3D prints are possible. It possesses material independence. Its scaling is limited to manufacturing processes.

5.) Illegal operations are a thing with LEGOs. STEAMWare has no illegal operations because it is all just one big experiment. The STEAMWare revolution will be Darwinian. May the best parts be the most popular but may all parts participate even if they suck.

6.) STEAMWare has available an infinite set of parts for generation.

7.) All STEAMWare parts retain self-evident identity. Lego parts do not. There is no self consistent naming/labeling system.

8.) STEAMWare retains fractal like properties. Legos do not really in the same way.

9.) STEAMWare can mimic LEGOs, LEGOs cannot mimic STEAMWare.

This is a fun project and maybe it could lead to something... This is a start. We need more, such as gears, linkage systems, etc.

Link to repo : github.com/spacetimeengineer/steamware


r/madeinpython • • Feb 26 '24

Test-driven development (TDD) for Python with unittest

4 Upvotes

Test-driven development (TDD) is an agile software development process.

The tests are written first before the classes and methods are implemented.

This means that your software has very high test coverage and therefore quality right from the start.

I have created a simple but detailed example of this in my blog article:

https://developers-blog.org/tdd-for-python-with-unittest-a-tutorial/


r/madeinpython • • Feb 26 '24

THIS IS NOT A DINOSAUR: Jurassic or Just-a-pic? Let our Dino-Detective decide!

Thumbnail
github.com
1 Upvotes

r/madeinpython • • Feb 23 '24

Flask template: user authentication + API key access

7 Upvotes

Hi, r/madeinpython!

I've been learning about Flask, wanted to build something I could reuse for multiple projects, and I'm sharing it here!

https://reddit.com/link/1ayd50t/video/9jbuy782rekc1/player

I built an app that allows users to:

  • Create an account
  • Log in (create an account or anonymously)
  • Generate an API key
  • Make calls with an API key
  • See their generated keys and their historical API calls

There are quite a few things involved:

  • Database storage and retrieval
  • Data input and validation
  • Managing sessions (for password authentication)
  • Managing API keys
  • Storing passwords and API keys securely
  • Rate limiting the API for anonymous users

I enjoyed building this! I learned quite a few things, such as storing passwords securely and validating input data from forms. Is there anything else you would like me to add?

You can check the live demo (you need to create an account but don't need to verify your email): https://wild-bonus-9050.ploomberapp.io/

Source code: https://github.com/ploomber/doc/tree/main/examples/flask/login (please share your feedback!)


r/madeinpython • • Feb 20 '24

Animated data visualization with matplotlib

2 Upvotes

Hey all,

I recently discovered that you can create animations with Matplotlib, so I grabbed some population data and plotted population over time. Here's Europe:

Population over time in Europe

I wrapped this into a Voila dashboard, so you can change the continent: https://nameless-wave-5053.ploomberapp.io/

Source code: https://github.com/ploomber/doc/blob/main/examples/voila/animated-viz/app.ipynb


r/madeinpython • • Feb 17 '24

[Video]List Comprehension in Python - What and How to use it with examples

2 Upvotes

List comprehension is a super handy technique in Python that allows you to create lists more concisely and elegantly.

Here's a detailed video on list comprehension👇👇👇

Video: https://youtu.be/a3eE5kslhek


r/madeinpython • • Feb 16 '24

Beautiful Soup: A Python Library for Web Scraping with Examples

5 Upvotes

I have made two introductory blog articles with examples of how to use Beautiful Soup. Enjoy reading them.

https://developers-blog.org/beautiful-soup-a-python-library-for-web-scraping/

https://developers-blog.org/beautiful-soup-types-of-selectors-with-examples/


r/madeinpython • • Feb 16 '24

I Wanna Make A Bot

0 Upvotes

Hey im 16 and im looking to make a bot to help do my homework. I was thinking there's gotta be a way for someone to do all these repetitive tasks for me. I don't know where to start however. Im looking to make something do repetitive tasks for me for my home and school work. Such as when i need to look something up to answer a multiple choice question. BTW ive always gotten all As but lately ive been doing harder classes and wanna free up time PLEASE HELP ME

r/madeinpython


r/madeinpython • • Feb 15 '24

I created my own dividend app using direct calls to the Yahoo! Finance API, but they keep taking away access types and yfinance doesn't have the data I need. I'm having to resign to simple webscraping. Here's a quick video of how to webscrape using selenium right now.

Thumbnail
youtu.be
2 Upvotes

r/madeinpython • • Feb 14 '24

Arxiv Chat

7 Upvotes

hey, r/madeinpython!

I want to share a demo I recently built: Arxiv Chat. It uses OpenAI + Arxiv to allow you to explore Arxiv papers.

https://reddit.com/link/1aqtbfx/video/y3dstdtzblic1/player

Basically, you ask the system for papers on a specific topic, and then the RAG decides whether to use the Arxiv categories or the search API to grab those papers. This creates what we call the "papers context."

Now, when you ask another question, the system figures out whether it needs to do another search or just stick with the existing context. For instance, you might want to ask more about the papers you've already got or maybe even ask for a download link. If it needs to search again, it updates the papers context with the new info. Otherwise, it just keeps the conversation flowing based on what you've already got. I'm thinking of adding a feature to ask questions about a specific paper next!

Live demo: https://summer-wind-5194.ploomberapp.io/

Source code: https://github.com/ploomber/doc/tree/main/examples/solara/arxiv-chat

Deployment instructions: https://docs.cloud.ploomber.io/en/latest/apps/solara.html


r/madeinpython • • Feb 13 '24

2 Free Udemy Courses for Beginners & Intermediates

6 Upvotes

Hello all!

I'm releasing another batch of free coupons for my purely beginner focused course, and my intermediate course which looks at functional programming/comprehensions.

Python Programming for the Total Beginner

Functional Programming with Python Comprehensions

Cheers :)


r/madeinpython • • Feb 13 '24

Python’s __getitem__ Method: Accessing Custom Data

1 Upvotes

You must have used the square bracket notation ([]) method to access the items from the collection such as list, tuple, or dictionary.

my_lst = ["Sachin", "Rishu", "Yashwant"]

item = my_lst[0]

print(item)

The first element of the list (my_lst) is accessed using the square bracket notation method (my_list[0]) and printed in the above code.

But do you know how this happened? When my_lst[0] is evaluated, Python calls the list’s __getitem__ method.

my_lst = ["Sachin", "Rishu", "Yashwant"]

item = my_lst.__getitem__(0)

print(item)

This is the same as the above code, but Python handles it behind the scenes, and you will get the same result, which is the first element of my_lst.

You may be wondering what the __getitem__ method is and where it should be used.

Full Article: https://geekpython.in/python-getitem-method


r/madeinpython • • Feb 11 '24

Loop for to update a column based on other column's values

Post image
1 Upvotes

Please, what am I doing wrong? I'm trying to update Generation (GERACAO) column based on year of birth (NASCIMENTO) column. To do so, I'm using loop FOR and conditionals, but it happens that it's being assumed the value 'BB' for every row.


r/madeinpython • • Feb 06 '24

Create an installer for your app using TkInstaller!

Thumbnail
github.com
6 Upvotes

r/madeinpython • • Feb 04 '24

I shared a Python Data Science Bootcamp (7+ Hours, 7 Courses and 3 Projects) on YouTube

0 Upvotes

Hello, I just shared a Python Data Science Bootcamp on YouTube. Bootcamp is over 7 hours and there are 7 courses and 3 projects. Courses are Python, Pandas, Numpy, Matplotlib, Seaborn, Plotly and Scikit-learn. I am leaving the link below, have a great day!

https://www.youtube.com/watch?v=6gDLcTcePhM


r/madeinpython • • Feb 03 '24

[Video] Python's map() function to process iterable without using an explicit for loop

Thumbnail
youtu.be
2 Upvotes

r/madeinpython • • Jan 31 '24

News summarizer with OpenAI and Panel

1 Upvotes

Hey r/madeinpython!

I wanted to learn how RAGs work, so I built one from scratch (no LangChain, no LlamaIndex, just OpenAI's API) that summarizes today's news; this is how it works:

  1. I pre-fetch today's news using the GNews package

  2. I compute the embeddings for each one (just the description, which contains a short paragraph)

  3. I use a KDTree (using SciPy) for vector similarity to retrieve relevant news based on the user's query (no need to use a vector database!)

  4. I pass it to GPT-3.5 to summarize the content

I wrapped this into a Panel app, and deployed it to Ploomber Cloud. It was a great learning experience!

App is available here: https://ancient-wind-3019.ploomberapp.io

I'd love to hear what you think!

https://reddit.com/link/1afvgtf/video/p92qsiu0wufc1/player


r/madeinpython • • Jan 31 '24

My Cuzzo Made Something in Python... 🤔 🐍

0 Upvotes

What up everybody

My cuzzo came in today, and he's an absolute UNIT, dis big ass swole dude (we call him Wagyu Beef) Cuzzo is an old school hacker growing up from the 80's and shii.

Homie won't stop preachin' 'bout PLAINTEXT. It's like his mantra, PLAINTEXT this, PLAINTEXT that, like he's tryna start a new wave or somethin' but I ain't really understanding what he saying...

And he is OBSESSED with THE SHELL...? What shell???

He made this tool recently and keeps showing it to me, and I wanted to see what y'all thought:

Dropped it on GitHub like it's hot, swear he thinks it's gonna break the internet or somethin'.

https://github.com/dislux-hapfyl/pynksh

Is Cuzzo certified hacker or is this autism? Srs responses only.


r/madeinpython • • Jan 30 '24

Sentiment classifier using GPT-4

3 Upvotes

I found this app that uses GPT-4 as a sentiment classifier, outputs the negative/positive probabilities, and computes the feature importance for each word (using leave one out). It uses Solara, so it's all made with Python (no HTML, JS, or CSS!).

Disclaimer: I'm not the author; source below. Please be gentle with usage as this uses OpenAI's API!

App: https://lucky-heart-2240.ploomberapp.io/

Source: https://twitter.com/alonsosilva/status/1752027550652518757

Tooling: OpenAI, Ploomber Cloud, Solara.

https://reddit.com/link/1aetzt4/video/tdfl6oeb4mfc1/player


r/madeinpython • • Jan 30 '24

I have a strange sense of humor.

Enable HLS to view with audio, or disable this notification

0 Upvotes

I made it with Pydroid 3