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.1.1.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.1.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carlee_tools-1.1.1.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.1.1.tar.gz
Algorithm Hash digest
SHA256 99da8c4e0676ede75d325f1fec88a8dc4bae715aa184f9035b716b0ffa807c08
MD5 2f3035112756aa752d6355113f25c5b4
BLAKE2b-256 4af1d89a4ef2a17f35066dfbb41d9bad7ce694cdc32fcb14f1cae44fc1eca8ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: carlee_tools-1.1.1-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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0997b86e92c4bb5e4f9455ce524120860b0fd87ccda3dded6cc1754a88556e7
MD5 8ac696fe45392c44c5f2d9c010a9d68a
BLAKE2b-256 cb84710578765c05cd6f51674b627093d6bfc3072a7734432676c64798c5d051

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