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
Finds Jobs on LinkedIn using web-scraping

Find Jobs on LinkedIn 📔 This program finds jobs by scraping on LinkedIn 👨‍💻 Relies on User Input. Accepts: Country, City, State 📑 Data about jobs

Matt 44 Dec 27, 2022
An all-purpose Discord bot written in Python featuring a diverse collection of practical utilities.

GlazeGlopBot Table of Contents About Setup Usage Commands Command Errors Cog Management Local Sound Files Cogs Mod QR RNG VC Weather Proposed Features

Edison Ye 0 May 12, 2022
A simple library for interacting with Amazon S3.

BucketStore is a very simple Amazon S3 client, written in Python. It aims to be much more straight-forward to use than boto3, and specializes only in

Jacobi Petrucciani 219 Oct 03, 2022
Security Monkey monitors AWS, GCP, OpenStack, and GitHub orgs for assets and their changes over time.

NOTE: Security Monkey is in maintenance mode and will be end-of-life in 2020. For AWS users, please make use of AWS Config. For GCP users, please make

Netflix, Inc. 4.3k Jan 09, 2023
a discord bot for searching your movies, and bot return movie url for you :)

IMDb Discord Bot how to run this bot. the first step you must create prefixes.json file the second step you must create a virtualenv if you use window

Mehdi Radfar 6 Dec 20, 2022
A simple and easy to use musicbot in python and it uses lavalink.

Lavalink-MusicBot A simple and easy to use musicbot in python and it uses lavalink. ✨ Features plays music in your discord server well thats it i gues

Afnan 1 Nov 29, 2021
Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live strams, YouTube videos and telegram media.

Telegram VCVideoPlayBot An Telegram Bot By @ZauteKm To Stream Videos in Telegram Voice Chat. NOTE: Make sure you have started a VoiceChat in your Grou

Zaute 20 Oct 21, 2022
This is Telegram Files Store Bot by @AbirHasan2005

PyroFilesStoreBot This is Telegram Parmanent Files Store Bot by @AbirHasan2005. Language: Python3 Library: Pyrogram Features: In PM Just Forward or Se

Abir Hasan 168 Dec 19, 2022
SkyzoMusicBot - Bot Music Telegram By Skyzo

SKYZO MUSIC BOT Telegram Music Bot And Stream Feature New Version Ready to use m

Skyzo 19 Apr 08, 2022
this is a telegram torrent bot

owner of this repo :- AYUSH contact me :- AYUSH Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our bel

AYUSH 237 Dec 16, 2021
Some Discord bot block bad words, with this simple hacking tool you will be able to bypass blacklisted words

DISCORD-BAD-WORD-BYPASS-2022 DISCORD BLACKLISTED WORDS HACKING/BYPASS (EDUCATIONAL PURPOSES ONLY) bypass discord blacklisted words. Description Some D

6 Nov 20, 2022
Get an SNS alert for High Severity GuardDuty findings

Automation AWS-GuardDuty findings Get an SNS alert for High Severity GuardDuty findings Problem: Getting notified when there is Red finding in AWS Gua

Giten Mitra 4 Nov 18, 2022
UniHub API is my solution to bringing students and their universities closer

🎓 UniHub API UniHub API is my solution to bringing students and their universities closer... By joining UniHub, students will be able to join their r

Abdelbaki Boukerche 5 Nov 21, 2021
Visualize size of directories, s3 buckets.

Dir Sizer This is a work in progress, right now consider this an Alpha or Proof of Concept level. dir_sizer is a utility to visualize the size of a di

Scott Seligman 13 Dec 08, 2022
自用直播源集合,附带检测与分类功能。

myiptv 自用直播源集合,附带检测与分类功能。 为啥搞 TLDR: 太闲了。 自己有收集直播源的爱好,和录制直播源的需求。 一些软件自带的直播源太过难用。 网上现有的直播源太杂,且缺乏检测。 一些大源缺乏持续更新,如 iptv-org。 使用指南与 TODO 每次进行大更新后都会进行一次 rel

abc1763613206 171 Dec 11, 2022
Python wrapper for Stanford CoreNLP.

stanfordcorenlp stanfordcorenlp is a Python wrapper for Stanford CoreNLP. It provides a simple API for text processing tasks such as Tokenization, Par

884 Dec 25, 2022
Joins a specified server on all the tokens

Joins a specified server on all the tokens. Usage python -m pip install requests python joiner.py Note Your tokens must be located in a text file call

1 Dec 21, 2021
Checks instagram names to see if they're available

How to install You must have python 3.7.6 installed and make sure you click the 'ADD TO PATH' option when installing Open cmd and type pip install aio

2 Oct 20, 2021
Process your transactions from etherscan (and other forks) into excel file for easier manipulation.

DEGEN TRACKER Read first This is my first Python open source project and it is very likely full of bad practices and security issues. You should not u

1 Oct 13, 2022
Uses discords api to see if a token has a valid payment method.

Discord Payment Checker Uses discords api to see if a token has a valid payment method. Report Bug · Request Feature Features Checks tokens Checks all

dropout 10 Dec 01, 2022