semvec/pypi-packages huggingface dataset:
raiseup 0.2
Python library for requesting root privileges
License: MIT

# Raiseup

Raiseup is a small Python library(a fork of [elevate](https://github.com/barneygale/elevate)) that re-launches the current process with root/admin privileges using one of the following mechanisms:

- UAC (Windows)
- AppleScript (macOS)
- `pkexec`, `gksudo`, `kdesudo` or `doas` (Linux and FreeBSD)
- `sudo` (Linux, macOS)

### Usage

To use, call `raiseup.elevate(file_path)` early in your script(where `file_path` is the absolute path of the script that needs to be elevated). 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).

Consider the following example(Note: `os.getuid()` only works on POSIX based systems. For windows, you might need to find other ways to check which user this script is currently running as):

```python
import os
def is_root():
    return os.getuid() == 0
if not is_root():
    from raiseup import elevate
    print("Not root")
    elevate(__file__)
else:
    print("This script is running as root")
```

This prints:

```
Not root
This script is running as root
```

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(file_path,show_console=False)`.

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

### Improvements over [Elevate](https://github.com/barneygale/elevate):

- Graphical environment variables `$DISPLAY` and `$XAUTHORITY` are automatically passed on to the elevated process (useful for GUI applications) on Linux and FreeBSD
- Added support for `doas` and the FreeBSD operating system
- Older code has been cleaned up
- Broken code has been fixed

### PyPI Package:

Raiseup is available to be installed from PyPI [here]()

`pip install raiseup`

### A common mistake:

Avoid importing `raiseup` unconditionally in your scripts if the `raiseup` package is not installed for the root/administrator user. Otherwise, the `raiseup` package will be imported regradless of which user is running the script. If the root user is running the script, it will fail to find `raiseup` resulting in a `ModuleNotFoundError` and script termination.

(c) 2018 [Barney Gale](https://github.com/barneygale/) and (c) 2021 [Xploreinfinity](https://github.com/xploreinfinity)
dclimplode 0.0.1.0
a (light) binding for blast/pklib (dclimplode)
License: MIT

[![PyPI](https://img.shields.io/pypi/v/dclimplode)](https://pypi.org/project/dclimplode/)

## dclimplode

a (light) binding for https://github.com/madler/zlib/blob/master/contrib/blast/blast.c and https://github.com/ladislav-zezula/StormLib/blob/master/src/pklib/implode.c

DCL stands for `PKWARE(R) Data Compression Library`.

```
o = dclimplode.compressobj()
s = o.compress(b'hello')+o.flush()
o = dclimplode.decompressobj()
o.decompress(s) == b'hello'
```

## tested versions

- Python 2.7
- Python 3.9
- PyPy [2.7] 7.3.3
- PyPy [3.7] 7.3.5
    - For PyPy2, pip needs to be 20.1.x cf https://github.com/pypa/pip/issues/8653
    - PyPy needs to be 7.3.1+ cf https://github.com/pybind/pybind11/issues/2436
- Pyston [3.8] 2.3

## special thanks

- https://github.com/JoshVarga/blast showed dclimplode compression by Ladislav Zezula (I knew dclimplode decompression in zlib for a long time though)
- unlike [deflate64 infback9](https://github.com/brianhelba/zipfile-deflate64/pull/18), making dclimplode blast resumable does not look possible (for me). instead I used threaded decoder. basic idea is from https://github.com/miurahr/pyppmd/pull/33#issuecomment-894676975 ('s linked commit f224a04).
slz 0.0.1.0
a (light) binding for libslz
License: MIT

[![PyPI](https://img.shields.io/pypi/v/slz)](https://pypi.org/project/slz/)

## slz

a (light) binding for http://www.libslz.org/

```
o = slz.compressobj
o.compress('hello')
o.flush()
```

the stream is compatible with zlib deflate.

## tested versions

- Python 2.7
- Python 3.9
- PyPy [2.7] 7.3.3
- PyPy [3.7] 7.3.5
    - For PyPy2, pip needs to be 20.1.x cf https://github.com/pypa/pip/issues/8653
    - PyPy needs to be 7.3.1+ cf https://github.com/pybind/pybind11/issues/2436
- Pyston [3.8] 2.3

## Windows installation

Now sdist installation is possible.

## Apple M1 wheel

It will be considered after https://github.com/actions/python-versions/pull/114 is done.