A collection of tools and utilities for Python. It includes modules for authentication, menus, and more. The library is released under the MIT License and the documentation is generated by an AI trained by OpenAI.
Project description
maxmods
maxmods is a collection of tools for user authentication and data management. The library is released under the MIT License and the documentation is generated by an AI trained by OpenAI.
maxmods.auth
The maxmods.auth
module provides a simple way to handle user authentication and data storage on a remote server. The AuthSesh
class allows users to sign up, log in, and manage their data on the server.
Usage
To use the AuthSesh
class, you first need to create an instance of the class and set the username and password:
from maxmods.auth import AuthSesh
auth = AuthSesh()
auth.set_vals("username", "password")
Once the username and password are set, you can use the login()
method to log in to the server:
auth.login()
If the login is successful, you can use the save()
and load()
methods to save and load data from the server. For example:
auth.save("user_data/profile", {"name": "John Doe", "email": "johndoe@example.com"})
user_data = auth.load("user_data/profile")
When you are done with the instance, you have to use the terminate()
method to end the connention with the server:
auth.terminate()
Note: If you do not do this, nothing you do on the server will save.
The AuthSesh
class also provides methods for signing up new users, removing users, and terminating the session. For more details and examples, see the AuthSesh class documentation.
Context Manager
The AuthSesh
class can be used as a context manager to automatically log out and terminate the session when the context ends:
from maxmods.auth import AuthSesh
with AuthSesh() as auth:
auth.set_vals("username", "password")
auth.login()
# ...
Exceptions
The AuthSesh
class raises the following exceptions:
AuthenticationError
: Raised if there is an error authenticating the user.DataError
: Raised if there is an error accessing or modifying the data on the server.LocationError
: Raised if the specified location does not exist on the server.PasswordError
: Raised if the password is incorrect or invalid.UsernameError
: Raised if the username is invalid or already in use.
Installation
$ pip install maxmods
License and Disclaimer
The maxmods library is licensed under the MIT License, which means it is free to use and distribute for both personal and commercial purposes. The documentation for the library has been generated by an AI trained by OpenAI, and may not be entirely accurate or up-to-date. It is recommended to consult the source code for the library for the most accurate information.
Authors
Project details
Release history Release notifications | RSS feed
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 maxmods-0.5.0.tar.gz
.
File metadata
- Download URL: maxmods-0.5.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a63ce95bbef2b929888fd7b9df13731be2080b7cf084cc618c9ddf204c7687f |
|
MD5 | 539721ac16ad5726c99a10a45d74dc5a |
|
BLAKE2b-256 | c56a210410825c873b3e4ffadfc7507c56d1bfc46f7252b5d87abc3f2b103b9d |
File details
Details for the file maxmods-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: maxmods-0.5.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89b51a2dd820d6d53d025e53462aa2f8867d1ad86af2ab8b84877e472c70ddf7 |
|
MD5 | 3f51ac2f596b3646905946623c3e1f39 |
|
BLAKE2b-256 | 3b7fc2171392dab4a21a2133f02e1b6a4aec146fdc127d8af2b4887ffdc4a5a7 |