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.6.tar.gz (26.0 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.6-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mauztoolslib-0.1.6.tar.gz
  • Upload date:
  • Size: 26.0 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.6.tar.gz
Algorithm Hash digest
SHA256 f5a2c613bf8c4be5a4f8425f8dc3a003417167aa905caab857a5778e02e3d258
MD5 03e073adeb6c2877d6a7f32e794f14ab
BLAKE2b-256 5b37e853b7134bc2bfdd1bafc92ba0c27fcdd0499ff0021793c0c6ad88fd64d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mauztoolslib-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 29.2 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 66b85be63797e2f8f0473c637f2cb229f3c1577e6200297b62eab955936afacf
MD5 2038d722b49a155b812f428f70437467
BLAKE2b-256 8f0cd95238df7badf8c4ccf3ecae90defb59ff1ce986e5816d3e07f1bc347b4e

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