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
Release files for user-data 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| user_data-0.1.0.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| user_data-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / user_data-0.1.0.tar.gz
| Download URL | user_data-0.1.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eecdfb7cdb60ecf2ebbb153b9220064d61d89d32a8e0adbcdeed009108a36468
|
|
BLAKE2b-256 checksum How to use checksums |
c0f5faba248d34414c08450b8098deb18b4c80c6bb6e00589ffcac641e150e10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|
Release files / user_data-0.1.0-py3-none-any.whl
| Download URL | user_data-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
137c900f7d0ae0588e97337c4430eb8608fa5e8694bc26564f6cb5bb35905520
|
|
BLAKE2b-256 checksum How to use checksums |
7baaa5990367c176d3f52b2ef62b46105140941befc262070f7cf082f25f78de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|