Skip to main content

Python SDK for the MadAPI

Project description

PyMadAPI - MadAPI Python Library

PyMadAPI is easy-to-use library that uses MadAPI.

Installing (requires Git)

$ pip install -U git+https://github.com/Team-MadBot/pymadapi 

Basic usage

#!/usr/bin/python
# -*- coding: utf-8 -*-

from pymadapi.base import UserSession


if __name__ == '__main__':
    key = 'your-api-token'
    session = UserSession(key) # Create a session to get userinfo
    user = session.get_userinfo(560529834325966858) # get the user with the `560529834325966858` ID
    print(user.is_premium) # display if the user has a MadBot Premium subscription

License

MIT License

Copyright (c) 2023 MadCat9958

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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

pymadapi-1.1.2.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file pymadapi-1.1.2.tar.gz.

File metadata

  • Download URL: pymadapi-1.1.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.5

File hashes

Hashes for pymadapi-1.1.2.tar.gz
Algorithm Hash digest
SHA256 b3d824604ebd7874b9e50d205b725a8f408a9b1492a05dc879cad2970c5b7bd6
MD5 84681f7b6703978f6d933b7b893c5a5f
BLAKE2b-256 278202728c9bdf487a851002713b3aecbf7ec5e97ae49c77d0158f7bb38c8b24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page