Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9a5fd18
feat: Make default options ticked when page loads
doublevcodes Aug 11, 2021
667a13e
chore: Update django-simple-bulma from v2.1 to v2.4
doublevcodes Aug 12, 2021
07ba4f0
fix: Pin `psycopg2-binary` to v2.8.*
doublevcodes Aug 12, 2021
577dd08
feat: Center `Search` and `Clear Search` buttons
doublevcodes Aug 12, 2021
0d0ab20
feat: Add a source button to the resource boxes
doublevcodes Aug 12, 2021
f0676fe
lint: Add a NOQA for the N818 linting error
doublevcodes Aug 12, 2021
5b18052
chore: Split Topic column into two columns
doublevcodes Aug 13, 2021
cec38ec
chore: Add tag to resource boxes
doublevcodes Aug 14, 2021
2d232fc
chore: Finalise tag style
doublevcodes Aug 15, 2021
4d4411a
feat: Add select all button
doublevcodes Aug 16, 2021
4adf44b
fix: Make select all buttons for each individual column
doublevcodes Aug 16, 2021
a09b0b1
Align select all buttons to center of column
doublevcodes Aug 17, 2021
ea95c67
New Resource: vcokltfre's Discord bot tutorial.
swfarnsworth Aug 17, 2021
d2543b6
New Resource: vcokltfre's Discord bot tutorial.
swfarnsworth Aug 17, 2021
a960b3e
merge: Merge branch 'doublevcodes/smarter-resources/front-end' of htt…
doublevcodes Aug 17, 2021
c82ef04
Merge branch 'doublevcodes/smarter-resources/front-end' into swfarnsw…
swfarnsworth Aug 22, 2021
a267f33
Make video resource boxes consistent.
swfarnsworth Aug 22, 2021
d2c1fb3
Add nedbat's kindling projects.
swfarnsworth Aug 22, 2021
595b672
Make icon dict a constant; add project ideas icon.
swfarnsworth Aug 22, 2021
c994095
Use MappingProxyType to freeze non-private dictionaries.
swfarnsworth Aug 28, 2021
248698b
Make title for all resources a link.
swfarnsworth Aug 28, 2021
d89c65a
Rename `utils.py` to `resource_search.py`.
swfarnsworth Sep 3, 2021
990eeba
Drop -Option from {topic,type,etc}Option.
swfarnsworth Sep 4, 2021
94fa4c6
Make an asterisk in the URL a wildcard.
swfarnsworth Sep 4, 2021
affbac0
Delete `resources_resources_redirect`.
swfarnsworth Sep 5, 2021
54c9acf
Add `tutorial` and `video` tags for RealPython.
swfarnsworth Sep 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 131 additions & 93 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pydis_site/apps/api/models/bot/metricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]


class NotFound(Exception):
class NotFound(Exception): # noqa: N818
"""Raised when an entity cannot be found."""

pass
Expand Down
4 changes: 0 additions & 4 deletions pydis_site/apps/redirect/redirects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ resources_index_redirect:
original_path: pages/resources/
redirect_route: "resources:index"

resources_resources_redirect:
original_path: pages/resources/<str:category>/
redirect_route: "resources:resources"

# Events
events_index_redirect:
original_path: pages/events/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from functools import reduce
from operator import and_, or_
from pathlib import Path
from types import MappingProxyType

import yaml
from django.conf import settings
Expand All @@ -16,20 +17,28 @@ def _transform_name(resource_name: str) -> str:

RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources")

RESOURCES: dict[str, Resource] = {path.stem: yaml.safe_load(path.read_text()) for path
in RESOURCES_PATH.rglob("*.yaml")}
RESOURCES: MappingProxyType[str, Resource] = MappingProxyType({
path.stem: yaml.safe_load(path.read_text())
for path in RESOURCES_PATH.rglob("*.yaml")
})

RESOURCE_TABLE = {category: defaultdict(set) for category in (
_resource_table = {category: defaultdict(set) for category in (
"topics",
"payment_tiers",
"payment_tiers",
"complexity",
"type"
)}

for name, resource in RESOURCES.items():
for category, tags in resource['tags'].items():
for tag in tags:
RESOURCE_TABLE[category][_transform_name(tag)].add(name)
_resource_table[category][_transform_name(tag)].add(name)

# Freeze the resources table
RESOURCE_TABLE = MappingProxyType({
category: MappingProxyType(d)
for category, d in _resource_table.items()
})


def get_resources_from_search(search_categories: dict[str, set[str]]) -> list[Resource]:
Expand Down
5 changes: 1 addition & 4 deletions pydis_site/apps/resources/resources/adafruit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ description: Adafruit is an open-source electronics manufacturer
provide help with your projects,
and the Adafruit devs do all the CircuitPython Development right out in the open.
title_image: https://www.mouser.com/images/suppliers/logos/adafruit.png
title_url: https://discord.gg/adafruit
title_url: https://adafruit.com/
urls:
- icon: branding/discord
url: https://discord.gg/adafruit
color: blurple
- icon: regular/link
url: https://adafruit.com/
color: teal
tags:
topics:
- microcontrollers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ description: One of the best books out there for Python beginners. This book wil
the web, manipulating files and automating keyboard and mouse input. Ideal for an
office worker who wants to make himself more useful.
name: Automate the Boring Stuff with Python
title_url: https://automatetheboringstuff.com/
urls:
- icon: regular/book
url: https://automatetheboringstuff.com/
color: black
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python
color: goodreads-cream
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/byte_of_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ description: A free book on programming using the Python language.
It serves as a tutorial or guide to the Python language for a beginner audience.
If all you know about computers is how to save text files, then this is the book for you.
name: A Byte of Python
title_url: https://python.swaroopch.com/
urls:
- icon: regular/link
url: https://python.swaroopch.com/
color: teal
- icon: regular/book
url: http://www.lulu.com/shop/swaroop-c-h/a-byte-of-python/paperback/product-21142968.html
color: black
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/code_combat.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
description: Learn Python while gaming - an open-source project with thousands of
contributors, which teaches you Python through a deep, top-down RPG.
name: Code Combat
title_url: https://codecombat.com/
urls:
- icon: regular/link
url: https://codecombat.com/
color: teal
- icon: branding/github
url: https://github.com/codecombat/codecombat
color: black
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/corey_schafer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ description: 'Corey has a number of exceptionally high quality tutorial series
Check out his channel for more video series!
'
title_image: https://i.imgur.com/KIfWw3b.png
title_url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g
urls:
- icon: branding/youtube
url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g
color: youtube-red
- icon: regular/link
url: https://coreyms.com/
color: teal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ description: Data Science from Scratch is a good introduction to data science fo
started. While either edition of this book is useful for those with prior Python experience, complete beginners
should use the second edition, which contains more up-to-date code examples and better practices.
name: Data Science from Scratch
title_url: https://www.oreilly.com/library/view/data-science-from/9781492041122/
urls:
- icon: regular/link
url: https://www.oreilly.com/library/view/data-science-from/9781492041122/
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/en/book/show/52059715-data-science-from-scratch
color: goodreads-cream
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/effective_python.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
description: A book that gives 90 best practices for writing excellent Python. Great
for intermediates.
name: Effective Python
title_url: https://effectivepython.com/
urls:
- icon: regular/link
url: https://effectivepython.com/
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/48566725-effective-python
color: goodreads-cream
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/exercism.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ description: Level up your programming skills with more than 2600 exercises acro
where you can get your code reviewed for each solution you submit. The mentors will
give you insightful advice to make you a better programmer.
name: exercism.io
title_url: https://exercism.io/
urls:
- icon: regular/link
url: https://exercism.io/
color: teal
- icon: branding/github
url: https://github.com/exercism/python
color: black
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
description: A comprehensive Flask walkthrough that has you building a complete social
blogging application from scratch.
name: Flask Web Development
title_url: http://shop.oreilly.com/product/0636920031116.do
urls:
- icon: regular/link
url: http://shop.oreilly.com/product/0636920031116.do
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/18774655-flask-web-development
color: goodreads-cream
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/fluent_python.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
description: A veritable tome of intermediate and advanced Python information. A must-read
for any Python professional. By far the most recommended book for intermediates.
name: Fluent Python
title_url: https://www.oreilly.com/library/view/fluent-python/9781491946237/
urls:
- icon: regular/link
url: https://www.oreilly.com/library/view/fluent-python/9781491946237/
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/22800567-fluent-python
color: goodreads-cream
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
description: A best practice handbook for both novice and expert Python developers to the installation,
configuration, and usage of Python on a daily basis.
name: The Hitchhiker's Guide to Python
title_url: https://python-guide.org/
urls:
- icon: regular/link
url: https://python-guide.org/
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/28321007-the-hitchhiker-s-guide-to-python
color: goodreads-cream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ description: Inferential Thinking is the textbook for the <a href="http://data8.
It introduces you the fundamentals of both Data Science and Python at a level accessible to all.
It is available both through your browser and in PDF form.
name: Inferential Thinking
urls:
- icon: regular/link
url: https://inferentialthinking.com/chapters/intro
color: teal
title_url: https://inferentialthinking.com/chapters/intro
tags:
topics:
- data science
Expand Down
6 changes: 2 additions & 4 deletions pydis_site/apps/resources/resources/jetbrains_videos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ description: A collection of videos made by the PyCharm team at JetBrains on sub
Django, pytest and much more!<br><br>
Episodes of their "What does this package do?" series go over all sorts of libraries in Python
both in the standard library and from the community and give a video explanation of the key concepts.
name: JetBrains YouTube Channel
icon_image: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/JetBrains_Logo_2016.svg/1200px-JetBrains_Logo_2016.svg.png
icon_size: 50
title_image: https://resources.jetbrains.com/storage/products/pycharm/img/meta/pycharm_logo_300x300.png
urls:
- icon: branding/youtube
url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw
color: youtube-red
title_url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw
tags:
topics:
- general
Expand Down
6 changes: 2 additions & 4 deletions pydis_site/apps/resources/resources/jim_shaped_coding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ description: 'JimShapedCoding contains a set of YouTube tutorials covering thing
<li><a href="https://www.youtube.com/watch?v=qMrAFscMBBc&list=PLOkVupluCIjvORWaF4kG-sXLgbVemYpEi">Django tutorials</a></li>
</ul>
Check out his channel for more videos!'
name: JimShapedCoding
title_image: https://i.imgur.com/DlovZPf.png
urls:
- icon: branding/youtube
url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg
color: youtube-red
title_url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg
tags:
topics:
- general
Expand Down
5 changes: 1 addition & 4 deletions pydis_site/apps/resources/resources/microsoft.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
description: Microsoft Python is a Discord server for discussing all things relating to using Python with Microsoft products,
they have channels for Azure, VS Code, IoT, Data Science and much more!
title_image: https://1000logos.net/wp-content/uploads/2017/04/Microsoft-Logo.png
title_url: https://discord.gg/b8YJQPx
title_url: https://www.microsoft.com/en-us/boards/pycon2020.aspx
urls:
- icon: branding/discord
url: https://discord.gg/b8YJQPx
color: blurple
- icon: regular/link
url: https://www.microsoft.com/en-us/boards/pycon2020.aspx
color: teal
tags:
topics:
- general
Expand Down
8 changes: 4 additions & 4 deletions pydis_site/apps/resources/resources/microsoft_videos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ description: A trove of tutorials & guides for developers from Microsoft's Devel
</ul>
Microsoft's Python Development Team also runs a Discord Server for discussions of Python in the Microsoft ecosystem,
including Visual Studio Code and Azure.
title_image: http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2qVsJ?ver=3f74
name: Microsoft Developer
title_image: https://upload.wikimedia.org/wikipedia/commons/4/44/Microsoft_logo.svg
title_url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g
urls:
- icon: branding/youtube
url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g
color: youtube-red
- icon: branding/discord
url: https://aka.ms/python-discord
color: blurple
Expand All @@ -24,3 +23,4 @@ tags:
- beginner
type:
- video
- community
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/mission_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ description: Learn programming and Python while building a complete and awesome
images, and walk-throughs make this a pleasure to both read and follow along. Excellent
book for beginners.
name: Mission Python
title_url: https://www.sean.co.uk/books/mission-python/index.shtm
urls:
- icon: regular/link
url: https://www.sean.co.uk/books/mission-python/index.shtm
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/35545850-mission-python
color: goodreads-cream
Expand Down
14 changes: 14 additions & 0 deletions pydis_site/apps/resources/resources/netbats_project_ideas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: A repository of project ideas to help one apply what they're learning, maintained by Python
community member Ned Batchelder, known on Python Discord as nedbat.
name: Ned Batchelder's Kindling Projects
title_url: https://nedbatchelder.com/text/kindling.html
tags:
topics:
- general
payment_tiers:
- free
complexity:
- beginner
- intermediate
type:
- project ideas
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ description: '"Neural Networks From Scratch" is a book intended to teach you how
This is so you can go out and do new/novel things with deep learning as well as to become more successful with even more basic models.
This book is to accompany the usual free tutorial videos and sample code from youtube.com/sentdex.'
name: Neural Networks from Scratch in Python
title_url: https://nnfs.io/
urls:
- icon: regular/link
url: https://nnfs.io/
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/55927899-neural-networks-from-scratch-in-python
color: goodreads-cream
Expand Down
5 changes: 1 addition & 4 deletions pydis_site/apps/resources/resources/pallets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ description: The Pallets Projects develop Python libraries such as the Flask web
the Jinja templating library, and the Click command line toolkit. Join to discuss
and get help from the Pallets community.
title_image: https://i.imgur.com/sV9Ypdf.png
title_url: https://discord.gg/t6rrQZH
title_url: https://www.palletsprojects.com/
urls:
- icon: branding/discord
url: https://discord.gg/t6rrQZH
color: blurple
- icon: regular/link
url: https://www.palletsprojects.com/
color: teal
tags:
topics:
- web development
Expand Down
5 changes: 1 addition & 4 deletions pydis_site/apps/resources/resources/pyglet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ description: Pyglet is a powerful,
loading images and videos, and playing sounds and music. All of this with a friendly Pythonic API,
that's simple to learn and doesn't get in your way.
title_image: https://i.imgur.com/LfQwXUe.png
title_url: https://discord.gg/QXyegWe
title_url: http://pyglet.org/
urls:
- icon: branding/discord
url: https://discord.gg/QXyegWe
color: blurple
- icon: regular/link
url: http://pyglet.org/
color: teal
tags:
topics:
- user interface
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/python_cookbook.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
description: A book full of very smart problem-solving recipes for various Python topics,
including moving from Python 2 to Python 3.
name: Python Cookbook
title_url: http://shop.oreilly.com/product/0636920027072.do
urls:
- icon: regular/link
url: http://shop.oreilly.com/product/0636920027072.do
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/17152735-python-cookbook
color: goodreads-cream
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/python_crash_course.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ description: "This fast-paced, thorough introduction to programming with Python
a Space Invaders–inspired arcade game, a set of data visualizations with Python’s handy libraries,
and a simple web app you can deploy online."
name: Python Crash Course
title_url: https://nostarch.com/pythoncrashcourse2e
urls:
- icon: regular/link
url: https://nostarch.com/pythoncrashcourse2e
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/23241059-python-crash-course
color: goodreads-cream
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
description: It's our channel! We are slowly gathering content here directly related to Python,
description: It's our YouTube channel! We are slowly gathering content here directly related to Python,
our community and the events we host. Come check us out!
title_image: https://raw.githubusercontent.com/python-discord/branding/master/logos/logo_banner/logo_site_banner_dark_512.png
position: 2
urls:
- icon: branding/youtube
url: https://www.youtube.com/pythondiscord
color: youtube-red
title_url: https://www.youtube.com/pythondiscord
tags:
topics:
- general
Expand Down
4 changes: 1 addition & 3 deletions pydis_site/apps/resources/resources/python_tricks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ description: Full of useful Python tips, tricks and features. Get this if you ha
a good grasp of the basics and want to take your Python skills to the next level,
or are a experienced programmer looking to add to your toolbelt.
name: Python Tricks
title_url: https://realpython.com/products/python-tricks-book/
urls:
- icon: regular/link
url: https://realpython.com/products/python-tricks-book/
color: teal
- icon: branding/goodreads
url: https://www.goodreads.com/book/show/36990732-python-tricks
color: goodreads-cream
Expand Down
Loading