This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is more of an idea than a actual module - although you can use it as such. | |
| # A few things you could do: | |
| # - split the fmt_spec into comma-separated arguments which can be passed into the function | |
| # - make a format method part of the class itself instead of splatting the object into format | |
| class FormatFuncs(dict): | |
| def register(self, func): | |
| self[func.__name__] = type(func.__name__, (), { | |
| "__format__": lambda self, fmt_spec: func(fmt_spec) | |
| })() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import base64 | |
| import requests | |
| import mimetypes | |
| import urllib.parse | |
| from pprint import pprint | |
| from requests_oauthlib import OAuth1 | |
| CONSUMER_KEY = "INSERT KEY HERE" | |
| CONSUMER_SECRET = "INSERT SECRET HERE" |
NewerOlder