Skip to main content

Author: Danila Kisluk

Project description

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'>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netmanager-2.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file netmanager-2.1.tar.gz.

File metadata

  • Download URL: netmanager-2.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for netmanager-2.1.tar.gz
Algorithm Hash digest
SHA256 d882d5a4983a08db5e0518a16cb1afecf166a498219c403dfbdb6e9e7249e67a
MD5 20bf8b9e134f1ab943a421313b2b34da
BLAKE2b-256 942e42c88e523f8d34d1b169f92769090bd57f3c1f202768e5d1c127fff620e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page