PEP 554 -- Multiple Interpreters in the Stdlib
https://www.python.org/dev/peps/pep-0554/
/r/Python
https://redd.it/6yp7kv
https://www.python.org/dev/peps/pep-0554/
/r/Python
https://redd.it/6yp7kv
Python REST API with Flask
https://sourcedexter.com/python-rest-api-flask/
/r/Python
https://redd.it/6ytpcd
https://sourcedexter.com/python-rest-api-flask/
/r/Python
https://redd.it/6ytpcd
Source Dexter
Python REST API with Flask - Source Dexter
This article introduces beginners to creating Python REST API with the Flask framework. It is a simple to use framework to exposing app services on the web
Functional linked lists in Python
https://dbader.org/blog/functional-linked-lists-in-python
/r/Python
https://redd.it/6ytmey
https://dbader.org/blog/functional-linked-lists-in-python
/r/Python
https://redd.it/6ytmey
dbader.org
Functional linked lists in Python – dbader.org
Linked lists are fundamental data structures that every programmer should know. This article explains how to implement a simple linked list data type in Python using a functional programming style.
[AF] How to display a Tree-data structure.
The Title already says almost everything.
I got this simple Tree Data structure where there are nodes and edges and want to display them. I don t know if it s possible to do this with jinja2 or some Flask Framework, could not find anything with google.
Any help, even knowing that it s not possible with Flask to do that, is appreciated
/r/flask
https://redd.it/6ytp97
The Title already says almost everything.
I got this simple Tree Data structure where there are nodes and edges and want to display them. I don t know if it s possible to do this with jinja2 or some Flask Framework, could not find anything with google.
Any help, even knowing that it s not possible with Flask to do that, is appreciated
/r/flask
https://redd.it/6ytp97
reddit
[AF] How to display a Tree-data structure. • r/flask
The Title already says almost everything. I got this simple Tree Data structure where there are nodes and edges and want to display them. I don...
A utility for organizing your downloads directory
https://github.com/chriscz/pysorter
/r/Python
https://redd.it/6yttvj
https://github.com/chriscz/pysorter
/r/Python
https://redd.it/6yttvj
GitHub
chriscz/pysorter
pysorter - A command line utility for organizing files and directories according to regex patterns.
Python Namesilo module
Hello,
I'm developing Python module (api wrapper) for [Namesilo service](https://www.namesilo.com/api_reference.php). It's open source and it's my first module in Python. I'm looking for some advice what to improve, what am I doing wrong or right. You can find module on my github [python-namesilo](https://github.com/goranvrbaski/python-namesilo)
Thanks!
/r/Python
https://redd.it/6yuiai
Hello,
I'm developing Python module (api wrapper) for [Namesilo service](https://www.namesilo.com/api_reference.php). It's open source and it's my first module in Python. I'm looking for some advice what to improve, what am I doing wrong or right. You can find module on my github [python-namesilo](https://github.com/goranvrbaski/python-namesilo)
Thanks!
/r/Python
https://redd.it/6yuiai
NameSilo
Search, Register & Manage Domains programmatically with our Domain API | NameSilo
Manage, search, and register domains effortlessly with NameSilo’s Domain API. Simplify your domain tasks programmatically.
The gamification package Django has been missing
https://github.com/mattjegan/django-gamification
/r/django
https://redd.it/6yu953
https://github.com/mattjegan/django-gamification
/r/django
https://redd.it/6yu953
GitHub
GitHub - mattjegan/django-gamification: The missing Django Gamification Package
The missing Django Gamification Package. Contribute to mattjegan/django-gamification development by creating an account on GitHub.
PyNomaly: outlier / anomaly detection using Local Outlier Probabilities (LoOP)
Hi all! I've been lurking on this sub for a little while now and thought I'd post a side project I have been working on. It's called PyNomaly, which uses Local Outlier Probabilities (LoOP) to score individual data points on the probability that they are an outlier. You can check it out [here](https://github.com/vc1492a/PyNomaly).
I'm looking for some feedback and folks that could try it out, do some testing and open some issues if there are any. Would appreciate some feedback from the community so I can improve the package! I hope some of you find it useful.
/r/pystats
https://redd.it/6yvu6m
Hi all! I've been lurking on this sub for a little while now and thought I'd post a side project I have been working on. It's called PyNomaly, which uses Local Outlier Probabilities (LoOP) to score individual data points on the probability that they are an outlier. You can check it out [here](https://github.com/vc1492a/PyNomaly).
I'm looking for some feedback and folks that could try it out, do some testing and open some issues if there are any. Would appreciate some feedback from the community so I can improve the package! I hope some of you find it useful.
/r/pystats
https://redd.it/6yvu6m
GitHub
GitHub - vc1492a/PyNomaly: Anomaly detection using LoOP: Local Outlier Probabilities, a local density based outlier detection method…
Anomaly detection using LoOP: Local Outlier Probabilities, a local density based outlier detection method providing an outlier score in the range of [0,1]. - vc1492a/PyNomaly
PEP 556 -- Threaded garbage collection
https://www.python.org/dev/peps/pep-0556/
/r/Python
https://redd.it/6yvea0
https://www.python.org/dev/peps/pep-0556/
/r/Python
https://redd.it/6yvea0
Python.org
PEP 556 -- Threaded garbage collection
The official home of the Python Programming Language
Paco - a coroutine-based library for concurrent programming based on asyncio with a clean api
I just wanted to give a shout-out to what I think is an excellent library that deserves more attention.
Utilizing the stdlib's asyncio module but providing a clean, functional api on top of it is a dream.
I highly recommend people take a look
https://github.com/h2non/paco
/r/Python
https://redd.it/6yx16r
I just wanted to give a shout-out to what I think is an excellent library that deserves more attention.
Utilizing the stdlib's asyncio module but providing a clean, functional api on top of it is a dream.
I highly recommend people take a look
https://github.com/h2non/paco
/r/Python
https://redd.it/6yx16r
GitHub
GitHub - h2non/paco: Small utility library for coroutine-driven asynchronous generic programming in Python
Small utility library for coroutine-driven asynchronous generic programming in Python - h2non/paco
Show r/python: wav2vec, a script/package for converting wave files to vector graphics
https://github.com/cristoper/wav2vec
/r/Python
https://redd.it/6yy2iq
https://github.com/cristoper/wav2vec
/r/Python
https://redd.it/6yy2iq
GitHub
GitHub - cristoper/wav2vec: Python package and cli tool to convert wave files (WAV or AIFF) to vector graphics (SVG, PostScript…
Python package and cli tool to convert wave files (WAV or AIFF) to vector graphics (SVG, PostScript, CVS) - cristoper/wav2vec
How to Generate FiveThirtyEight Graphs in Python
https://www.dataquest.io/blog/making-538-plots/
/r/Python
https://redd.it/6yxw95
https://www.dataquest.io/blog/making-538-plots/
/r/Python
https://redd.it/6yxw95
Dataquest
How to Generate FiveThirtyEight Graphs in Python – Dataquest
Impressed by the graphs on popular site FiveThirtyEight? This quick tutorial gets you started making your own eye-catching visualizations.
beginners guide
iam looking for a pdf to learn python iam using rasberry pi 3+.It comes with two software packages python 2.7.9 and python3.4.2
Thanks for any tips
/r/Python
https://redd.it/6z0ccr
iam looking for a pdf to learn python iam using rasberry pi 3+.It comes with two software packages python 2.7.9 and python3.4.2
Thanks for any tips
/r/Python
https://redd.it/6z0ccr
reddit
beginners guide • r/Python
iam looking for a pdf to learn python iam using rasberry pi 3+.It comes with two software packages python 2.7.9 and python3.4.2 Thanks for any tips
Help generating a form to fill out user profiles
Hello,
I'm building a user profile page in my django app and I have the user info in the database already. I extended the base User model with a OneToOneField like so:
**models.py**:
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
location = models.CharField(max_length=30, blank=True)
birthdate = models.DateField(null=True, blank=True)
...
# A few other custom fields
def __str__(self): # __unicode__ for Python 2
return self.user.username
Now I'm trying to give users the ability to edit their profiles so I created a form:
**forms.py**:
from django import forms
from models import UserProfile
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
exclude = ['user']
# I excluded 'user' because it renders as a dropdown with all the usernames from the database lol
I can place it in my profileUpdate.html template just fine, however I want to give users the ability to modify their first/last name from the User object but those items come from a different model. So, simple question I hope: how do I get the first/last name and email from the regular old django User model to be editable in this profile form? I wanted to use the model to generate the form so that I could use django's built in form validation.
If you need any more info please let me know. Thanks! :)
/r/django
https://redd.it/6z0l64
Hello,
I'm building a user profile page in my django app and I have the user info in the database already. I extended the base User model with a OneToOneField like so:
**models.py**:
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
location = models.CharField(max_length=30, blank=True)
birthdate = models.DateField(null=True, blank=True)
...
# A few other custom fields
def __str__(self): # __unicode__ for Python 2
return self.user.username
Now I'm trying to give users the ability to edit their profiles so I created a form:
**forms.py**:
from django import forms
from models import UserProfile
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
exclude = ['user']
# I excluded 'user' because it renders as a dropdown with all the usernames from the database lol
I can place it in my profileUpdate.html template just fine, however I want to give users the ability to modify their first/last name from the User object but those items come from a different model. So, simple question I hope: how do I get the first/last name and email from the regular old django User model to be editable in this profile form? I wanted to use the model to generate the form so that I could use django's built in form validation.
If you need any more info please let me know. Thanks! :)
/r/django
https://redd.it/6z0l64
reddit
Help generating a form to fill out user profiles • r/django
Hello, I'm building a user profile page in my django app and I have the user info in the database already. I extended the base User model with a...
Looking for advice on writing custom Django roles
Hello,
I need to build custom Django user roles, and i need an advise on the best approach (or library that i can use) to achieve that:
1. There will be 3 different user levels:
* Author
* Editor
* Verification
2. Every user must be limited to a city, based on custom field (New York, Berlin, Amsterdam, etc)
3. Only ‘Author’ can add content, while ‘Editor’ and ‘Verification’ can edit the content.
4. Author: Can only view/edit the content created by them.
5. Editor: Can only view/edit the content created by ‘Author’s in their cities.
6. Verification: Can only view/edit the content created by the ‘Editor’s in their cities.
7. Author: When creates content, should have the options to:
* Save as draft
* Send to Editor
8. Editor: When edits content, should have the options to:
* Send back to Author
* Send to Verification
9. Verification: When edits content, should have the options to:
* Send back to the Editor
* Mark as Verified.
**Scenario**
An admin creates the following users:
Username|Role|City|Content titles written by the user
:--|:--|:--|:--
John|Author|New York|Test1, Test2, Test3
Sam|Author|New York|Test4, Test5, Test6
Kim|Author|Berlin|Test7, Test8, Test9
Adam|Editor|New York
Alex|Editor|Berlin
Stacey|Verification|New York
Anthony|Verification|Berlin
Based on the above scenario, the Authors below should be able to access only the titles they created; Additionally:
* Adam: Should be able to view/edit the titles: Test1 - Test6 (Since they were written by 2 Authors in his City.
* Alex: Should be able to view/edit the titles: Test7 - Test9 (Since they were written by Kim, which in his city)
The same applies for the Verification.
Finally, If Author sent the content to Editor, the Author should no longer be able to edit the content, until it’s sent back to him by the Editor.
/r/django
https://redd.it/6z1oj4
Hello,
I need to build custom Django user roles, and i need an advise on the best approach (or library that i can use) to achieve that:
1. There will be 3 different user levels:
* Author
* Editor
* Verification
2. Every user must be limited to a city, based on custom field (New York, Berlin, Amsterdam, etc)
3. Only ‘Author’ can add content, while ‘Editor’ and ‘Verification’ can edit the content.
4. Author: Can only view/edit the content created by them.
5. Editor: Can only view/edit the content created by ‘Author’s in their cities.
6. Verification: Can only view/edit the content created by the ‘Editor’s in their cities.
7. Author: When creates content, should have the options to:
* Save as draft
* Send to Editor
8. Editor: When edits content, should have the options to:
* Send back to Author
* Send to Verification
9. Verification: When edits content, should have the options to:
* Send back to the Editor
* Mark as Verified.
**Scenario**
An admin creates the following users:
Username|Role|City|Content titles written by the user
:--|:--|:--|:--
John|Author|New York|Test1, Test2, Test3
Sam|Author|New York|Test4, Test5, Test6
Kim|Author|Berlin|Test7, Test8, Test9
Adam|Editor|New York
Alex|Editor|Berlin
Stacey|Verification|New York
Anthony|Verification|Berlin
Based on the above scenario, the Authors below should be able to access only the titles they created; Additionally:
* Adam: Should be able to view/edit the titles: Test1 - Test6 (Since they were written by 2 Authors in his City.
* Alex: Should be able to view/edit the titles: Test7 - Test9 (Since they were written by Kim, which in his city)
The same applies for the Verification.
Finally, If Author sent the content to Editor, the Author should no longer be able to edit the content, until it’s sent back to him by the Editor.
/r/django
https://redd.it/6z1oj4
reddit
Looking for advice on writing custom Django roles • r/django
Hello, I need to build custom Django user roles, and i need an advise on the best approach (or library that i can use) to achieve that: 1....
Good Django training resources for experienced developers in other languages?
I'm having a hard time finding django training resources geared towards people who already have experience with other languages / frameworks such as PHP/Symfony or Ruby. Does anyone have any recommendations?
Paid or free courses / books are would be fine... But bonus if something covers building apis with DRF...
/r/django
https://redd.it/6z1jzp
I'm having a hard time finding django training resources geared towards people who already have experience with other languages / frameworks such as PHP/Symfony or Ruby. Does anyone have any recommendations?
Paid or free courses / books are would be fine... But bonus if something covers building apis with DRF...
/r/django
https://redd.it/6z1jzp
reddit
Good Django training resources for experienced... • r/django
I'm having a hard time finding django training resources geared towards people who already have experience with other languages / frameworks such...
Slack CLI for productive developers
I just released v2.0.0 of my [slack-cli](https://pypi.org/project/slack-cli/) python package. Comments are welcome!
(also, this is my first ever reddit post \o/)
EDIT: missing link damn it
/r/Python
https://redd.it/6z1jt3
I just released v2.0.0 of my [slack-cli](https://pypi.org/project/slack-cli/) python package. Comments are welcome!
(also, this is my first ever reddit post \o/)
EDIT: missing link damn it
/r/Python
https://redd.it/6z1jt3
PyPI
slack-cli
Slack CLI for productive developers
Trying to build a date based app
Hi guys,
I'm trying to build an app where I can consult all of my swimming sessions. Every time I go swimming I upload the data from the watch to a mariadb database, adding one column with the date of the session like 2017-09-09.
Now I'm trying to build a django app where I can see the sessions organized by date. Like /2017/ shows all the sessions of this year, /2017/sep/ shows this month sessions, and /2017/sep/09 the data for this session.
This is my urls.py
url(r'^(?P<year_slug>[0-9]{4})/$', views.by_year, name='by_year'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/$', views.by_month, name='by_month'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/(?P<day_slug>[\w-]+)/$', views.by_day, name='by_day'),
I already kind of made it, I added three ForeignKey to my sessions model, pointing to Year, Month, and Day. Then I added three column to the database and added the value for each one, like if it's in 2017 it will be a 1, if it's in 2018 it's gonna be a two, and so on for months and days.
I feel like this is far from optimal. Can't I do that by using the 2017-09-09 which is in the date column, instead of adding three tables to the database?
Or is there even a totally different way to achieve this? (I tried {Year,Month,Day}ArchiveView but I wasn't able to make my own queries (like to get the total distance for one month)
My second question is, even if I go that way, I'm able to display the total distance for august in 2017/08/ by using the month_slug, but how can I do that in /2017/ ? I mean I understand I can't use the month_slug, but since I have sessions classed by month using {% ifchanged %}, isn't it possible to display the total distance for each month ?
I would appreciate some help here, thanks in advance and sorry for the wall of text.
/r/django
https://redd.it/6z3qxs
Hi guys,
I'm trying to build an app where I can consult all of my swimming sessions. Every time I go swimming I upload the data from the watch to a mariadb database, adding one column with the date of the session like 2017-09-09.
Now I'm trying to build a django app where I can see the sessions organized by date. Like /2017/ shows all the sessions of this year, /2017/sep/ shows this month sessions, and /2017/sep/09 the data for this session.
This is my urls.py
url(r'^(?P<year_slug>[0-9]{4})/$', views.by_year, name='by_year'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/$', views.by_month, name='by_month'),
url(r'^(?P<year_slug>[0-9]{4})/(?P<month_slug>[\w-]+)/(?P<day_slug>[\w-]+)/$', views.by_day, name='by_day'),
I already kind of made it, I added three ForeignKey to my sessions model, pointing to Year, Month, and Day. Then I added three column to the database and added the value for each one, like if it's in 2017 it will be a 1, if it's in 2018 it's gonna be a two, and so on for months and days.
I feel like this is far from optimal. Can't I do that by using the 2017-09-09 which is in the date column, instead of adding three tables to the database?
Or is there even a totally different way to achieve this? (I tried {Year,Month,Day}ArchiveView but I wasn't able to make my own queries (like to get the total distance for one month)
My second question is, even if I go that way, I'm able to display the total distance for august in 2017/08/ by using the month_slug, but how can I do that in /2017/ ? I mean I understand I can't use the month_slug, but since I have sessions classed by month using {% ifchanged %}, isn't it possible to display the total distance for each month ?
I would appreciate some help here, thanks in advance and sorry for the wall of text.
/r/django
https://redd.it/6z3qxs
reddit
Trying to build a date based app • r/django
Hi guys, I'm trying to build an app where I can consult all of my swimming sessions. Every time I go swimming I upload the data from the watch to...
Detailed Flask Web Development Series
Hey guys,
I’ve been working on building a really detailed course around the Flask framework to get many beginners started with web development with Python.
Course Page: https://www.thecodewolf.com/courses/python-flask-web-development/
Here are the first few videos of the series, I’ve also have written tutorials with the videos as well:
* Overview & Installation
* [Video](https://youtu.be/Ty2qAlDsAxc)
* [Blog Post](https://www.thecodewolf.com/introduction-to-python-flask-web-development-overview-of-flask/)
* Hello World & Flask Application Structure
* [Video](https://youtu.be/OrTWfZpv0i0)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-hello-world-flask-application-structure/)
* Flask Templates, Jinja2 Tutorial, Bootstrap Integration, and Custom Error Pages
* [Video](https://youtu.be/0M74EGmqWIY)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-flask-templates-and-flask-bootstrap-integration/)
The next few videos and guides will be coming out in the next few days/weeks, and I’ll be releasing new content on a regular basis.
**My goal is to create the best foundational web development course with the Flask framework to get as many people started with Flask as a stepping stone in web development with Python.**
If you guys enjoy the content, I will also be working on a detailed series like this with Django as well.
Here are some of the following videos that will be coming up with the series:
* Web Forms with Flask
* Database Integrations with Flask
Then I will be working on content that will actually have you build a complete blog application with users, blog posts, and all sorts of other really cool stuff.
With the current content so far, I would love to hear some feedback as well.
~ CW
/r/Python
https://redd.it/6z5jkx
Hey guys,
I’ve been working on building a really detailed course around the Flask framework to get many beginners started with web development with Python.
Course Page: https://www.thecodewolf.com/courses/python-flask-web-development/
Here are the first few videos of the series, I’ve also have written tutorials with the videos as well:
* Overview & Installation
* [Video](https://youtu.be/Ty2qAlDsAxc)
* [Blog Post](https://www.thecodewolf.com/introduction-to-python-flask-web-development-overview-of-flask/)
* Hello World & Flask Application Structure
* [Video](https://youtu.be/OrTWfZpv0i0)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-hello-world-flask-application-structure/)
* Flask Templates, Jinja2 Tutorial, Bootstrap Integration, and Custom Error Pages
* [Video](https://youtu.be/0M74EGmqWIY)
* [Blog Post](https://www.thecodewolf.com/python-flask-web-development-flask-templates-and-flask-bootstrap-integration/)
The next few videos and guides will be coming out in the next few days/weeks, and I’ll be releasing new content on a regular basis.
**My goal is to create the best foundational web development course with the Flask framework to get as many people started with Flask as a stepping stone in web development with Python.**
If you guys enjoy the content, I will also be working on a detailed series like this with Django as well.
Here are some of the following videos that will be coming up with the series:
* Web Forms with Flask
* Database Integrations with Flask
Then I will be working on content that will actually have you build a complete blog application with users, blog posts, and all sorts of other really cool stuff.
With the current content so far, I would love to hear some feedback as well.
~ CW
/r/Python
https://redd.it/6z5jkx