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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mauztoolslib-0.1.1.tar.gz
  • Upload date:
  • Size: 4.1 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.tar.gz
Algorithm Hash digest
SHA256 389ed2c046abb9b1e42536049be1c4f1d2fb9acdf6ef74de031607d323254a23
MD5 72b530fb99ceceea4aa5e82d990d28e9
BLAKE2b-256 e1605700b3c5ab6b887a767b2a48e791ce992dc1c65ceb78b97e24d6254712e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mauztoolslib-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d760fda4da263abd01624eb0d1980c4deb714068a547e911a35156335aa1b6a6
MD5 1b23573fe51c0ab70947542f02179fa1
BLAKE2b-256 1e227b1bda57acabd855514b06172186cb89797fe1fd4e18666ef632d97f6e6c

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