Skip to main content

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

  1. Clone the repository or download from PyPi:

    git clone https://github.com/aidmet/user_data.git
    cd users
    
  2. 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:

  1. Navigate to the project directory.
  2. 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.

  1. Fork the repository.
  2. Create your feature branch:
    git checkout -b feature/YourFeature
    
  3. Commit your changes:
    git commit -m 'Add some feature'
    
  4. Push to the branch:
    git push origin feature/YourFeature
    
  5. Open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Python - The programming language used.
  • unittest - The built-in library for testing.

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

user_data-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

user_data-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for user_data-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eecdfb7cdb60ecf2ebbb153b9220064d61d89d32a8e0adbcdeed009108a36468
MD5 dfcbfe1385e3d66acf19a627780d72b3
BLAKE2b-256 c0f5faba248d34414c08450b8098deb18b4c80c6bb6e00589ffcac641e150e10

See more details on using hashes here.

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

Hashes for user_data-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 137c900f7d0ae0588e97337c4430eb8608fa5e8694bc26564f6cb5bb35905520
MD5 ed200ff6c4c87ae83043beb05bf9f0db
BLAKE2b-256 7baaa5990367c176d3f52b2ef62b46105140941befc262070f7cf082f25f78de

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