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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mauztoolslib-0.1.7.tar.gz
  • Upload date:
  • Size: 27.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.7.tar.gz
Algorithm Hash digest
SHA256 be2def6151973cc870a99217709c33566e062477e104274a37a7f5a822838e98
MD5 3529e5ebaefc56bbc25f536fc2e6321a
BLAKE2b-256 f58a0499265f311f6ee9e1f0d38af19619eb1a9143e520667261f2bee13a2a66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mauztoolslib-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 31.0 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 43652b811f1f6c4b53de9bf2f396c54df17591f6b632353f78982ad55cb40cb0
MD5 4fdde93c870714ea9f9ea85cc8b634fe
BLAKE2b-256 404dc22baf0b70194d366e62483ff0bcb9208967aa94a9414a293dd79139a2a4

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