Skip to main content

PyThermoDB Settings is a Python package that acts as an interface between PyThermDB and other applications, providing robust, Pydantic-based data models and configuration structures for managing thermodynamic database (ThermoDB) settings.

Project description

⚗️ PyThermoDB Settings

PyPI Downloads PyPI Version Supported Python Versions License

📖 Introduction

PyThermoDB Settings is a Python package that acts as an interface between pythermdb and other applications, providing robust, Pydantic-based data models and configuration structures for managing thermodynamic database (ThermoDB) settings.

✨ Features

  • 🧪 Component Modeling:

    Define chemical components with attributes such as name, formula, state (gas, liquid, solid, aqueous), and mole fraction.

  • 🌡️ Condition Models:

    Represent temperature and pressure conditions with unit validation.

  • ⚙️ Component Configuration:

    TypedDict-based configuration for databook, table, mode, and custom labels.

  • 📚 Reference Models:

    • ReferenceThermoDB: Structure for reference thermodynamic databases, including references, contents, configs, rules, and label management.
    • ComponentReferenceThermoDB: Links a component to its reference database.
    • ReferencesThermoDB: Handles multiple references and their configurations.
  • 📏 Rule Management:

    Define and manage rules for components using dictionary-based structures.

  • Extensible and Validated:

    All models use Pydantic for input validation and extensibility.

💾 Installation

Install via pip (after packaging):

pip install pythermodb_settings

🚀 Usage Example

from pythermodb_settings.models import Component, Temperature, Pressure

# component example
component = Component(
		name="Water",
		formula="H2O",
		state="l",
		mole_fraction=1.0
)

# condition examples
temperature = Temperature(value=298.15, unit="K")
pressure = Pressure(value=1.0, unit="atm")

📝 API Documentation

🧩 Models

  • Component

    • name: str — Name of the component
    • formula: str — Chemical formula
    • state: Literal['g', 'l', 's', 'aq'] — State (gas, liquid, solid, aqueous)
    • mole_fraction: float — Mole fraction (default 1.0)
  • Temperature

    • value: float — Temperature value
    • unit: str — Unit (e.g., 'K', 'C', 'F')
  • Pressure

    • value: float — Pressure value
    • unit: str — Unit (e.g., 'bar', 'atm', 'Pa')
  • ComponentConfig

    • databook: str — Name of the databook
    • table: str — Table name
    • mode: str — Mode (e.g., 'DATA', 'EQUATION')
    • label: str — Optional label
    • labels: dict[str, str] — Optional labels
  • ReferenceThermoDB

    • reference: Dict[str, List[str]] — References and contents
    • contents: List[str] — Reference contents
    • configs: Dict[str, ComponentConfig] — Reference configs
    • rules: Dict[str, ComponentRule] — Reference rules
    • labels, ignore_labels, ignore_props: Optional label/property management
  • ComponentReferenceThermoDB

    • component: Component
    • reference_thermodb: ReferenceThermoDB
  • ReferencesThermoDB

    • Handles multiple references, contents, configs, rules, and label management

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request to improve the project.

📝 License

This project is licensed under the MIT License. You are free to use, modify, and distribute this software in your own applications or projects. However, if you choose to use this app in another app or software, please ensure that my name, Sina Gilassi, remains credited as the original author. This includes retaining any references to the original repository or documentation where applicable. By doing so, you help acknowledge the effort and time invested in creating this project.

❓ FAQ

For any questions, contact me on LinkedIn.

👨‍💻 Authors

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

pythermodb_settings-0.2.1.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

pythermodb_settings-0.2.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file pythermodb_settings-0.2.1.tar.gz.

File metadata

  • Download URL: pythermodb_settings-0.2.1.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for pythermodb_settings-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2db71445066880c27930d5e1a1fd599c1dbd3be156ec88ff59660d071405281e
MD5 f7cdb3d5cc61769fe0e4cd41231de65d
BLAKE2b-256 ee5bfaff48a27d6deae45eebe14ec08ad33710d1f47a15bbe50e6e869471b103

See more details on using hashes here.

File details

Details for the file pythermodb_settings-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pythermodb_settings-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad27bb8ce7dc40a40de266b8af4502f23403e9e5b284b1b3a2df2334b1e48cf2
MD5 c4c31e9583514b259c6b0f5dbb033922
BLAKE2b-256 0225422b77fe2a40fea6d3e31ba22a0baca08d150a66cdd09123cd761b3833fe

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