Core utilities, types, and plotting for atmospheric science
Project description
cloudy-core
Core utilities and type definitions for cloudy ecosystem of atmospheric modeling packages.
Overview
cloudy-core provides shared utilities and type definitions that are used across the cloudy ecosystem of atmospheric modeling and visualization packages. This package serves as a common dependency for other cloudy packages.
Features
- Type Definitions: Common type aliases for paths, configurations, and Blender objects
- 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
Installation
Install from a local copy:
pip install -e /path/to/cloudy-core
Usage
from cloudy_core import PathLike, dt_to_str, read_file, TwoWayDict
from cloudy_core.utils import current_dt_str
from cloudy_core.types_core import ConfigDict
# 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}})
Type Definitions
PathLike: Union ofstrandPathfor file pathsConfigDict: Dictionary for storing arbitrary configuration dataBlenderObject: Type alias for Blender objects (gracefully handles non-Blender environments)BlenderCollection: Type alias for Blender collectionsNumpyNumeric: 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
- typing-extensions (Python < 3.10)
Optional dependencies for full functionality:
- numpy
- xarray (for NetCDF support)
- pandas (for CSV support and enhanced datetime parsing)
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.0.0.tar.gz.
File metadata
- Download URL: carlee_tools-1.0.0.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68be0ea8087dee22a6c74d0ee27e97f7293248db81e6aa6522198dbd7ed4bfb2
|
|
| MD5 |
b714f534ac0038bd39fbb51b143f3536
|
|
| BLAKE2b-256 |
800e4cf76225c05587315eb3d3d55a5a4d30525bc089e3704c821f1c29785a6b
|
File details
Details for the file carlee_tools-1.0.0-py3-none-any.whl.
File metadata
- Download URL: carlee_tools-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.8 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 |
d8028ebd831fadb4c2345317d8ce6cbe21940d47e0dd19ad878d5f05055c89f6
|
|
| MD5 |
e5a529c5f49002c7aff11020666299d1
|
|
| BLAKE2b-256 |
ddd2cd0dfb32489702bb64690b4fa57c9fa4afe0051248b54a09cd21a6b420d1
|