Metadata-Version: 2.4
Name: urfp
Version: 0.2
Summary: URFP client Python module
Project-URL: Homepage, https://gitlab.com/urfp
Project-URL: Source, https://gitlab.com/urfp/urfp-python
Project-URL: Documentation, https://urfp.gitlab.io/urfp/
Author-email: Kolja Waschk <15247061-kawk@users.noreply.gitlab.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Communications
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: requests
Description-Content-Type: text/markdown

# URFP client Python module

## Quick install

Not yet available packaged, work in progress..

```
# sudo apt install python3-build
rm -f dist/*.whl ; python3 -m build ; pip3 install dist/*.whl
```

## Init (HTTP)

```
from urfp.core import URFP
from urfp.http import URFPHttpConnector

def log_requests(url, parameter, http_response, text_response):
    print("URL:                 " + url)
    print("Query:               " + parameter)
    print("HTTP-Response Code:  " + http_response)
    print("Received Content:    " + text_response)

import requests
s = requests.session()
c = urfp.http.URFPHttpConnector('http://server.com', session=s, logger=log_requests)
```

or just (with one HTTP/1.0 session per request and no request logging)...

```
from urfp.core import URFP
from urfp.http import URFPHttpConnector

c = urfp.http.URFPHttpConnector('http://server.com')
```

## Init (Tinypacket/UDP)

```
from urfp.core import URFP
from urfp.tinypacket import URFPTinypacketframe

c = URFPTinypacketFrame(server="10.0.10.62:6272")
```


## Usage after Init

The elements named as listed by lv, lf etc. become attributes:

```
u = URFP(c)
u.set_variable("something_enabled", True)
print(u.get_variable("something_enabled")

res = u.call_function("arbitrary_func", {'argument': 123, 'second':'value'})
```


