Skip to main content

Toolbox Python per l'analisi dei dati di laboratorio

Project description

mespy

Documentation: giancarmine-sparso.github.io/mespy

Small Python toolbox for mechanics laboratory data analysis.

mespy started as a set of helper functions that kept reappearing across mechanics lab notebooks and classroom scripts: loading CSV measurements, computing descriptive and weighted statistics, plotting histograms, and running linear fits with uncertainties. The library brings those recurring tasks together into a single typed package with a small public API that is easy to use in notebooks, scripts, and teaching material.

What It Provides

  • CSV loading with explicit missing-data policies
  • Descriptive and weighted statistics for one-dimensional data
  • Histogram plotting for quick exploratory analysis
  • Weighted linear fitting with a typed result object
  • Clear validation errors instead of silent nan propagation

Public API

The root package exports:

  • load_csv
  • median
  • weighted_mean
  • variance
  • covariance
  • standard_deviation
  • histogram
  • lin_fit

The root namespace stays intentionally small. Additional public types, such as mespy.fit_utils.LinearFitResult, live in submodules.

Installation

mespy requires Python >= 3.12.

pip install git+https://github.com/giancarmine-sparso/mespy.git

Development Setup

To set up a local development environment:

Unix / macOS

git clone https://github.com/giancarmine-sparso/mespy
cd mespy
make setup

To activate the virtual environment manually:

source .venv/bin/activate

Windows

git clone https://github.com/giancarmine-sparso/mespy
cd mespy
python -m venv .venv
.venv\Scripts\activate
pip install -e ".[dev]"

Documentation

The Sphinx source lives in docs/source, and the generated site is written to docs/build/html.

Build the documentation with:

make docs

The generated site includes both English and Italian outputs, with English as the default landing page. The documentation also includes usage examples for the available functions. Complete usage workflows and notebooks are available in docs/source/examples.

Project Structure

mespy/
├── .github/
│   └── workflows/          # automation for documentation publishing
├── data/
│   └── reference/          # reference datasets used by tests and examples
├── docs/
│   ├── source/             # Sphinx source, examples, and translations
│   ├── Makefile
│   └── make.bat
├── figures/                # exported example figures
├── src/
│   └── mespy/              # library package
├── tests/                  # pytest suite
├── tools/                  # release and smoke-test helpers
├── LICENSE
├── Makefile                # local setup, testing, release, and docs tasks
├── pyproject.toml          # package metadata and dependencies
├── README.md
└── uv.lock

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

mespy-1.1.8.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mespy-1.1.8-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file mespy-1.1.8.tar.gz.

File metadata

  • Download URL: mespy-1.1.8.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mespy-1.1.8.tar.gz
Algorithm Hash digest
SHA256 056b4fb8090cd7b4eacd441a00be14ef1f5947353d7cb8b87f82bc7ffea9e8d2
MD5 0254429e30c058d6deef70e6dd3228a7
BLAKE2b-256 e8f90cde84227194ca54af50e2495875d71fc1291b2c44ff9c2b848966491a8c

See more details on using hashes here.

File details

Details for the file mespy-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: mespy-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mespy-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3acb83cb0b5e7f7673fa98b34a8ca8097f41c57303e55f50768235aa54288a48
MD5 a875e011d2a300dfbed99c5fe43bffcd
BLAKE2b-256 a6f2d4e9d5b4520c520afc6c638ecc5e5f88b28b83571bc016c56da6ef817ee3

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