# B2B API
API Wrapper in Python For the BytesToBits API
# Classes
## *b2bapi*.BytesToBits()
### **Attributes**:
None
### __Methods__
#### `BytesToBits().get_word()`
This method `GET`s a random word from the:
`https://api.bytestobits.dev/word` endpoint
It returns a `Word` object
#### `BytesToBits().get_meme()`
This method `GET`s a random meme from a random subreddit using the:
`https://api.bytestobits.dev/meme` endpoint
It returns a `Meme` object
#### `BytesToBits().get_speedtext()`
This method `GET`s a random selection of text from the:
`https://api.bytestobits.dev/speedtext2` endpoint
It returns a `Speedtext` object
#### `BytesToBits().get_madlib()`
This method `GET`s a random madlib to use by requesting the:
`https://api.bytestobits.dev/madlibs` endpoint
It returns a `Madlib` object
## *b2bapi*.Word(word)
### **Attributes**:
1. *Word()*.**word** (`str`) => The word that the word object represents
### __Methods__:
None
## *b2bapi*.Meme(title, url, link, subreddit)
### **Attributes**
1. *Meme()*.**title** (`str`) => The title of the meme
2. *Meme()*.**url** (`str`) => The URL of the meme image
3. *Meme()*.**link** (`str`) => The URL of the actual reddit post
4. *Meme()*.**subreddit** (`str`) => The name of the subreddit the meme is from
### __Methods__:
None
## *b2bapi*.Speedtext(text)
### **Attributes**
1. *Speedtext()*.**text** (`str`) => The text that the object represents
### __Methods__:
1. *Speedtext()*.**typewriter()** (`None`) => Prints out the text to `sys.stdout`, character by character to give a typing effect.
## *b2bapi*.Madlib(title, text, no_of_questions, questions, responses = [])
### **Attributes**
1. *Madlib()*.**title** (`str`) => The title of the madlib
2. *Madlib()*.**text** (`str`) => The text currebtly held by the madlib (if this madlib was returned by the `BytesToBits().get_madlib()` method, then this text will contain placeholders)
3. *Madlib()*.**no_of_questions** (`int`) => The number of placeholders in the text
4. *Madlib()*.**questions** (`list[str]`) => A list of strikgs which describe what type of word should go in the corresponding placeholder.
### __Methods__:
1. *Madlib()*.**get_responses()** (`list[str]`) => Prompts the user in `sys.stdout` to enter a word based on each question in `Madlib().questions`.
2. *Madlib()*.**substitute()** (`str`) => Will return the text with all the placeholders filled assuming `Madlib().responses` contains the correct number of strings. Also reassigns `Madlib().text` this new filled in version of the text.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共14个文件
py:7个
txt:3个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:b2bapi-1.1.5.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
b2bapi-1.1.5.tar.gz (14个子文件)
b2bapi-1.1.5
PKG-INFO 3KB
b2bapi
word.py 120B
text.py 335B
meme.py 202B
__init__.py 81B
wrapper.py 3KB
madlib.py 707B
setup.cfg 38B
setup.py 551B
README.md 2KB
b2bapi.egg-info
PKG-INFO 3KB
SOURCES.txt 237B
top_level.txt 7B
dependency_links.txt 1B
共 14 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功