semvec/pypi-packages huggingface dataset:
python-networkmanager-legacy 2.2.1
Easy communication with NetworkManager
Requires Python: >=3.6

## NOTICE

⚠️ This project have minor fixes for personal usage. ⚠️

If you are looking for an alternative, please try
https://github.com/python-sdbus/python-sdbus-networkmanager

Official page of python-networkmanager: https://github.com/seveas/python-networkmanager

# python-networkmanager-legacy
*Easy communication with NetworkManager*

python-networkmanager wraps NetworkManagers D-Bus interface so you can be less
verbose when talking to NetworkManager from python. All interfaces have been
wrapped in classes, properties are exposed as python properties and function
calls are forwarded to the correct interface.

See docs/index.rst for the documentation. An HTML version can be found on
http://packages.python.org/python-networkmanager/

### Requirements

Python 3.6 or newer and the python D-Bus bindings.

### Quick install instructions

Stable version:
```
$ pip install python-networkmanager-legacy
```

Latest code:
```
$ git clone https://github.com/kt315ua/python-networkmanager-legacy
$ cd python-networkmanager-legacy
$ python setup.py install
```

### Build and install python wheel-package

#### Build
```
$ sudo apt install build-essential libpython3-dev libdbus-1-dev libglib2.0-dev`
$ pip wheel .
```

#### Install
```
$ pip install python_networkmanager_legacy-2.2.1-py3-none-any.whl
```

⚠️ WARNINGS ⚠️

Package conflicts with 'python-networkmanager':
- NetworkManager.py file will be overwritten
cfcf 0.1.0
collision-free cache folder

# cfcf
collision-free cache folder

This library creates a cache file for a remote resource or a file need additional processing.
The cache will be duplicated, if an another process is creating the files.
If the cache file already created, an interface will return the file path.
This excluding concurrent writing feature makes to avoid the collision.


# Installation
```
pip install cfcf
```

# Usage
Following example running on '/tmp'
##  handle multiple files (directory mode)
```
import cfcf

def your_cache_getting_impl(arg1, arg2):
    print(arg1)
    import os
    print(os.getcwd())
    print(arg2)

print('#1# ', cfcf.get_dir('cache_name', your_cache_getting_impl, 'arg1', 'arg2'))
print('#2# ', cfcf.get_dir('cache_name', your_cache_getting_impl, 'arg1', 'arg2'))
```
```
arg1
/tmp/cache_name/01HGAJ22W2DZDCSC23V1A8RT20
arg2
#1#  /tmp/cache_name/01HGAJ22W2DZDCSC23V1A8RT20
#2#  /tmp/cache_name/01HGAJ22W2DZDCSC23V1A8RT20
```

## handle a single file (file mode)
```
import cfcf

def your_cache_getting_impl(filename):
    import os
    print('Put a file in this dir. and return the path', os.getcwd())
    import pathlib
    path = pathlib.Path(filename)
    path.touch()
    return path

print('#1# ', cfcf.get_file('cache_name2', your_cache_getting_impl, 'filename.txt'))
print('#2# ', cfcf.get_file('cache_name2', your_cache_getting_impl, 'filename.txt'))
```
```
Put a file in this dir. and return the path /tmp/cache_name2/01HGAK6QQ516P2536QM38PFZ8M
#1#  /tmp/cache_name2/01HGAK6QQ516P2536QM38PFZ8M/cache_name2
#2#  /tmp/cache_name2/01HGAK6QQ516P2536QM38PFZ8M/cache_name2
```

## handle a dict (object mode)
```
import cfcf

def your_cache_getting_impl(arg1, arg2):
    return {'arg1':arg1, 'arg2':arg2}

print('#1# ', cfcf.get_object('cache_name3', your_cache_getting_impl, 'arg1.1', 'arg2.1'))
print('#2# ', cfcf.get_object('cache_name3', your_cache_getting_impl, 'arg1.2', 'arg2.2'))
```
```
#1#  {'arg1': 'arg1.1', 'arg2': 'arg2.1'}
#2#  {'arg1': 'arg1.1', 'arg2': 'arg2.1'}
```