Metadata-Version: 2.2
Name: PyElevate
Version: 0.1.1
Summary: Python library for requesting root privileges
Home-page: https://github.com/gabrielzv1233/PyElevate
Author: Gabrielzv1233
Author-email: gabrielzv1233@gmail.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Unix
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-python
Dynamic: summary

# Elevate: Request Root Privileges  

PyElevate is a small Python library that re-launches the current process with  
root/admin. This is essentially a fork of [BarneyGale's Elevate](https://github.com/barneygale/elevate) with some of the pull requests applied.  

## Usage  

To use, call `PyElevate.elevate()` early in your script. When run as root, this  
function does nothing. When not run as root, this function replaces the current  
process (Linux, macOS) or creates a new process, waits, and exits (Windows).  

There is also an `elevated()` function to check if the program is elevated.  
This will output a boolean value, with `True` meaning the program is elevated and `False` meaning it's not.

```python
from PyElevate import elevate, elevated

if not elevated():
    input("Before: " + str(elevated()) + "\nPress enter to elevate")

elevate()

input("After:" + str(elevated()) + "\nPress enter to elevate")
exit(0)
```  

On Windows, the new process's standard streams are not attached to the parent,  
which is an inherent limitation of UAC. By default, the new process runs in a  
new console window. To suppress this window, use  
`elevate(show_console=False)`.  

On Linux and macOS, graphical prompts are tried before `sudo` by default. To  
prevent graphical prompts, use `elevate(graphical=False)`.  
