Passing Python Array to Javascript
I have been struggling trying to pass a python array to javascript. Does anyone know how to do this?
/r/flask
https://redd.it/18b7br0
I have been struggling trying to pass a python array to javascript. Does anyone know how to do this?
/r/flask
https://redd.it/18b7br0
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Looking for some freelance hours
Hello everyone,
Currently looking to do some freelance hours.
Experience with:
Django
MySQL/PostgreSQL
Celery
Docker
Kubernetes
Cloud Deployment (GCP, AWS)
Also, experience with FastAPI, Javascript, PHP.
With Django, I've built multiple systems mainly serving as APIs to Web Apps (React, etc) or Mobile Apps.
I'm working as a CTO full time but looking to fill some free hours. PM me if you want more details.
Thank you
/r/django
https://redd.it/18b9wo4
Hello everyone,
Currently looking to do some freelance hours.
Experience with:
Django
MySQL/PostgreSQL
Celery
Docker
Kubernetes
Cloud Deployment (GCP, AWS)
Also, experience with FastAPI, Javascript, PHP.
With Django, I've built multiple systems mainly serving as APIs to Web Apps (React, etc) or Mobile Apps.
I'm working as a CTO full time but looking to fill some free hours. PM me if you want more details.
Thank you
/r/django
https://redd.it/18b9wo4
Reddit
From the django community on Reddit
Explore this post and more from the django community
Help regarding hosting a Flask API
So I made a flask API for a grocery store and using a SQLITE3 database at the moment, this application also has scheduled task with celery and caching both using redis as a cache manager base.
Now I want to host this API for learning purpose as being a student ( There also exists a VUE3 JS frontend application communicating with this API )
So can anyone tell me any good free or cheap hostings servers and also things which I should do to make the hosting hassle-free for me.
/r/flask
https://redd.it/183c4vt
So I made a flask API for a grocery store and using a SQLITE3 database at the moment, this application also has scheduled task with celery and caching both using redis as a cache manager base.
Now I want to host this API for learning purpose as being a student ( There also exists a VUE3 JS frontend application communicating with this API )
So can anyone tell me any good free or cheap hostings servers and also things which I should do to make the hosting hassle-free for me.
/r/flask
https://redd.it/183c4vt
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
It's Christmas day. You wake up, run to the tree, tear open the largest package with your name on it... FastAPI has added _____?
Long time FastAPI user, I have a lot of free time this Christmas and January and would love to make some contributions to it.
What are some things that the community / project would really benefit from. I would really like to give back to a project that has given me so much.
​
/r/Python
https://redd.it/18bkywh
Long time FastAPI user, I have a lot of free time this Christmas and January and would love to make some contributions to it.
What are some things that the community / project would really benefit from. I would really like to give back to a project that has given me so much.
​
/r/Python
https://redd.it/18bkywh
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
D Needle in a haystack experiment: Assistants API RAG beats GPT 4-Turbo & Llama Index at 4% of the cost
Ran an experiment comparing information retrieval performance between Open AI's Assistants API's RAG, GPT-4 Turbo (with context window stuffing) and Llama Index with GPT4.
I recently added a new document-oriented react hook to CopilotKit, made specifically to accommodate (potentially long-form) documents and wanted to get the best performance.
Got pretty striking results: The assistant's API beats Llama index in a big way in performance and is 25x cheaper than context window stuffing with GPT-4 Turbo.
​
accuracy performance
​
costs
Big takeaway when it comes to building with AI. Almost no one should be using context-window stuffing and Llama Index has a lot of catching up to do when it comes to RAG performance. Whatever OpenAI is using under the hood for RAG, has great performance.
The full article:
https://ai88.substack.com/p/rag-vs-context-window-in-gpt4-accuracy-cost
/r/MachineLearning
https://redd.it/18bivxa
Ran an experiment comparing information retrieval performance between Open AI's Assistants API's RAG, GPT-4 Turbo (with context window stuffing) and Llama Index with GPT4.
I recently added a new document-oriented react hook to CopilotKit, made specifically to accommodate (potentially long-form) documents and wanted to get the best performance.
Got pretty striking results: The assistant's API beats Llama index in a big way in performance and is 25x cheaper than context window stuffing with GPT-4 Turbo.
​
accuracy performance
​
costs
Big takeaway when it comes to building with AI. Almost no one should be using context-window stuffing and Llama Index has a lot of catching up to do when it comes to RAG performance. Whatever OpenAI is using under the hood for RAG, has great performance.
The full article:
https://ai88.substack.com/p/rag-vs-context-window-in-gpt4-accuracy-cost
/r/MachineLearning
https://redd.it/18bivxa
GitHub
GitHub - CopilotKit/CopilotKit: Build in-app AI chatbots 🤖, and AI-powered Textareas ✨, into react web apps.
Build in-app AI chatbots 🤖, and AI-powered Textareas ✨, into react web apps. - GitHub - CopilotKit/CopilotKit: Build in-app AI chatbots 🤖, and AI-powered Textareas ✨, into react web apps.
Wednesday Daily Thread: Beginner questions
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/18bqi1q
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/18bqi1q
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
How would you handle this model? Room with multiple beds but limit how many people can be assigned to room based to total beds.
I am creating an application to manage a barracks room. However, some rooms have 2 - 3 beds inside the 1 room. If I want to assign an occupant to each room, would it be best to create more than 1 room with the same room number? Currently I have it set so one room shows Bed Count, in hopes I could limit how many people can be assigned to a room. Now I am thinking of creating more than 1 room to total the number of beds.
​
Currently,
Room 123A has 3 beds.
In the DB I have 1 123A with a bed count of 3.
Thinking:
Room 123A has 3 beds
In the DB create 123A x 3.
​
/r/djangolearning
https://redd.it/18blnk9
I am creating an application to manage a barracks room. However, some rooms have 2 - 3 beds inside the 1 room. If I want to assign an occupant to each room, would it be best to create more than 1 room with the same room number? Currently I have it set so one room shows Bed Count, in hopes I could limit how many people can be assigned to a room. Now I am thinking of creating more than 1 room to total the number of beds.
​
Currently,
Room 123A has 3 beds.
In the DB I have 1 123A with a bed count of 3.
Thinking:
Room 123A has 3 beds
In the DB create 123A x 3.
​
/r/djangolearning
https://redd.it/18blnk9
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
I was curious how django keeps track of all my model classes...
Ever wondered what happens under the hood when you run
I wrote a short blog post with a short deep dive into the model detection mechanism. No magic wands, just a bit of metaclasses, the new method, and a dash of django.setup().
If you're curious but not looking for an epic saga, check out the post https://svemaraju.github.io/django-model-detection.html
/r/django
https://redd.it/18bmnzw
Ever wondered what happens under the hood when you run
python manage.py makemigrations in Django? I recently asked this to myself and went through the rabbit hole of reading the Django code base.I wrote a short blog post with a short deep dive into the model detection mechanism. No magic wands, just a bit of metaclasses, the new method, and a dash of django.setup().
If you're curious but not looking for an epic saga, check out the post https://svemaraju.github.io/django-model-detection.html
/r/django
https://redd.it/18bmnzw
sqlglot - Amazing SQL parsing library
Wanted to give sqlglot a shoutout as it saved me a ton of time.
I had a task that involved building a dependency graph by statically analyzing the relationship of MySQL views. Initially, I was using sqlparse to extract the dependencies from the SQL statements, but it required me to create an increasingly hacky recursive function. I kept encountering examples in our codebase that required more test cases and further updating.
Then I stumbled upon sqlglot, and the code reduced to just a few lines, working immediately. It was barely more complex than this:
from sqlglot import parseone, exp
for table in parseone(sqlstatement).findall(exp.Table):
print(table.name)
I'm surprised I hadn't heard of it before.
/r/Python
https://redd.it/18bprha
Wanted to give sqlglot a shoutout as it saved me a ton of time.
I had a task that involved building a dependency graph by statically analyzing the relationship of MySQL views. Initially, I was using sqlparse to extract the dependencies from the SQL statements, but it required me to create an increasingly hacky recursive function. I kept encountering examples in our codebase that required more test cases and further updating.
Then I stumbled upon sqlglot, and the code reduced to just a few lines, working immediately. It was barely more complex than this:
from sqlglot import parseone, exp
for table in parseone(sqlstatement).findall(exp.Table):
print(table.name)
I'm surprised I hadn't heard of it before.
/r/Python
https://redd.it/18bprha
GitHub
GitHub - tobymao/sqlglot: Python SQL Parser and Transpiler
Python SQL Parser and Transpiler. Contribute to tobymao/sqlglot development by creating an account on GitHub.
Pytest over Unittest
Hi all ,
I'd like to hear your opinions over when you have decided to use Pytest over Unittest as your testing framework for your projects and why.
I've personally never used Pytest but recently found it on a project I started to work on and I've been finding it interesting.
/r/Python
https://redd.it/18bjv0y
Hi all ,
I'd like to hear your opinions over when you have decided to use Pytest over Unittest as your testing framework for your projects and why.
I've personally never used Pytest but recently found it on a project I started to work on and I've been finding it interesting.
/r/Python
https://redd.it/18bjv0y
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Introducing Great Tables
Great Tables is a *great* new Python package that simplifies the process of making tabular data presentable for any sort of publication task. With Great Tables, you can easily use data from a Pandas or Polars DataFrame and turn it into a beautiful table that can be included in a notebook, a Quarto document, or exported as HTML.
We've been working hard on making this package as useful as possible, and we're excited to share it with you. The package (v0.1.0) is available on PyPI and can be installed with:
The documentation site at https://posit-dev.github.io/great-tables/articles/intro.html has a *Get Started* tutorial that will walk you through the basics of using the package. The API documentation is also available on the site and it is chock full of examples that'll show you how to use the various features of the package.
We want Great Tables to be really useful for your work and so we really value any and all feedback. Send us a note in https://github.com/posit-dev/great-tables/issues or https://github.com/posit-dev/great-tables/discussions anytime you like!
​
https://preview.redd.it/vwuu06h5ui4c1.png?width=988&format=png&auto=webp&s=50e381e692bc16775eb1f6a4f6de309d75048139
\-------
This was originally posted by Rich Iannone over at LinkedIn. He asked me to post this here.
/r/Python
https://redd.it/18biyrh
Great Tables is a *great* new Python package that simplifies the process of making tabular data presentable for any sort of publication task. With Great Tables, you can easily use data from a Pandas or Polars DataFrame and turn it into a beautiful table that can be included in a notebook, a Quarto document, or exported as HTML.
We've been working hard on making this package as useful as possible, and we're excited to share it with you. The package (v0.1.0) is available on PyPI and can be installed with:
pip install great_tables The documentation site at https://posit-dev.github.io/great-tables/articles/intro.html has a *Get Started* tutorial that will walk you through the basics of using the package. The API documentation is also available on the site and it is chock full of examples that'll show you how to use the various features of the package.
We want Great Tables to be really useful for your work and so we really value any and all feedback. Send us a note in https://github.com/posit-dev/great-tables/issues or https://github.com/posit-dev/great-tables/discussions anytime you like!
​
https://preview.redd.it/vwuu06h5ui4c1.png?width=988&format=png&auto=webp&s=50e381e692bc16775eb1f6a4f6de309d75048139
\-------
This was originally posted by Rich Iannone over at LinkedIn. He asked me to post this here.
/r/Python
https://redd.it/18biyrh
GitHub
posit-dev/great-tables
Make awesome display tables using Python. Contribute to posit-dev/great-tables development by creating an account on GitHub.
OpenCV 5, Support Non-Profit Open Source CV & AI
https://www.indiegogo.com/projects/opencv-5-support-non-profit-open-source-cv-ai#/
/r/Python
https://redd.it/18brttk
https://www.indiegogo.com/projects/opencv-5-support-non-profit-open-source-cv-ai#/
/r/Python
https://redd.it/18brttk
Indiegogo
OpenCV 5, Support Non-Profit Open Source CV & AI
The biggest ever release of the world's largest computer vision library. Support Open Source.
Can python/ipython be used to replace Bash?
I am a heavy Bash user, and curiosity has me trying to see if it's feasible to move completely to Python.
chsh -s $(which ipython3)
exec ipython3
I'm just taking my first baby steps, but how much can I expect it to act like a normal shell like in
(I did manually add ipython3 there, but unsure if that did anything.)
Since
If I try to put
TerminalIPythonApp WARNING | Unknown error in handling startup files:
File ~/.ipython/profiledefault/startup/startuppagefault.py:6
!ipython3 --profile pagefault
^
SyntaxError: invalid syntax
What is the proper way to ensure my custom profile gets loaded by default?
Finally, I'm having a lot of trouble with my custom layout. Would some of you mind helping me cheat my way through by sharing your custom
/r/IPython
https://redd.it/18bniyw
I am a heavy Bash user, and curiosity has me trying to see if it's feasible to move completely to Python.
chsh -s $(which ipython3)
exec ipython3
I'm just taking my first baby steps, but how much can I expect it to act like a normal shell like in
/etc/shells?(I did manually add ipython3 there, but unsure if that did anything.)
Since
.bashrc is no longer being read, I probably need a .ipythonrc or something, to setup my environment, but I don't know how to make sure it's read when a new terminal opens. Is there a Python equivalent to /etc/profile, /etc/rc.local etc... ?If I try to put
!ipython3 --profile=pagefault into ~/.ipython/profile_default/startup/startup_default.py I get:TerminalIPythonApp WARNING | Unknown error in handling startup files:
File ~/.ipython/profiledefault/startup/startuppagefault.py:6
!ipython3 --profile pagefault
^
SyntaxError: invalid syntax
What is the proper way to ensure my custom profile gets loaded by default?
Finally, I'm having a lot of trouble with my custom layout. Would some of you mind helping me cheat my way through by sharing your custom
ipython_config.py scripts?/r/IPython
https://redd.it/18bniyw
Reddit
From the IPython community on Reddit
Explore this post and more from the IPython community
Deciding which functions/routes should be async
I have an application powered by FastAPI with HTTP routes that call different internal functions, celery tasks, 3rd party APIs, and DB queries.
How should I decide what should be async? Also how should i manage the different normal/async functions? For example, I'm using Pymongo & Motor, should I make seperate classes for each?
/r/Python
https://redd.it/18c679a
I have an application powered by FastAPI with HTTP routes that call different internal functions, celery tasks, 3rd party APIs, and DB queries.
How should I decide what should be async? Also how should i manage the different normal/async functions? For example, I'm using Pymongo & Motor, should I make seperate classes for each?
/r/Python
https://redd.it/18c679a
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
How to Deploy a Python Flask app with Heroku
https://blog.appsignal.com/2023/12/06/how-to-deploy-a-python-flask-app-with-heroku.html
/r/flask
https://redd.it/18c5qg0
https://blog.appsignal.com/2023/12/06/how-to-deploy-a-python-flask-app-with-heroku.html
/r/flask
https://redd.it/18c5qg0
AppSignal Blog
How to Deploy a Python Flask app with Heroku | AppSignal Blog
Let's build a simple Flask app that is primed and ready to deploy to Heroku.
lockfiles for hatch projects
I'm a huge fan of using hatch to manage my Python projects. It lets me define my projects with a single
For all my projects I found myself regenerating manual lock files using complex shell commands with pip-compile to get a reproducible environments across devices using a custom
I came up with hatch-pip-compile \- it's a hatch plugin that connects your hatch-managed virtual environment to a lockfile managed with pip-compile. The plugin detects whether your environment or lockfile is out to date and automatically syncs them when needed - and it's fast!
It's completely configurable and easy to get started. After adding the last few features and settling on a stable configuration I finally feel like it's ready for a wider audience. I'm extremely proud of how it turned out and I'm excited to share it with the hatch-world. I hope you find it useful for your Python projects!
TL;DR check
/r/Python
https://redd.it/18cakmd
I'm a huge fan of using hatch to manage my Python projects. It lets me define my projects with a single
pyproject.toml file and define my extra environments and scripts (i.e testing / linting / docs). One big thing it's missing though is an integration with lockfiles.For all my projects I found myself regenerating manual lock files using complex shell commands with pip-compile to get a reproducible environments across devices using a custom
pre-install-command. I finally decided that instead of hacking together the same solution on all my projects I would build a plugin that handles this complexity for me.I came up with hatch-pip-compile \- it's a hatch plugin that connects your hatch-managed virtual environment to a lockfile managed with pip-compile. The plugin detects whether your environment or lockfile is out to date and automatically syncs them when needed - and it's fast!
It's completely configurable and easy to get started. After adding the last few features and settling on a stable configuration I finally feel like it's ready for a wider audience. I'm extremely proud of how it turned out and I'm excited to share it with the hatch-world. I hope you find it useful for your Python projects!
TL;DR check
/r/Python
https://redd.it/18cakmd
GitHub
GitHub - pypa/hatch: Modern, extensible Python project management
Modern, extensible Python project management. Contribute to pypa/hatch development by creating an account on GitHub.