Skip to main content

NetManager

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)

Source distribution for netmanager 2.1
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

Release history Release notifications | RSS feed

This release

2.1 This release

1 release file

2.0

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page