adafruit_pastebin.pastebin

Pastebin API for PasteBin.com

  • Author(s): Alec Delaney

class adafruit_pastebin.pastebin.ExpirationSetting

Enum-like class for expiration settings.

Valid options are:

  • NEVER

  • TEN_MINUTES

  • ONE_HOUR

  • ONE_DAY

  • ONE_WEEK

  • TWO_WEEKS

  • ONE_MONTH

  • SIX_MONTHS

  • ONE_YEAR

class adafruit_pastebin.pastebin.PasteBin(session: Session, auth_key: str)

Pastebin API for PasteBin.com.

Parameters:
  • session (Session) – An :py:class:~`adafruit_requests.Session` to use for web connectiviy

  • auth_key (str) – The PasteBin.com dev key to use for API accessibilty

paste(content: SupportsStr, *, name: str | None = None, content_format: str | None = None, privacy: str = '0', expiration: str = 'N') str

Paste content to PasteBin.com and return the URL of the new paste.

Parameters:
  • content – Any string (or object that can be converted to a string) to paste

  • name (str|None) – (Optional) A name for paste

  • content_format (str|None) – (Optional) The formatting of the pasted content; valid formats can be found in the PasteBin.com API docs

  • privacy (str) – (Optional) The privacy setting of the paste, which must be a valid option from PrivacySetting; default is public

  • expiration (str) – (Optional) When the paste will expire and be deleted, which must be a valid option from ExpirationSetting; default is never

class adafruit_pastebin.pastebin.PrivacySetting

Enum-like class for privacy settings.

Valid options are:

  • PUBLIC

  • UNLISTED

  • PRIVATE

adafruit_pastebin.gist

Pastebin API for GitHub Gists

  • Author(s): Alec Delaney

class adafruit_pastebin.gist.Gist(session: Session, auth_key: str)

Pastebin API for GitHub Gists.

Parameters:
  • session (Session) – An :py:class:~`adafruit_requests.Session` to use for web connectiviy

  • auth_key (str) – The GitHub Personal Access Token to use for authentication

paste(content: SupportsStr, *, filename: str = 'My Gist', description: str | None = None, public: bool = False) str

Paste content as a GitHub Gist and return the URL of the new gist.

Parameters:
  • content – Any string (or object that can be converted to a string) to paste

  • filename (str) – (Optional) A filename for the gist content

  • description (str|None) – (Optional) A description for the gist

  • public (bool) – Whether the gist should be public (True) or private (False)

adafruit_pastebin.adafruit_io

Pastebin API for Adafuit IO

  • Author(s): Alec Delaney

class adafruit_pastebin.adafruit_io.AIOPastebin(session: Session, auth_key: str, *, username: str, feed_key: str)

Pastebin API for Adafruit IO.

Parameters:
  • session (Session) – An :py:class:~`adafruit_requests.Session` to use for web connectiviy

  • auth_key (str) – The Adafruit IO key to use for authentication

  • username (str) – The username associated with the auth_key

  • feed_key (str) – The feed key of the feed to use for pasting

paste(content: SupportsStr) str

Paste content to Adafruit IO and returns the URL of the feed.

Parameters:

content – Any string (or object that can be converted to a string) to paste