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.1.post1.tar.gz (16.2 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.1.post1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file mauztoolslib-0.1.1.post1.tar.gz.

File metadata

  • Download URL: mauztoolslib-0.1.1.post1.tar.gz
  • Upload date:
  • Size: 16.2 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.1.post1.tar.gz
Algorithm Hash digest
SHA256 eabd4dab499f9060b7741000fbc5da771f1216061933b555f61eac9ef423e223
MD5 8c4cbd81e488bb86b4b5fd3c0cc2eda5
BLAKE2b-256 0ebb4600ac00bbdf93cbaeb32794346fd7496971a660556693b7eb010d45c236

See more details on using hashes here.

File details

Details for the file mauztoolslib-0.1.1.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for mauztoolslib-0.1.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 4853dd62d4ed388181da3b8ac31a8af7405266c84408515f3a9b06f81acd4ae1
MD5 25a8cf8b48b1aab0fd5028be99b77eea
BLAKE2b-256 144bd3d1c4ce23fbfabb66070e88d57ec3209941f9f11698070f8977f585f778

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