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 ofstrandPathfor file pathsNumpyNumeric: Union of NumPy integer and floating types
Key Utilities
Datetime Functions
dt_to_str(): Convert datetime-like objects to formatted stringsstr_to_dt(): Parse datetime strings with flexible format detectioncurrent_dt_str(): Get current time as formatted string
File I/O
read_file(): Automatically detect file type and read with appropriate librarywrite_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file carlee_tools-1.1.0.tar.gz.
File metadata
- Download URL: carlee_tools-1.1.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f84fc29809ce08e96f918cb72c50050f9d81b652936cab5f6c0734a44e0448a
|
|
| MD5 |
8631cc4f104c3be83917fa1c5b61f0e7
|
|
| BLAKE2b-256 |
af2916151d6bdf2280ca280bcd3b420ad5af26dfb6ead2f6537eb9607c6d879c
|
File details
Details for the file carlee_tools-1.1.0-py3-none-any.whl.
File metadata
- Download URL: carlee_tools-1.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77ecd4630200d1f49a330480775fe4e2cfff7b46952dd52d9c927bf4815fe58e
|
|
| MD5 |
1979ddc0cc5b7008b7ca2ae466832811
|
|
| BLAKE2b-256 |
bf3aa16e1331d130089748cd65c0e996270a2bf75ecb15a5c7dee7b7863d05a3
|