Skip to main content

Core utilities, types, and plotting for atmospheric science

Project description

carlee-tools

Core utilities, types, and plotting for atmospheric science.

Overview

carlee-tools provides shared utilities and type definitions that are used across the carlee ecosystem of atmospheric modeling and visualization packages. This package serves as a common dependency for other carlee packages.

Features

  • Type Definitions: Common type aliases for paths and configurations
  • Datetime Utilities: Functions for parsing and formatting datetime objects
  • File I/O: Convenient file reading/writing functions for common scientific data formats (NetCDF, CSV, pickle, NumPy)
  • Data Utilities: Helper functions for working with arrays, key-value pairs, and data structures
  • Plotting Utilities: Matplotlib helpers for creating publication-quality atmospheric science figures

Installation

Install from PyPI:

pip install carlee-tools

Or install from source:

pip install -e /path/to/carlee-tools

Usage

import carlee_tools
from carlee_tools import PathLike, dt_to_str, read_file, TwoWayDict
from carlee_tools.utils import current_dt_str
from carlee_tools.types_carlee_tools import ConfigDict
from carlee_tools.plotting import clean_legend, get_cmap

# Use datetime utilities
timestamp = current_dt_str()

# Read scientific data files
data = read_file("data.nc")  # Automatically uses xarray for .nc files

# Work with nested dictionaries
nested = TwoWayDict({'a': {'x': 1, 'y': 2}, 'b': {'x': 3, 'y': 4}})

# Create clean matplotlib legends
clean_legend()

Type Definitions

  • PathLike: Union of str and Path for file paths
  • NumpyNumeric: Union of NumPy integer and floating types

Key Utilities

Datetime Functions

  • dt_to_str(): Convert datetime-like objects to formatted strings
  • str_to_dt(): Parse datetime strings with flexible format detection
  • current_dt_str(): Get current time as formatted string

File I/O

  • read_file(): Automatically detect file type and read with appropriate library
  • write_file(): Write data with format detection

Data Structures

  • TwoWayDict: Dictionary accessor that allows indexing by outer or inner keys

Dependencies

Core dependencies:

  • numpy
  • matplotlib>=3.0
  • xarray
  • metpy
  • tqdm
  • imageio
  • typing-extensions (Python < 3.10)

Optional dependencies:

  • pandas (for enhanced CSV support)
  • netcdf4 (for NetCDF file writing)

License

MIT License

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

carlee_tools-1.2.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

carlee_tools-1.2.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file carlee_tools-1.2.0.tar.gz.

File metadata

  • Download URL: carlee_tools-1.2.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for carlee_tools-1.2.0.tar.gz
Algorithm Hash digest
SHA256 41fba496e723851be2fe0a2d308f7142e27ff718e6e3b33f4a0f198916fb67ae
MD5 92f699a11d370ae00ea4b480e3072d79
BLAKE2b-256 b1e939c96deda1c20ae4d50f62fcda0895a711f97c462b92d6d886b5e920e50a

See more details on using hashes here.

File details

Details for the file carlee_tools-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: carlee_tools-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for carlee_tools-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92d995ab5113567ed9a8ef20fade04becf5c8e52a300fe210c849d020326f7cc
MD5 cca76cd9f5abc5e6ac01de774a077da6
BLAKE2b-256 af3c67b338c1756c1f905bc1146a8d98ab197bb799d8a706adcda7c6117254fe

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