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.5.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gns_helper-0.5-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gns_helper-0.5.tar.gz
  • Upload date:
  • Size: 18.4 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.5.tar.gz
Algorithm Hash digest
SHA256 947ca38684f253eee3c5460cd01e4eb33aa132ebc0294a38424d064c6e5b55c1
MD5 40820c2985c43b7f4368c9de0813a473
BLAKE2b-256 ee4d67bcd6615e828fcff0db3a051cc556b488172f58a5d9001366c5a32c5e35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gns_helper-0.5-py3-none-any.whl
  • Upload date:
  • Size: 20.5 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 50fed87e51d188a58fb0c17b1220da308a441342f59f4ba9cf6a0f160eaa7cd5
MD5 bac9f294df86d35152e429a0e053a7a3
BLAKE2b-256 2c104c4897884f501eb7b58d6c5eaefac91f0b991e740f8e4acf5fdbce96418a

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