Skip to main content

Official API Wrapper for Pluto Authentication (https://pluto-mc.net)

Project description

PlutoAuth

PlutoAuth is a Python SDK for interacting with the Pluto Authentication API. It provides a simple and pythonic way to use the API's functionality.

This library was made by the Official Pluto Authentication Team.

Installation

Use the package manager pip to install PlutoAuth.

pip install PlutoAuth

or

python3 -m pip install PlutoAuth

Example Usage

from PlutoAuth import PlutoAPI

db_uuid = "DBUUID - Get from dashboard"
db_user = {"username": "username", "password": "password"}

# Read database/userbase
api = PlutoAPI(db_uuid, db_user)
print(api.read_database()) # Should return the database as JSON

# Get the user who is currently signed in on the web
me = api.me(db_user.get('username'), db_user.get('password'))
print(me) # Should return the user object
print("Credits: " + me.credits)

API Methods

The PlutoAPI class provides the following methods:

  • me(username: str, password: str): Get the user who is currently signed in on the web.
  • read_database(): Read database/userbase.
  • add_db_user(new_user, permissions): Add a new access user to the database.
  • remove_db_user(username): Remove a DB user from the database.
  • update_db_user_permissions(username, permissions): Update a DB user's permissions.
  • add_userbase_user(new_user, extra_fields=None): Add a new auth user to the database.
  • remove_userbase_user(username): Remove an auth user from the database.
  • update_userbase_user(update_user): Update an auth user's extra fields.
  • authenticate_user(auth_user): Check the credentials of an auth user.

For more details on these methods and the data they require, refer to the Pluto API documentation. (Must be signed in to view)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

PlutoAuth-1.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PlutoAuth-1.0.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file PlutoAuth-1.0.2.tar.gz.

File metadata

  • Download URL: PlutoAuth-1.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for PlutoAuth-1.0.2.tar.gz
Algorithm Hash digest
SHA256 cf991afb77aa4aa7fc15619aec5188aaf69dad0429779a5b1b67a65c8e59635e
MD5 b4dc72f3f3a7d69ee399a911a5d84c77
BLAKE2b-256 e9bcd7dc0151a93cf0f5bd8da2026b1df12af27e870bb07f222d8b0784a69c40

See more details on using hashes here.

File details

Details for the file PlutoAuth-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: PlutoAuth-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for PlutoAuth-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5061a699319e459409e3f754873c804e4dce63cfef2a6b9e58ed723a02721a9a
MD5 c12cf09d636b3dc7dc9a7f0f645c57e7
BLAKE2b-256 d01b2271ca4829757ddab5ba542fa2b1baba180175c44ad2b5914b2e75751c82

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