Skip to main content

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 of str and Path for file paths
  • ConfigDict: Dictionary for storing arbitrary configuration data
  • BlenderObject: Type alias for Blender objects (gracefully handles non-Blender environments)
  • BlenderCollection: Type alias for Blender collections
  • 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

  • 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

carlee_tools-1.0.0.tar.gz (20.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.0.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

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

Hashes for carlee_tools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 68be0ea8087dee22a6c74d0ee27e97f7293248db81e6aa6522198dbd7ed4bfb2
MD5 b714f534ac0038bd39fbb51b143f3536
BLAKE2b-256 800e4cf76225c05587315eb3d3d55a5a4d30525bc089e3704c821f1c29785a6b

See more details on using hashes here.

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

Hashes for carlee_tools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8028ebd831fadb4c2345317d8ce6cbe21940d47e0dd19ad878d5f05055c89f6
MD5 e5a529c5f49002c7aff11020666299d1
BLAKE2b-256 ddd2cd0dfb32489702bb64690b4fa57c9fa4afe0051248b54a09cd21a6b420d1

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