dacktool Library

0.0.7 · active · verified Fri Apr 17

dacktool is a collection of miscellaneous Python utilities designed to simplify common tasks related to file operations, data conversion (specifically JSON to dictionary), regular expression matching, and basic security functions like password hashing. Currently at version 0.0.7, it appears to be in early development with an infrequent release cadence.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use the `convert_json_to_dict` function for JSON string conversion and `write_file`/`read_file` for basic file operations. It creates a temporary file and cleans it up afterwards.

from dacktool.convert import convert_json_to_dict

json_data_string = '{"name": "Alice", "age": 30, "city": "New York"}'
python_dict = convert_json_to_dict(json_data_string)

print(f"JSON String: {json_data_string}")
print(f"Python Dictionary: {python_dict}")
print(f"Type of result: {type(python_dict)}")

# Example using files module (requires creating a dummy file)
from dacktool.files import write_file, read_file
import os

file_path = 'my_temp_file.txt'
content = 'Hello from dacktool!'

write_file(file_path, content)
read_content = read_file(file_path)

print(f"\nContent written to '{file_path}': {content}")
print(f"Content read from '{file_path}': {read_content}")

os.remove(file_path) # Clean up the dummy file

view raw JSON →