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.
Read The Docs
Links
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(_)}\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
Release history Release notifications | RSS feed
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.5.tar.gz
(6.9 kB
view details)
File details
Details for the file portsManager-0.1.5.tar.gz.
File metadata
- Download URL: portsManager-0.1.5.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94704ab7115f1ce8c9b9e4b2df8f8b57f1d79d59eba6e92ae088819aef6730fb
|
|
| MD5 |
3c162beac5ac4b70a74610d637d249d1
|
|
| BLAKE2b-256 |
3bc46aa9a41e76d9c112ac95d5b5e620e50f7c0766d4770452017b6f1c2b6213
|