A reddit.com bot that will return reference links from official python documentation site for the standard library.

Overview

Pylint & flake8 CodeQL

Python Docs Bot

A reddit.com bot that will return documentation links for the library and language reference sections of the python docs website. The bot can also return links to python pep documentation. The bot monitors the r/learnpython subreddit's comments looking for its keyword. When found the bot will reply to the comment with the requested links to documentation.

Usage

Invoke the bot with !docs keyword

All you need to do is use the !docs keyword followed by a comma seperated list of search terms anywhere in your comment as long as it's on its own line.

Examples:

!docs os.path, pathlib.Path

Returns library reference documentation links to os.path and pathlib.Path.

!docs function, class

Returns python language reference links for function definitions and class definitions.

!docs while, input

Returns language reference for while statement and a library reference for the input function.

!docs pep-20, pep-8

Returns links to pep-20 "The Zen of Python" and pep-8 "Style Guide for Python Code"

Important

  • To prevent the bot from spamming posts, the bot will not reply if it clouldn't find a valid documentation link based on your search terms. It will silently ignore the request.

  • The keyword and search terms must be on its own line in your comment or it will be ignored by the bot.

  • Full method path is required and the paths are case sensitive for standard library references only (Correct: !docs pathlib.Path, Incorrect: !docs pathlib.path, or !docs Path). This is for a few reasons but the biggest one is that it allows the bot to include page anchors in the links. This way if someone is recommending Path from pathlib and sent them the link to pathlib library docs they would have to scroll through all the other methods searching for Path. Page anchors solve that.

    • Exceptions to needing the full method path:
      • You want to return python documentation for the entire module (Correct: !docs pathlib)
      • Built-in python functions like zip, map, filter, etc. because there is no chain for those functions (Correct: !docs filter).
  • Python language references are found by doing basically a keyword search against all the items on its index page (linked below). For example, !docs while would return a link to the language reference page titled "The while statement"

Refer to these links to see what the bot can return.

All links created and distributed by the bot link back to https://docs.python.org and https://www.python.org/dev/peps/ and no where else.

Full Example

Below is an example of how to use the bot. I have tried to make it super simple to use. If you are still unsure of how to use it you can checkout the bot's reddit profile and see how others have used the bot by reviewing the comments it has replied to.

Original Post:

How do I import a module that is not in the same directory as my script?

I cant figure out what I am doing wrong. Can anyone help point me in the right direction

Your Comment:

Python will check PYTHONPATH and the directory the script is in for imports. If it is not in those locations,  
you would need to do one of the following:  
    1) add it to PYTHONPATH  
    2) move it into the script directory  
    3) use relative imports  
  
You can use sys.path to add the directory to PATH so that python will check that directory for imports.  
  
!docs sys.path  

Bot's Reply to Your Comment:


sys.path - https://docs.python.org/3/library/sys.html#sys.path

Python Documentation Bot - How To Use

Owner
Trevor Miller
Trevor Miller
The records of 42 million users from a third-party version of the popular Telegram messaging app have just been Iranian accounts leaked

TelegramDatabase About The records of 42 million users from a third-party version of the popular Telegram messaging app have just been Iranian account

Hamed Mohammadvand 10 Jan 14, 2022
Userbot Telegram + Music Voice Chats. Dibuat Untuk Bersenang - Senang , Dan Mempermudah Kegiatan. Created By Rio.

RIO - USERBOT Disclaimer Saya tidak bertanggung jawab atas penyalahgunaan bot ini. Bot ini dimaksudkan untuk bersenang-senang sekaligus membantu Anda

RioProjectX 1 Nov 10, 2021
Throttle and debounce add-on for Pyrogram

pyrothrottle Throttle and debounce add-on for Pyrogram Quickstart implementation on decorators from pyrogram import Client, filters from pyrogram.type

7 Oct 01, 2022
A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

Hash Minner 3 Nov 27, 2021
A cool discord bot, called Fifi

Fifi A cool discord bot, called Fifi This bot is the official server bot of Meme Studios discord server. This github repo is the code we use for the b

Fifi Discord Bot 3 Jun 08, 2021
Python SDK for LUSID by FINBOURNE, a bi-temporal investment management data platform with portfolio accounting capabilities.

LUSID® Python SDK This is the Python SDK for LUSID by FINBOURNE, a bi-temporal investment management data platform with portfolio accounting capabilit

FINBOURNE 6 Dec 24, 2022
A Python API wrapper for the Twitter API!

PyTweet PyTweet is an api wrapper made for twitter using twitter's api version 2! Installation Windows py3 -m pip install PyTweet Linux python -m pip

TheFarGG 1 Nov 19, 2022
Shellkg-py - A temporary Repository to rewrite of shellpkg in python

Shellkg-py - A temporary Repository to rewrite of shellpkg in python

2 Jan 26, 2022
Mini Tool to lovers of debe from eksisozluk (one of the most famous website -reffered as collaborative dictionary like reddit- in Turkey) for pushing debe (Most Liked Entries of Yesterday) to kindle every day via Github Actions.

debe to kindle Mini Tool to lovers of debe from eksisozluk (one of the most famous website -refered as collaborative dictionary like reddit- in Turkey

11 Oct 11, 2022
Discord Webhook Proxy for Roblox payloads.

RoProxy A Discord webhook proxy passthrough for roblox. Setup Your port and endpoint are in the config.json, make sure both app.py and config.json are

PythonSerious 2 Nov 05, 2021
Ciclo 1 - MisiónTIC - UIS (Retos)

misiontic_uis Ciclo 1 - MisiónTIC - UIS Reto 1: Fundamentos del Lenguaje Python Reto 2: Estructuras de Control Condicional Reto 3: Estructuras de Cont

9 May 24, 2022
Translates English into Mandalorian (Mando'a) utilizing a "funtranslations" free API

Mandalorian Translator Translates English into Mandalorian (Mando'a) utilizing a "funtranslations" free API About I created this app to experiment wit

Hayden Covington 1 Dec 04, 2021
A Discord Server Cloner Which Can Clone Any Discord Server In Just Few Minutes

A Discord Server Cloner Which Can Clone Any Discord Server In Just Few Minutes.

samet 4 Jul 23, 2022
A telegram media to pixeldrain stream link bot

Pixeldrain-Bot A telegram media to pixeldrain stream link bot Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - ht

Fayas Noushad 11 Oct 21, 2022
Telegram Link Wayback Bot. This bot archives a web page thrown at itself with wayback Machine (Archive.org).

Telegram Link Wayback Bot. This bot archives a web page thrown at itself with wayback Machine (Archive.org).

Hüzünlü Artemis [HuzunluArtemis] 11 Feb 18, 2022
A multi-purpose Discord bot with simple moderation commands, reaction roles, reminders, and much more!

Nokari This is the rewrite of Nokari. There are still a lot of things to be done. I'm still working on the internal logic, so the bot basically has no

Norizon 13 Nov 17, 2022
MemeBot - A discord bot that tracks how good people's memes are

MemeBot A discord Meme "Karma" Tracking bot Dependancies Make sure you have pymongo installed and a mongodb cluster setup with two collections. pip in

Uday Sharma 3 Aug 10, 2022
Drover is a command-line utility for deploying Python packages to Lambda functions.

drover drover: a command-line utility for deploying Python packages to Lambda functions. Background This utility aims to provide a simple, repeatable,

Jeffrey Wilges 4 May 19, 2021
Simple integrate of API udemy.com with python

Pyudemy Simple integrate of API udemy.com with python Quick start $ pip install pyudemy or $ python setup.py install Authentication To make any calls

Hudson Brendon 30 Jan 02, 2023
FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python

☑️ FAIR Enough metrics for research FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python, conforming to the specifications

Maastricht University IDS 3 Jul 06, 2022