Skip to main content

Library to work with .qpmgr files

Project description

pManager

Ports manager library.
Works with .qpmgr files.
Author: Qwantman

You can parse and write .qpmgr files using this library.
It includes two classes: fileParser and fileWriter.
fileParser is used for parsing .qpmgr files and extracting information.
fileWriter is used for creating new .qpmgr files or editing existing ones.

This library is guaranteed to work on python versions > 3.10, but it's compatible with any python version > 3.0.

Links

PyPI Version PyPI - Python Version PyPI - License

Installation

pip install portsManager

Usage

Parser

from pManager import fileParser
parser = fileParser("file.qpmgr", ignoreExtension = False)

# Get opened & closed ports
openedPorts = parser.getOpenedPorts()
closedPorts = parser.getClosedPorts()

# Get list of services
servicesList = parser.getServicesList()

# Print beautifully-formated services list
for _ in servicesList:
    print(f'{parser.getBeautifuledInfoByService(i)}\n')

Writer

from pManager import fileWriter

# Setting up writer
writer = fileWriter("file.qpmgr", autoFlush = True, ignoreExtension = False)

# Add new service
# "ServiceName" will be used as a key to bind ports
writer.constructServiceObj("ServiceName", "ServiceDescription")  

# Add port to service. 
# On port adding, file'll be flushed with autoFlush = True
writer.bindPortToService(
    serviceName = "ServiceName", 
    portNum = 80, 
    portProto = "TCP", 
    openState = True, 
    portDesc = "HTTP server"
)

# Or, with autoFlush = False
writer.writeToFile()

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

portsManager-0.1.3.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file portsManager-0.1.3.tar.gz.

File metadata

  • Download URL: portsManager-0.1.3.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for portsManager-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9f7cb7003b8b19716c4d33363da66343341cfc4faa32503b51f7c4439442555f
MD5 710cdf217b8d649fb4b0714356f85ed9
BLAKE2b-256 126b9084dc66cd5912f5c90c76baf24cefb8d7ef237c078732962aa2e079dc1d

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