[P] I built a simple and efficient rate limiter for the OpenAI API
https://github.com/shobrook/openlimit
/r/MachineLearning
https://redd.it/12w6k44
https://github.com/shobrook/openlimit
/r/MachineLearning
https://redd.it/12w6k44
GitHub
GitHub - shobrook/openlimit: Efficient, per-second rate limiter for the OpenAI API
Efficient, per-second rate limiter for the OpenAI API - shobrook/openlimit
As if there weren't enough packaging tools already: mitsuhiko/rye: an experimental alternative to poetry/pip/pipenv/venv/virtualenv/pdm/hatch/…
https://github.com/mitsuhiko/rye
/r/Python
https://redd.it/12w2ws7
https://github.com/mitsuhiko/rye
/r/Python
https://redd.it/12w2ws7
GitHub
GitHub - astral-sh/rye: a Hassle-Free Python Experience
a Hassle-Free Python Experience. Contribute to astral-sh/rye development by creating an account on GitHub.
Question about unit testing
Suppose I have a User entity and I have this business rule: usernames should be saved in lowercase letters.
If we need to enforce this rule with a test, what layer does this test belong to?
Controller? Service? Domain model? Repository? Integration test?
What layer should this test live in?
/r/Python
https://redd.it/12wcyf0
Suppose I have a User entity and I have this business rule: usernames should be saved in lowercase letters.
If we need to enforce this rule with a test, what layer does this test belong to?
Controller? Service? Domain model? Repository? Integration test?
What layer should this test live in?
/r/Python
https://redd.it/12wcyf0
Reddit
r/Python on Reddit: Question about unit testing
Posted by u/Zumcddo - 11 votes and 8 comments
Deploying a Flask and Vue App to Heroku with Docker and Gitlab CI
https://testdriven.io/blog/deploying-flask-to-heroku-with-docker-and-gitlab/
/r/flask
https://redd.it/12w9idz
https://testdriven.io/blog/deploying-flask-to-heroku-with-docker-and-gitlab/
/r/flask
https://redd.it/12w9idz
testdriven.io
Deploying a Flask and Vue App to Heroku with Docker and Gitlab CI
This tutorial looks at how to containerize a full-stack web app powered by Flask and Vue and deploy it to Heroku using Gitlab CI.
Trying out tunnel.dev
Hey, what's up, everyone? I'm building a startup called Tunnel. Tunnel is a super fast way to get a locally running app on the web, and it comes with a bunch of tools for collecting feedback like commenting and video chat.
I would love it if you all could check out our docs and give me some feedback! Here's the link: https://docs.tunnel.dev
I'm also happy to answer any questions you have, like "Why is Tunnel better than ngrok?"
Thanks, builders!
/r/flask
https://redd.it/12wksay
Hey, what's up, everyone? I'm building a startup called Tunnel. Tunnel is a super fast way to get a locally running app on the web, and it comes with a bunch of tools for collecting feedback like commenting and video chat.
I would love it if you all could check out our docs and give me some feedback! Here's the link: https://docs.tunnel.dev
I'm also happy to answer any questions you have, like "Why is Tunnel better than ngrok?"
Thanks, builders!
/r/flask
https://redd.it/12wksay
Tunnel
What is Tunnel? - Tunnel
Monday Daily Thread: Project ideas!
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/12wvgm0
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/12wvgm0
Reddit
r/Python on Reddit: Monday Daily Thread: Project ideas!
Posted by u/Im__Joseph - No votes and no comments
Solarflare
Hello! I made a simple Python Library for solar/lunar calculations. Its main focus is on Sunset/rise times, but it can calculate other things (solar noon, moon phases, etc.). You can view its documentation at https://solarflare.w3spaces.com , and the source code at Github (https://github.com/PyndyalaCoder/solarflare ). Tell me what you think! If you like it, please star the repository on Github.
/r/Python
https://redd.it/12wvwsa
Hello! I made a simple Python Library for solar/lunar calculations. Its main focus is on Sunset/rise times, but it can calculate other things (solar noon, moon phases, etc.). You can view its documentation at https://solarflare.w3spaces.com , and the source code at Github (https://github.com/PyndyalaCoder/solarflare ). Tell me what you think! If you like it, please star the repository on Github.
/r/Python
https://redd.it/12wvwsa
GitHub
GitHub - PyndyalaCoder/Solarflare: A python library for calculating solar events
A python library for calculating solar events. Contribute to PyndyalaCoder/Solarflare development by creating an account on GitHub.
Does anyone know of a good tutorial for documenting code and what I should use for flask?
Does anyone know of a good tutorial for documenting code and what I should use for flask?
/r/flask
https://redd.it/12wz3fw
Does anyone know of a good tutorial for documenting code and what I should use for flask?
/r/flask
https://redd.it/12wz3fw
Reddit
r/flask on Reddit: Does anyone know of a good tutorial for documenting code and what I should use for flask?
Posted by u/notprimenumber12344 - 2 votes and 2 comments
I have made some easy tools to rip webpages, clean the data, and vectorize it for a Pinecone DB. Great if you want your AI to consult a webpage.
[https://github.com/Sstobo/Site-Sn33k](https://github.com/Sstobo/Site-Sn33k)
Take a look :)
# Website Scraper and Vectorizer
This Python repository contains a set of scripts that allow you to scrape a website, clean the data, organize it, chunk it, and then vectorize it. The resulting vectors can be used for a variety of machine learning tasks, such as similarity search or clustering.
## Files
* cleaner.py
: This script downloads a website using wget, reads and cleans the HTML files using Beautiful Soup, and saves the resulting text files in a specified directory.
* chunker.py
: This script splits the text files into smaller chunks, using a recursive character-based text splitter. The resulting chunks are saved in a JSONL file.
* vectorizor.py
: This script loads the JSONL file, creates embeddings using OpenAI's text-embedding-ada-002 model, and indexes the embeddings using Pinecone. This is the one script you need api keys to run
​
Enjoy and let me know if this helps with anything, or you have any feedback :)
/r/Python
https://redd.it/12wqzbk
[https://github.com/Sstobo/Site-Sn33k](https://github.com/Sstobo/Site-Sn33k)
Take a look :)
# Website Scraper and Vectorizer
This Python repository contains a set of scripts that allow you to scrape a website, clean the data, organize it, chunk it, and then vectorize it. The resulting vectors can be used for a variety of machine learning tasks, such as similarity search or clustering.
## Files
* cleaner.py
: This script downloads a website using wget, reads and cleans the HTML files using Beautiful Soup, and saves the resulting text files in a specified directory.
* chunker.py
: This script splits the text files into smaller chunks, using a recursive character-based text splitter. The resulting chunks are saved in a JSONL file.
* vectorizor.py
: This script loads the JSONL file, creates embeddings using OpenAI's text-embedding-ada-002 model, and indexes the embeddings using Pinecone. This is the one script you need api keys to run
​
Enjoy and let me know if this helps with anything, or you have any feedback :)
/r/Python
https://redd.it/12wqzbk
GitHub
GitHub - Sstobo/Site-Sn33k: A collection of tools to rip webpages, and clean them for pinecone
A collection of tools to rip webpages, and clean them for pinecone - Sstobo/Site-Sn33k
PEP 712 – Adding a “converter” parameter to dataclasses.field
https://peps.python.org/pep-0712/
/r/Python
https://redd.it/12x4rth
https://peps.python.org/pep-0712/
/r/Python
https://redd.it/12x4rth
Python Enhancement Proposals (PEPs)
PEP 712 – Adding a “converter” parameter to dataclasses.field | peps.python.org
PEP 557 added dataclasses to the Python stdlib. PEP 681 added dataclass_transform() to help type checkers understand several common dataclass-like libraries, such as attrs, Pydantic, and object relational mapper (ORM) packages such as SQLAlchemy and Dja...
🚀 Boost Your Python Code Performance: Essential Tips & Techniques
Hey fellow Python enthusiasts! I've just written a comprehensive guide on optimizing Python code for better performance. In this article, I cover everything from understanding Python's execution model and profiling your code, to leveraging parallel programming and powerful external libraries like NumPy and Pandas.
I believe these tips and techniques will be valuable for anyone looking to enhance the efficiency of their Python projects. Whether you're a beginner or an experienced developer, you'll find something useful in this guide.
Check out the full article here: https://danielbuilescu.com/blogs/learn-python/python-performance-optimization-tips-and-techniques-for-faster-more-efficient-code
Let me know your thoughts and if you have any other tips or tricks for optimizing Python code! Happy coding! 🐍
/r/Python
https://redd.it/12x76vj
Hey fellow Python enthusiasts! I've just written a comprehensive guide on optimizing Python code for better performance. In this article, I cover everything from understanding Python's execution model and profiling your code, to leveraging parallel programming and powerful external libraries like NumPy and Pandas.
I believe these tips and techniques will be valuable for anyone looking to enhance the efficiency of their Python projects. Whether you're a beginner or an experienced developer, you'll find something useful in this guide.
Check out the full article here: https://danielbuilescu.com/blogs/learn-python/python-performance-optimization-tips-and-techniques-for-faster-more-efficient-code
Let me know your thoughts and if you have any other tips or tricks for optimizing Python code! Happy coding! 🐍
/r/Python
https://redd.it/12x76vj
Sharing: Converting drawings into 3D animation; a deep dive into the Python modules behind ShapeMeshing
Hi everyone. I want to share with you a set of Python modules I built in 2019 for converting 2D animation into 3D animation. Originally developed for the short film The Peak, this technology that transforms Flash-generated content into 3D data has since evolved and been deployed to multiple animation productions around the world.
This system has been featured at SIGGRAPH, CGWORLD, Cartoon Brew, Animation World Network, UNITE Tokyo, CEDEC and others - now is the first time the inner workings of the modules are being revealed. I invite you to watch the two videos below, and I hope you find it useful and entertaining. (Subtitles are available in English and Japanese)
Introduction : https://www.youtube.com/watch?v=c4GzniN7STQ
Advanced : https://www.youtube.com/watch?v=rIePFFwRYow
You can read more here
/r/Python
https://redd.it/12wxfb0
Hi everyone. I want to share with you a set of Python modules I built in 2019 for converting 2D animation into 3D animation. Originally developed for the short film The Peak, this technology that transforms Flash-generated content into 3D data has since evolved and been deployed to multiple animation productions around the world.
This system has been featured at SIGGRAPH, CGWORLD, Cartoon Brew, Animation World Network, UNITE Tokyo, CEDEC and others - now is the first time the inner workings of the modules are being revealed. I invite you to watch the two videos below, and I hope you find it useful and entertaining. (Subtitles are available in English and Japanese)
Introduction : https://www.youtube.com/watch?v=c4GzniN7STQ
Advanced : https://www.youtube.com/watch?v=rIePFFwRYow
You can read more here
/r/Python
https://redd.it/12wxfb0
YouTube
[4K]THE PEAK
●受賞作品に選出いただきました!(2020/10/15時点)
*Overmountain Animation Festival…Best of Professional Award/アメリカ
https://overmountainanimation.com/winners-gallery
*Imagination Lunchbox International Children’s Film Festival..Festival Choice/アメリカ
https://www.imaginat…
*Overmountain Animation Festival…Best of Professional Award/アメリカ
https://overmountainanimation.com/winners-gallery
*Imagination Lunchbox International Children’s Film Festival..Festival Choice/アメリカ
https://www.imaginat…
what is the best way to deploy to a server safely?
is deploying with docker the best way to deploy from your computer to a digital ocean instance?
the reason I ask is because I noticed that when I deploy my code just by pulling it from github on the server and try to pip install everything I often end up with packages that don't have equivalence in ubuntu or package clashes or things that I did not foresee happening when I was deploying and I have to figure them out and fix them in the instance.
I think if I add docker to my projects it would just add another layer of complexity to debug, but I dont know how else to make deployment easy and simple so it always works.
I dont want to use heroku either because they charge an arm and a leg.
anyone have any ideas?
/r/django
https://redd.it/12x5l7o
is deploying with docker the best way to deploy from your computer to a digital ocean instance?
the reason I ask is because I noticed that when I deploy my code just by pulling it from github on the server and try to pip install everything I often end up with packages that don't have equivalence in ubuntu or package clashes or things that I did not foresee happening when I was deploying and I have to figure them out and fix them in the instance.
I think if I add docker to my projects it would just add another layer of complexity to debug, but I dont know how else to make deployment easy and simple so it always works.
I dont want to use heroku either because they charge an arm and a leg.
anyone have any ideas?
/r/django
https://redd.it/12x5l7o
Reddit
r/django on Reddit: what is the best way to deploy to a server safely?
Posted by u/warrior242 - 10 votes and 7 comments
Do you guys use Chat GPT to code? If so, what do you make?
I have been completely blown away with chat GPT. I'm basically a noob, but I am curious how common it is amongst serious coders. Also what kind of stuff are you guys creating with chat GPT? I've created a few programs that I am really proud of, and that I don't think I ever would've been able to code myself. I have noticed that chat GPT makes a lot of mistakes though, and I actually stayed up till like six in the morning one night trying to get it to write something correctly and it never did… I'm sure if I was a better coder I'd be better at correcting chat GPT... But it is still pretty amazing.
/r/Python
https://redd.it/12wsx2g
I have been completely blown away with chat GPT. I'm basically a noob, but I am curious how common it is amongst serious coders. Also what kind of stuff are you guys creating with chat GPT? I've created a few programs that I am really proud of, and that I don't think I ever would've been able to code myself. I have noticed that chat GPT makes a lot of mistakes though, and I actually stayed up till like six in the morning one night trying to get it to write something correctly and it never did… I'm sure if I was a better coder I'd be better at correcting chat GPT... But it is still pretty amazing.
/r/Python
https://redd.it/12wsx2g
Reddit
r/Python on Reddit: Do you guys use Chat GPT to code? If so, what do you make?
Posted by u/holymountaincacti - 33 votes and 101 comments
Swagger for Django api
Hi, I’m building a basic api while learning the Django framework and wanted to know how to add swagger to document it. Almost all tutorials I see has a reference to the Django test framework, but I’m building a small api that just returns a json. Can somebody provide some insight into this or point me in the right direction?
/r/django
https://redd.it/12x52sd
Hi, I’m building a basic api while learning the Django framework and wanted to know how to add swagger to document it. Almost all tutorials I see has a reference to the Django test framework, but I’m building a small api that just returns a json. Can somebody provide some insight into this or point me in the right direction?
/r/django
https://redd.it/12x52sd
Reddit
r/django on Reddit: Swagger for Django api
Posted by u/godspeedone - 3 votes and 4 comments
Is it possible to make multiple Django apps a single project run on separate ports instead of paths?
/r/django
https://redd.it/12xp61x
/r/django
https://redd.it/12xp61x
Reddit
r/django on Reddit: Is it possible to make multiple Django apps a single project run on separate ports instead of paths?
Posted by u/approaching77 - No votes and 1 comment
Help solving IOPub data rate error
I received an 'IOPub message rate exceeded" error when running a built-in trackpy function. All information online says "the problem was fixed when launching jupyter with "jupyter notebook --NotebookApp.iopub_data_rate_limit=10000000". What does this mean? How do I do this? (I have zero knowledge of jupyter but I have to use it for a project)
I tried to run it from CMD but it just said that jupyter is not recognised as an internal or external command etc...
I'm using jupyter through anaconda 3.
/r/JupyterNotebooks
https://redd.it/12xpsfm
I received an 'IOPub message rate exceeded" error when running a built-in trackpy function. All information online says "the problem was fixed when launching jupyter with "jupyter notebook --NotebookApp.iopub_data_rate_limit=10000000". What does this mean? How do I do this? (I have zero knowledge of jupyter but I have to use it for a project)
I tried to run it from CMD but it just said that jupyter is not recognised as an internal or external command etc...
I'm using jupyter through anaconda 3.
/r/JupyterNotebooks
https://redd.it/12xpsfm
Reddit
r/JupyterNotebooks on Reddit: Help solving IOPub data rate error
Posted by u/bloobybloob96 - 1 vote and no comments
Is it just me or are the docs for sqlalchemy a f*cking nightmare?
Granted, I have little to no experience when it comes to working with databases, but the docs for sqlalchemy are so god damn convoluted and the lingo is way too abstract. Perhaps someone can recommend a good in-depth tutorial?
/r/Python
https://redd.it/12xrvwz
Granted, I have little to no experience when it comes to working with databases, but the docs for sqlalchemy are so god damn convoluted and the lingo is way too abstract. Perhaps someone can recommend a good in-depth tutorial?
/r/Python
https://redd.it/12xrvwz
Reddit
r/Python on Reddit: Is it just me or are the docs for sqlalchemy a f*cking nightmare?
Posted by u/EntropyGoAway - 147 votes and 50 comments
I built a leaderboard creator app
Try this fully functional leaderboard maker app here, https://www.maketheboard.com/. Built with Python & Flask (obviously), SQLAlchemy, and JavaScript with the simple bootstrap frontend.
The next step is to add Google AdSense and create the paid plans, which are already modeled out. Finished it in December and honestly forgot about it but I am getting tons of emails from Google search console that it is finally ranking lol.
I am open to answering any questions that any beginners may have
/r/flask
https://redd.it/12xsxb1
Try this fully functional leaderboard maker app here, https://www.maketheboard.com/. Built with Python & Flask (obviously), SQLAlchemy, and JavaScript with the simple bootstrap frontend.
The next step is to add Google AdSense and create the paid plans, which are already modeled out. Finished it in December and honestly forgot about it but I am getting tons of emails from Google search console that it is finally ranking lol.
I am open to answering any questions that any beginners may have
/r/flask
https://redd.it/12xsxb1
Maketheboard
Free Online Leaderboard and Scoreboard Creator
Create and share free online leaderboards in seconds with MakeTheBoard. Ideal for classrooms, competitions, offices, and more. No signup or install needed.