Skip to main content

MAFW Tools

PyPI License pipeline status coverage report

A set of commonly used tools to be used with MAFw and other data analysis frameworks.

This package is often used as an incubator for tools that sooner or later will gain the stability and the required completeness to be included into MAFw.

Table of Contents

Installation

Install the package using pip:

pip install mafw-tools

Or install in development mode:

pip install -e .

Features

This package provides utility functions for:

  • File Operations: Pickle serialization/deserialization with support for compressed files
  • Plotting Tools: Flexible image plotting with customizable axes, titles, and colorbars
  • Generic Utilities: Helper functions for common operations like nested attribute retrieval

Usage

Import the package or the modules to enjoy the tools.

File tools example

from mafw_tools.file_tools import save_to_pickle, load_from_pickle

# Save multiple objects to a pickle file
data = {'key': 'value'}
save_to_pickle('data.pkl', zipped=True, my_data=data)

# Load objects from pickle file
loaded_data = load_from_pickle('data.pkl')

Plotting tools example

import matplotlib.pyplot as plt
import numpy as np
from mafw_tools.plotting_tools import plot_image

fig, ax = plt.subplots()
data = np.random.rand(10, 10)
plot_image(data, ax, title="Sample Image", attach_colorbar=True)
plt.show()

Generic tools example

from mafw_tools.generic_tools import getattr_nested

class First:
    def __init__(self, a):
        self.a = a

class Second:
    def __init__(self, b):
        self.b = First(b)

m = Second(3)
value = getattr_nested(m, 'b.a')  # Returns 3

Documentation

Full documentation is available at https://gitlab.jrc.ec.europa.eu/jrc-projects/autorad/mafw-tools

Contributing

Contributions are welcome! Please follow these steps:

  • Fork the repository
  • Create a feature branch
  • Commit your changes
  • Push to the branch
  • Create a Pull Request

Metadata

Release files for mafw-tools 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mafw-tools 1.0.0
File Size Uploaded Provenance Actions
mafw_tools-1.0.0.tar.gz 264.5 kB Without provenance Details for mafw_tools-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mafw-tools 1.0.0
File Interpreter ABI Platform Actions
mafw_tools-1.0.0-py3-none-any.whl Python 3 none any Details for mafw_tools-1.0.0-py3-none-any.whl

Total release size: 276.7 kB

Release files / mafw_tools-1.0.0.tar.gz

Download URL mafw_tools-1.0.0.tar.gz
Size 264.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3592380a0cdabd641f7a5a70750418d0df5d4c2ab0cb2ab7c381f271aed4a59e
BLAKE2b-256 checksum
How to use checksums
d1a1b5dcf64486f13e1f5c7d9540b8d7b7f3adc62ee48b2cff31a05d1b8908f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / mafw_tools-1.0.0-py3-none-any.whl

Download URL mafw_tools-1.0.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
099ceaf7325775aedb16ba1d704fafcef5ea8adce525ff1481f1157a951a068a
BLAKE2b-256 checksum
How to use checksums
0c9c03d6b0b7a1b408003e8282fffdf0b570bbbccdfdc41ce08db5c5f7a38213
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Security for mafw-tools 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page