Time outs on the large files download.
Hello! I have flask + gunicorn + nginx. I wrote a simple app to fetch log files from a remote sever and zip and download. It works fine for files under 1gb. Some files are over 1gb or sometime 3-4gb, how can I send these files with out timing out. I have used gevent worker but it still does timeout. Please advise. Thanks.
/r/flask
https://redd.it/b7wts4
Hello! I have flask + gunicorn + nginx. I wrote a simple app to fetch log files from a remote sever and zip and download. It works fine for files under 1gb. Some files are over 1gb or sometime 3-4gb, how can I send these files with out timing out. I have used gevent worker but it still does timeout. Please advise. Thanks.
/r/flask
https://redd.it/b7wts4
reddit
r/flask - Time outs on the large files download.
2 votes and 2 comments so far on Reddit
[P] PyTorch implementation of "Incremental Network Quantization: Towards Lossless CNNs with Low-Precision Weights"
I found Incremental Network Quantization an interesting way to perform quantization aware training. However the original code is a modified version of the caffe source code and not that user friendly. I reimplemented it into a pytorch library that is easy to use.
Code: [https://github.com/Mxbonn/INQ-pytorch](https://github.com/Mxbonn/INQ-pytorch)
Original paper: [https://arxiv.org/abs/1702.03044](https://arxiv.org/abs/1702.03044)
/r/MachineLearning
https://redd.it/b817fz
I found Incremental Network Quantization an interesting way to perform quantization aware training. However the original code is a modified version of the caffe source code and not that user friendly. I reimplemented it into a pytorch library that is easy to use.
Code: [https://github.com/Mxbonn/INQ-pytorch](https://github.com/Mxbonn/INQ-pytorch)
Original paper: [https://arxiv.org/abs/1702.03044](https://arxiv.org/abs/1702.03044)
/r/MachineLearning
https://redd.it/b817fz
GitHub
GitHub - Mxbonn/INQ-pytorch: A PyTorch implementation of "Incremental Network Quantization: Towards Lossless CNNs with Low-Precision…
A PyTorch implementation of "Incremental Network Quantization: Towards Lossless CNNs with Low-Precision Weights" - GitHub - Mxbonn/INQ-pytorch: A PyTorch implementation of &qu...
Convert argparse to class syntax for Jupyter notebook execution
Hi, this script converts argparse to class syntax.
As Jupyter is not compatible with argparse. I hope it would be helpful for your testing.
web convert: [http://35.192.144.192:8000/arg2cls.html](http://35.192.144.192:8000/arg2cls.html)
/r/IPython
https://redd.it/b8c3gk
Hi, this script converts argparse to class syntax.
As Jupyter is not compatible with argparse. I hope it would be helpful for your testing.
web convert: [http://35.192.144.192:8000/arg2cls.html](http://35.192.144.192:8000/arg2cls.html)
/r/IPython
https://redd.it/b8c3gk
reddit
r/IPython - Convert argparse to class syntax for Jupyter notebook execution
0 votes and 0 comments so far on Reddit
I made this figure in python as a masters student and it's still my favorite
/r/Python
https://redd.it/b8buj2
/r/Python
https://redd.it/b8buj2
Huey task queue 2.0
Hello r/python. I've released a new version of [Huey](https://huey.readthedocs.io), a lightweight task queue. Huey is an alternative to celery, rq, etc, and offers a ton of functionality in a small package. Features:
* Easy to use: `@huey.task()`
* Redis or sqlite support built-in
* multi-process, multi-thread or greenlet task workers
* schedule tasks to run at a future time, or after a given delay
* schedule recurring tasks, like a crontab
* automatically retry tasks that fail
* task prioritization (new)
* result storage
* task locking
* task pipelines and chains
* optional django integration
I started this project about 7 or so years ago and am quite happy with how it's developed. The codebase is very small and self-contained, so it's hopefully very easy to use and understand. If you have any questions, feel free to ask and I'll do my best to answer.
[Changes in 2.0](https://huey.readthedocs.io/en/latest/changes.html), not to mention I rewrote most of the documentation for this release.
[Code](https://github.com/coleifer/huey)
/r/Python
https://redd.it/b8bkk2
Hello r/python. I've released a new version of [Huey](https://huey.readthedocs.io), a lightweight task queue. Huey is an alternative to celery, rq, etc, and offers a ton of functionality in a small package. Features:
* Easy to use: `@huey.task()`
* Redis or sqlite support built-in
* multi-process, multi-thread or greenlet task workers
* schedule tasks to run at a future time, or after a given delay
* schedule recurring tasks, like a crontab
* automatically retry tasks that fail
* task prioritization (new)
* result storage
* task locking
* task pipelines and chains
* optional django integration
I started this project about 7 or so years ago and am quite happy with how it's developed. The codebase is very small and self-contained, so it's hopefully very easy to use and understand. If you have any questions, feel free to ask and I'll do my best to answer.
[Changes in 2.0](https://huey.readthedocs.io/en/latest/changes.html), not to mention I rewrote most of the documentation for this release.
[Code](https://github.com/coleifer/huey)
/r/Python
https://redd.it/b8bkk2
Six easy ways to run your Jupyter Notebook in the cloud
https://www.dataschool.io/cloud-services-for-jupyter-notebook/
/r/Python
https://redd.it/b86ffs
https://www.dataschool.io/cloud-services-for-jupyter-notebook/
/r/Python
https://redd.it/b86ffs
Data School
Six easy ways to run your Jupyter Notebook in the cloud
Comparing free services for running an interactive Jupyter Notebook in the cloud: Binder, Kaggle Kernels, Google Colab, Azure Notebooks, CoCalc, Datalore.
Save Image in MongoDB with MongoEngine
Currently I am learning the mongoengine and just made the video for saving image files directly in MongoDB , wish you like it.
[https://youtu.be/PO-z4nwdMUs](https://youtu.be/PO-z4nwdMUs)
MongoEngine works very well with flask and mongodb! If you have any suggestion and questions, please leave the comment. I am very happy to know all of you. :)
/r/flask
https://redd.it/b88o0u
Currently I am learning the mongoengine and just made the video for saving image files directly in MongoDB , wish you like it.
[https://youtu.be/PO-z4nwdMUs](https://youtu.be/PO-z4nwdMUs)
MongoEngine works very well with flask and mongodb! If you have any suggestion and questions, please leave the comment. I am very happy to know all of you. :)
/r/flask
https://redd.it/b88o0u
YouTube
Use mongoengine save image into mongodb with python ( ImageField )
This video shows how to use mongoengine save the image files into the mongodb database.
programming language: python
programming language: python
How can I pass data between SelectMultipleFields?
**[UPDATE]**
After banging my head against this all weekend, I finally found the answer. The problem is that the default validators in `SelectMultipleField` don't actually work. If I replace `validate_on_submit` with `is_submitted`, the code runs. This version does what I want it to:
```
@streams_blueprint.route('/select', methods=['GET','POST'])
def select():
# Grab a selectable list of studies from database.
form = SelForm()
db_objects = [(stream.id, stream.name) for stream in Stream.objects()]
form.selections.choices = db_objects
if form.is_submitted():
form2 = SelForm()
selections = form.selections.data
new_objects = [(stream.id, stream.name) for stream in Stream.objects(id__in=selections)]
form2.selections.choices = new_objects
else:
form2 = SelForm()
return render_template('select_streams.html', form=form, form2=form2)
```
If I need validators, I will have to write custom ones for this field type.
**[ORIGINAL]**
I'm new to Flask and WTForms, and have been really struggling with this simple task. I want to display a list of options. The user can select multiple options, and then these choices generate a new
/r/flask
https://redd.it/b7gnhg
**[UPDATE]**
After banging my head against this all weekend, I finally found the answer. The problem is that the default validators in `SelectMultipleField` don't actually work. If I replace `validate_on_submit` with `is_submitted`, the code runs. This version does what I want it to:
```
@streams_blueprint.route('/select', methods=['GET','POST'])
def select():
# Grab a selectable list of studies from database.
form = SelForm()
db_objects = [(stream.id, stream.name) for stream in Stream.objects()]
form.selections.choices = db_objects
if form.is_submitted():
form2 = SelForm()
selections = form.selections.data
new_objects = [(stream.id, stream.name) for stream in Stream.objects(id__in=selections)]
form2.selections.choices = new_objects
else:
form2 = SelForm()
return render_template('select_streams.html', form=form, form2=form2)
```
If I need validators, I will have to write custom ones for this field type.
**[ORIGINAL]**
I'm new to Flask and WTForms, and have been really struggling with this simple task. I want to display a list of options. The user can select multiple options, and then these choices generate a new
/r/flask
https://redd.it/b7gnhg
reddit
r/flask - How can I pass data between SelectMultipleFields?
3 votes and 5 comments so far on Reddit
RPI 3 B+ Virtual ENV
I know what a VENV is and how it works but i dont get how i link my python script to the Env. Anybody who can explain?
/r/Python
https://redd.it/b8gwk3
I know what a VENV is and how it works but i dont get how i link my python script to the Env. Anybody who can explain?
/r/Python
https://redd.it/b8gwk3
reddit
r/Python - RPI 3 B+ Virtual ENV
0 votes and 0 comments so far on Reddit
Dynamic Dashboard stats with Flask, Redis and Postgres
I have an admin application that has a dashboard page with various statistics for our company. Basically our data is stored in Redis, and right now still thinking of a way to combine Postgres and Redis to work together as both our data store.
​
Any idea how I can update the dashboard dynamically? Say like every 5 minutes or depending on what we set, it doesn't have to be real time.
My thinking is that, I will run a background job that will pre aggregate data on redis and store that on Postgres for record, then when a user refreshes the dashboard or visits the dashboard, it will fetch the latest aggregated data from Postgres. Maybe use AJAX to update the dashboard periodically.
/r/Python
https://redd.it/b8hg7k
I have an admin application that has a dashboard page with various statistics for our company. Basically our data is stored in Redis, and right now still thinking of a way to combine Postgres and Redis to work together as both our data store.
​
Any idea how I can update the dashboard dynamically? Say like every 5 minutes or depending on what we set, it doesn't have to be real time.
My thinking is that, I will run a background job that will pre aggregate data on redis and store that on Postgres for record, then when a user refreshes the dashboard or visits the dashboard, it will fetch the latest aggregated data from Postgres. Maybe use AJAX to update the dashboard periodically.
/r/Python
https://redd.it/b8hg7k
reddit
r/Python - Dynamic Dashboard stats with Flask, Redis and Postgres
0 votes and 2 comments so far on Reddit
Django Signals
I want to create something in such a way that there will be a status(pending and confirmed option) on a user page. But when an admin verifies the documents submitted by the user it changes from pending to confirmed. How do you think I can go about implementing this functionality.
/r/django
https://redd.it/b8hohx
I want to create something in such a way that there will be a status(pending and confirmed option) on a user page. But when an admin verifies the documents submitted by the user it changes from pending to confirmed. How do you think I can go about implementing this functionality.
/r/django
https://redd.it/b8hohx
reddit
r/django - Django Signals
0 votes and 2 comments so far on Reddit
An engine for massive calculation complexities
I implemented this dependency graph [https://github.com/hosseinmoein/DependencyGraph](https://github.com/hosseinmoein/DependencyGraph) to facilitate implementing systems with massive and complex calculations that run in real-time. Examples are alpha and risk models in financial industry or modeling an ecosystem in natural sciences.
I appreciate your feedback and suggestions and would like to hear about how you have solved these kinds of problems.
/r/Python
https://redd.it/b8i8y6
I implemented this dependency graph [https://github.com/hosseinmoein/DependencyGraph](https://github.com/hosseinmoein/DependencyGraph) to facilitate implementing systems with massive and complex calculations that run in real-time. Examples are alpha and risk models in financial industry or modeling an ecosystem in natural sciences.
I appreciate your feedback and suggestions and would like to hear about how you have solved these kinds of problems.
/r/Python
https://redd.it/b8i8y6
GitHub
hosseinmoein/DependencyGraph
A very light weight dependency graph for systems with massive calculation complexities or scheduling systems - hosseinmoein/DependencyGraph
Markdown cells instead of Python comments?
I'm new to Jupyter. I code in Python and am wondering if there is a recommendation when to use Markdown cells and when to use comments in Python.
If I have comments in my Python code then why would I use Markdown cells as the purpose of both is to document what is going on.
Any best practice?
/r/IPython
https://redd.it/b8k98q
I'm new to Jupyter. I code in Python and am wondering if there is a recommendation when to use Markdown cells and when to use comments in Python.
If I have comments in my Python code then why would I use Markdown cells as the purpose of both is to document what is going on.
Any best practice?
/r/IPython
https://redd.it/b8k98q
reddit
r/IPython - Markdown cells instead of Python comments?
0 votes and 2 comments so far on Reddit
Aggregating just the code cells without the markdown cells
Once you have finalized your code and want to save from Jupyter notebook to a tradition python script file is there an easy way to copy / paste the code whilst ignoring the Markdown cells?
/r/IPython
https://redd.it/b8ksyn
Once you have finalized your code and want to save from Jupyter notebook to a tradition python script file is there an easy way to copy / paste the code whilst ignoring the Markdown cells?
/r/IPython
https://redd.it/b8ksyn
reddit
r/IPython - Aggregating just the code cells without the markdown cells
0 votes and 0 comments so far on Reddit
Accepting Payments with Stripe, Vue.js, and Flask
https://testdriven.io/blog/accepting-payments-with-stripe-vuejs-and-flask/
/r/flask
https://redd.it/b8ityt
https://testdriven.io/blog/accepting-payments-with-stripe-vuejs-and-flask/
/r/flask
https://redd.it/b8ityt
testdriven.io
Accepting Payments with Stripe, Vue.js, and Flask
This tutorial details how to develop a web app for selling products using Stripe, Vue.js, and Flask.
[P] Rock Paper Scissors with Artificial Intelligence
Hi! I've created a Rock-Paper-Scissors game that works with artificial intelligence (AI). The AI can see and detect your hand gestures by front-facing camera. Also it can learn your playing strategy in a smart way. The more you play, It gets harder to win!
This app uses TensorFlow and deep learning technologies in order to detect the hand gestures. Sometimes the gestures may not be properly detected, but this will improve in future versions. You can help me in this process by taking pictures of your hand in different positions and sending them as a zip file to rpsapp@outlook.com .
Please Note:
* To get best results in hand gestures detection, put your device on a flat and steady surface.
* In order for the app to work properly, your device should have decent camera and hardware to run relatively heavy calculations.
I've been working on developing this app for a year, so any feedback from you will be a pleasure for me :)
You can get the app on Google Play: https://play.google.com/store/apps/details?id=cc.ramtin.rps
And you can read more about it on XDA: https://www.xda-developers.com/play-rock-paper-scissors-hand-gestures-against-ai-bot/
/r/MachineLearning
https://redd.it/b8htjt
Hi! I've created a Rock-Paper-Scissors game that works with artificial intelligence (AI). The AI can see and detect your hand gestures by front-facing camera. Also it can learn your playing strategy in a smart way. The more you play, It gets harder to win!
This app uses TensorFlow and deep learning technologies in order to detect the hand gestures. Sometimes the gestures may not be properly detected, but this will improve in future versions. You can help me in this process by taking pictures of your hand in different positions and sending them as a zip file to rpsapp@outlook.com .
Please Note:
* To get best results in hand gestures detection, put your device on a flat and steady surface.
* In order for the app to work properly, your device should have decent camera and hardware to run relatively heavy calculations.
I've been working on developing this app for a year, so any feedback from you will be a pleasure for me :)
You can get the app on Google Play: https://play.google.com/store/apps/details?id=cc.ramtin.rps
And you can read more about it on XDA: https://www.xda-developers.com/play-rock-paper-scissors-hand-gestures-against-ai-bot/
/r/MachineLearning
https://redd.it/b8htjt
Google Play
Rock Paper Scissors with Artif - Apps on Google Play
Play RPS without touching the screen, versus Artificial Intelligence!
What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/b8jq2r
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/b8jq2r
reddit
r/Python - What's everyone working on this week?
6 votes and 30 comments so far on Reddit
I Wrote My First Python Package!
Just thought I'd share this: I've been working on a Python package that makes it easy to obtain and work with data from the USDA's Standard Reference Database for nutrient composition of different foods. I became interested in the USDA's API as it seems to be the standard for high-quality nutrition data -- it's used by many apps and it has data for \~160 different nutrients. My goal is to make the data much more accessible to developers.
Part of the package also has a feature which will tell you if you are meeting the Recommended Daily Amounts of each nutrient, so it could be helpful for nutritionists or people looking to improve their diet.
This is the first Python package I've made and I uploaded it to PyPI so it can be installed with pip. You can find the code here:
[https://github.com/noahtren/noms](https://github.com/noahtren/noms)
Thanks for checking it out, and please share any advice on how to make it better. :)
/r/Python
https://redd.it/b8ncrx
Just thought I'd share this: I've been working on a Python package that makes it easy to obtain and work with data from the USDA's Standard Reference Database for nutrient composition of different foods. I became interested in the USDA's API as it seems to be the standard for high-quality nutrition data -- it's used by many apps and it has data for \~160 different nutrients. My goal is to make the data much more accessible to developers.
Part of the package also has a feature which will tell you if you are meeting the Recommended Daily Amounts of each nutrient, so it could be helpful for nutritionists or people looking to improve their diet.
This is the first Python package I've made and I uploaded it to PyPI so it can be installed with pip. You can find the code here:
[https://github.com/noahtren/noms](https://github.com/noahtren/noms)
Thanks for checking it out, and please share any advice on how to make it better. :)
/r/Python
https://redd.it/b8ncrx
GitHub
GitHub - noahtren/noms: A fun and simple Python package that allows you to work with highly detailed nutrition data
A fun and simple Python package that allows you to work with highly detailed nutrition data - GitHub - noahtren/noms: A fun and simple Python package that allows you to work with highly detailed nu...
People with experience in Django: is it possible to make a web application with a server push feature?
It should be like this:
I have a Raspberry Pi, an Arduino nano connected to the raspberry and other Arduino nano that will communicate with the "central" one.
My central Arduino, the one connected to the raspberry, will receive messages from others and pass them forward to the serial port. My app needs to read this info and do something about it. It can just be ignored, stored, do something on the Arduino end or it can trigger a event in the app. This event should be like a window that pop in front of the web page telling what happened.
I'm aware of the existence of the channels library and the celery one, too. Although I'm not anywhere near sure if it can be pulled together.
So... Can it be done with django?
/r/django
https://redd.it/b8nm6b
It should be like this:
I have a Raspberry Pi, an Arduino nano connected to the raspberry and other Arduino nano that will communicate with the "central" one.
My central Arduino, the one connected to the raspberry, will receive messages from others and pass them forward to the serial port. My app needs to read this info and do something about it. It can just be ignored, stored, do something on the Arduino end or it can trigger a event in the app. This event should be like a window that pop in front of the web page telling what happened.
I'm aware of the existence of the channels library and the celery one, too. Although I'm not anywhere near sure if it can be pulled together.
So... Can it be done with django?
/r/django
https://redd.it/b8nm6b
reddit
r/django - People with experience in Django: is it possible to make a web application with a server push feature?
9 votes and 8 comments so far on Reddit