NetManager
- Version: 2.1 (05.03.21)
- Author: Danila Kisluk
- VK: https://vk.com/danilakisluk
- Gmail: dankis12a@gmail.com
Installation
pip install netmamanger
Description
NetManager is a Python library for interacting with the Internet from Kivy Android apps. You can also use NetManager for interacting with the Internet from other projects. NetManger can make network requests and interact with Firebase Realtime Database.
What's new in version 2.1?
- Added description.
- Fixed small bugs.
NetRequest
NetRequest makes network requests and returns their results.
from netmanager import NetRequest
url = "some.url/path"
# Writing 'https://' is optional. This does not apply to other protocols.
""" GET request """
get_request = NetRequest(url)
# 'GET' is default method.
status = get_request.status
headers = get_request.headers
result = get_request.result
print(status, type(status))
# 200 <class 'int'>
print(headers, type(headers))
# {"header": "header_data"} <class 'dict'>
print(result, type(result))
# {"response":"response_data"} <class 'str'>
""" POST request """
post_request = NetRequest(url, method='POST', data='{"key":"value"}')
status = post_request.status
headers = post_request.headers
result = post_request.result
print(status, type(status))
# 200 <class 'int'>
print(headers, type(headers))
# {'header': 'header_data'} <class 'dict'>
print(result, type(result))
# {"response":"response_data"} <class 'str'>
FirebaseRTDB
FirebaseRTDB interact with Firebase Realtime Database.
from netmanager import FirebaseRTDB
database_url = "my-default-rtdb.firebasedatabase.app"
# Writing 'https://' is optional. This does not apply to other protocols.
db = FirebaseRTDB(database_url)
path = "users"
# '/' is default path.
""" Get """
users = db.get(path)
print(users, type(users))
# {"user1":"user_data"} <class 'str'>
""" Set """
data = '{"user1":"new_user_data"}'
set = db.set(path, data)
print(set, type(set))
# 200 <class 'int'>
Release files for netmanager 2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| netmanager-2.1.tar.gz | 2.7 kB | Details |
Release files / netmanager-2.1.tar.gz
| Download URL | netmanager-2.1.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d882d5a4983a08db5e0518a16cb1afecf166a498219c403dfbdb6e9e7249e67a
|
|
BLAKE2b-256 checksum How to use checksums |
942e42c88e523f8d34d1b169f92769090bd57f3c1f202768e5d1c127fff620e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1
|