Skip to main content

Tools for Python projects

Project description

mauztoolslib – Dokumentation

Dies ist die Dokumentation für die mauztoolslib-Bibliothek. Aktuell enthält die Bibliothek disklib für Festplatten- und Speicherinformationen, die Path-Klasse, eine Export-Funktion sowie die HTML-Bibliothek zur Analyse und Manipulation von HTML-Inhalten.


Installation

pip install mauztoolslib

Hinweis: mauztoolslib enthält aktuell disklib, HTML-Tools (HTMLReader, Paragraph, Script, Image, Heading), Path und export.


Verwendung

DiskUsage

from mauztoolslib.disklib import DiskUsage

disk = DiskUsage("C:/", "GB")
disk.free_on()
disk.usage_on()
disk.total_on()
print(disk)

Export

Die Export-Funktion erlaubt das Speichern von DiskUsage-Instanzen in JSON, CSV oder Excel.

from mauztoolslib.disklib import DiskUsage, export

disk = DiskUsage("C:/", "GB")
disk.free_on()
disk.usage_on()
disk.total_on()

# Export als JSON
export(disk, format="json", filename="disk.json")

# Export als CSV
export(disk, format="csv", filename="disk.csv")

# Export als Excel
export(disk, format="excel", filename="disk.xlsx")

Wichtige Hinweise:

  • obj muss eine erlaubte Klasse sein (DiskUsage)
  • format kann json, csv oder excel sein
  • filename kann ein String oder Path-Objekt sein

HTML-Bibliothek

from mauztoolslib.html import HTMLReader, Script, Paragraph, Image, Heading

html_content = """<html>
<head>
    <script src="app.js"></script>
</head>
<body>
    <p>Hello World</p>
    <img src="logo.png" alt="Logo">
    <h1>Main Heading</h1>
</body>
</html>"""

reader = HTMLReader(html_content)

scripts = reader["script"]
paragraphs = reader["p"]
images = reader["img"]
headings = reader["h1"]

Script, Paragraph, Image, Heading

Siehe vorherige Beispiele (Methoden: to_html(), write_to(target), save(path) für Image).

Path

from mauztoolslib.disklib import Path

p = Path("example.txt")
p.write_text("Hallo Welt")
print(p.read_text())

folder = Path("example_folder")
folder.mkdir(parents=True, exist_ok=True)
new_folder = Path("copy_folder")
folder.copy_to(new_folder)

Fehlerbehandlung

  • HTMLReader wirft KeyError, wenn ein angefragtes Tag nicht existiert.
  • Image wirft ValueError, wenn save() ohne PIL-Image aufgerufen wird.
  • Path-Methoden werfen OSError, FileNotFoundError oder NotADirectoryError.
  • Export-Funktion wirft TypeError, wenn die Klasse nicht erlaubt ist, und ValueError, wenn das Format unbekannt ist.

Lizenz

mauztoolslib ist unter der MIT-Lizenz lizenziert.

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

mauztoolslib-0.1.3.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

mauztoolslib-0.1.3-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mauztoolslib-0.1.3.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for mauztoolslib-0.1.3.tar.gz
Algorithm Hash digest
SHA256 96ae14c693e3dbc49a4e71855790832ea299a6500bd80e393849219260f1318d
MD5 d15cad0c014ae0e0beb05d6a665a32be
BLAKE2b-256 e7832babf49a76d1f949369a76cdeb1775aea3390b774dde74b53efb1afdde30

See more details on using hashes here.

File details

Details for the file mauztoolslib-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mauztoolslib-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for mauztoolslib-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1536aadfc2d814664a01102efdaba8f91db36cf901d1232ed186eca9331e81aa
MD5 389c6b4adf2456f452e4623cab9734ee
BLAKE2b-256 662e4e60c4ff762b479b9adb5d5fade33ad3bd0cc5d6f1a3a2cd5847a4624f55

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