A package for managing user information and settings on Windows systems.
Project description
User Data Package
The User Data Package is a Python module that provides an interface for managing user information and settings on a Windows system. It allows you to retrieve the current user's name, manage user permissions, and handle user preferences effectively.
Features
- Retrieve the current user's name.
- Access user permissions (e.g., check if the user is an admin).
- Manage user settings stored in a configuration file (INI format).
- Easily extendable to add more user-related functionalities.
Installation
-
Clone the repository or download from PyPi:
git clone https://github.com/aidmet/user_data.git cd users
-
No additional dependencies are required for this package as it uses built-in libraries.
Usage
Here's how to use the users package:
from users import get_current_user_name, User
from users.permissions import UserPermissions
from users.settings import UserSettings
# Create a User instance
username = get_current_user_name()
user = User(username)
# Check user permissions
permissions = UserPermissions(user)
print(f"Is {user.get_username()} an admin? {permissions.is_admin()}")
print(f"Privileges: {permissions.get_user_privileges()}")
# Manage user settings
user_settings = UserSettings(user)
# Set a new setting
user_settings.set_setting('theme', 'dark')
# Retrieve the setting
theme = user_settings.get_setting('theme', 'light')
print(f"User theme setting: {theme}")
Testing
The package includes a set of unit tests to ensure functionality. To run the tests:
- Navigate to the project directory.
- Run the following command:
python -m unittest discover -s tests
Contributing
Contributions are welcome! If you have suggestions or improvements, please create an issue or submit a pull request.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file user_data-0.1.0.tar.gz.
File metadata
- Download URL: user_data-0.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eecdfb7cdb60ecf2ebbb153b9220064d61d89d32a8e0adbcdeed009108a36468
|
|
| MD5 |
dfcbfe1385e3d66acf19a627780d72b3
|
|
| BLAKE2b-256 |
c0f5faba248d34414c08450b8098deb18b4c80c6bb6e00589ffcac641e150e10
|
File details
Details for the file user_data-0.1.0-py3-none-any.whl.
File metadata
- Download URL: user_data-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
137c900f7d0ae0588e97337c4430eb8608fa5e8694bc26564f6cb5bb35905520
|
|
| MD5 |
ed200ff6c4c87ae83043beb05bf9f0db
|
|
| BLAKE2b-256 |
7baaa5990367c176d3f52b2ef62b46105140941befc262070f7cf082f25f78de
|