A Python wrapper for the ChatADy API.
Project description
ChatADy Package for Python
The ChatADy
package is a Python wrapper for the ChatADy API, facilitating easy interaction with ChatADy's services from Python applications. It provides methods to retrieve contents and initiate new chats.
Installation
To install ChatADy, run this command in your terminal:
pip install chatady
This is the preferred method to install ChatADy, as it will always install the most recent stable release.
If you don't have pip installed, this Python installation guide can guide you through the process.
Usage
To use the ChatADy
package, you first need to import the ChatADy
class from the package and then initialize it with your publisher ID and key.
Quick Start
Here's a quick example to get you started:
from chatady.chatady import ChatADy
# Initialize the ChatADy client
client = ChatADy('your_publisher_id', 'your_api_key')
# Send in messages
response = client.new_chat('unique_id_identifying_conversation', 'your_entry_message', 'boolean_human_or_bot')
print(response)
# Get ad contents
response = client.get_contents('unique_id_identifying_conversation')
print(response)
Initializing the Client
To interact with the API, you need to create an instance of ChatADy
:
client = ChatADy('your_publisher_id', 'your_api_key')
You can also pass additional options as a dictionary to configure the client further:
options = {'environment': 'production', 'noDelay': True, 'timeout': 1000}
client = ChatADy('your_publisher_id', 'your_api_key', options)
Retrieving Ad Contents
To retrieve contents, use the get_contents
method with the chat ID. You can also specify options for better targeting:
response = client.get_contents('unique_id_identifying_conversation', {'humansex': 'male', 'botsex': 'female'})
print(response)
Sending in a New Message
To start a new chat, use the new_chat
method with the chat ID, entry message, and human identifier:
response = client.new_chat('unique_id_identifying_conversation', 'Hello, ChatADy!', 'boolean_human_or_bot')
print(response)
Support
For issues, questions, or contributions, please open an issue on the GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chatady-1.1.0.tar.gz
.
File metadata
- Download URL: chatady-1.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8499968d1695fde778b354f9b9a79f5f1c608581e7feff3c30666268fc880c7b |
|
MD5 | 65a3252d48ae2c67e1fd11486b86a959 |
|
BLAKE2b-256 | f04c09cda4c3897f836fdc9b1a408dd7bd455cf0c22bc96341f27c4a0258c0e3 |
File details
Details for the file chatady-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: chatady-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e34e345ac379bc5aa9b51f93cd44c3ec2960241432cd0b19e57353e1b8bf5a14 |
|
MD5 | 03e86ba13cb73ffbc9253865c6e3cf3b |
|
BLAKE2b-256 | 20ac7dfa271bcc7d2612d9ccb49dd8e91f4c805b8d995d21ceb19b0b8a65727f |