Skip to main content

A package for common GNS functions

Project description

gns_helper

gns_helper is a Python package offering a suite of utilities for streamlined GNS-related operations. This package includes tools for database operations, barcode management, ZPL label design, WiFi configuration, and user authentication.

Features

  • Database Operations: Streamlined handling of database queries and validations.
  • Label Design: Generate ZPL labels with QR codes and barcodes.
  • Barcode Management: Compare and validate barcode data with ease.
  • WiFi Configuration: Automate WiFi setup programmatically.
  • User Authentication: Includes JWT-based authentication for secure user management.

Installation

Install the package directly from PyPI:

pip install gns_helper

How to Use

  1. Interacting with API Routes This package includes utilities for interacting with APIs exposed via Flask. Here's how to make requests to various routes:

Authentication API Authenticate a user and retrieve a JWT token:

from gns_helper.app_routes import AppRoutes

base_url = "http://your-api-server.com"
auth_data = {
    "username": "your_username",
    "password": "your_password"
}
token = AppRoutes.authenticate_user(base_url, auth_data)
print("JWT Token:", token)

Get Barcode Data Fetch barcode details from the server:

headers = {"Authorization": f"Bearer {token}"}
barcode_data = AppRoutes.get_barcode_data(base_url, headers)
print(barcode_data)

Submit Label Data Send label data to the API for processing:

label_data = {
    "label_id": "12345",
    "content": "Sample Content"
}
response = AppRoutes.submit_label_data(base_url, label_data, headers)
print(response)
  1. Database Operations
from gns_helper.table_operations import DBTableOperations

db_ops = DBTableOperations()
result = db_ops.fetch("SELECT * FROM your_table_name;")
print(result)
  1. WiFi Configuration
from gns_helper.wifi_functions import configure_wifi

configure_wifi("YourSSID", "YourPassword")
  1. Barcode Validation
from gns_helper.table_operations import BarcodeDataModel

barcode_model = BarcodeDataModel()
is_valid = barcode_model.compare("123456789")
print(is_valid)
  1. Label Design
from gns_helper.zpl_label_designer import ZPLLabelDesigner

designer = ZPLLabelDesigner()
label = designer.create_label(data)
print(label)

Changelog 0.4

  1. print_thermal_label Enhancements Enhanced the function to handle requests both:

    • Direct Python calls (backend).
    • HTTP requests (frontend React.js via Flask API).
  2. generate_zpl Enhancements Enable the function to generate a ZPL file with a specified or default name.

    • file_name parameter is optional: Defaults to label.zpl.
    • Allows passing a custom file name for more flexibility.

License

This package is proprietary software and is distributed under the terms of the Proprietary License. Unauthorized redistribution or modification is prohibited. See the LICENSE file for more information.

Support

For inquiries or support contact: Neudeep Technologies Pvt Ltd

📧 neudeep.tech.pvt.ltd@gmail.com

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

gns_helper-0.4.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

gns_helper-0.4-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file gns_helper-0.4.tar.gz.

File metadata

  • Download URL: gns_helper-0.4.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for gns_helper-0.4.tar.gz
Algorithm Hash digest
SHA256 df559278373afd820359e449d84c1e9143e527370b478375ad35624580aaa32e
MD5 41220544277bcbbf61e06be2768bb3f5
BLAKE2b-256 85d20f8c5838b9d82110a5d5942e5c12f4059c8d500ee872fe8c55fccb0e0c98

See more details on using hashes here.

File details

Details for the file gns_helper-0.4-py3-none-any.whl.

File metadata

  • Download URL: gns_helper-0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for gns_helper-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0c310d996bf87dc149547dbb5d8d9b8d0c6075e289bfd1f4169f64473a104557
MD5 dc8e3bed62308605f701d42aeaf1ead8
BLAKE2b-256 3acca07b111affec5b28ecd6e813f4cbc16745229523f1df5d1344178f03498d

See more details on using hashes here.

Supported by

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