Skip to main content

No project description provided

Project description

pyIonics Python Library Documentation

Installation

pip install pyionics

About package

This package is a specialized tool for downloading datasets from ilthermo.org, converting them to CSV or TSV files, merging datasets, and adding SMILES information to your data.

Why you should use this package?

  1. property ids update for each updating of ilthermo.org site
  2. Converting csv and tsv
  3. adding smiles
  4. clean dirty json data for converting to other formats
  5. merge datasets

Usage

First, import the library in your Python code:

import pyionics as pyi

Retrieve Idsets Data

Use the getIdsets function to retrieve data:

pyi.getIdsets(
    prop="",          # property short name (e.g., 'dens')
    data_path=None,   # optional: path to your data
    cmp="",           # component name (e.g., 'benzene')
    ncmp="0",         # component number: 0=all, 1=pure, 2=binary, 3=triple
    year="",          # publish year
    auth="",          # author name
    keyw=""           # keyword
)

getIdsets Parameters

Parameter Description Example
prop Property short name dens
cmp Component name benzene
ncmp Component number 1, 2, 3
year Publish year 2020
auth Author name Smith
keyw Keyword ionic
  • prop: Use the short version of the property name (see below).
  • ncmp: 0 = all, 1 = pure, 2 = binary, 3 = triple.

Retrieve Datasets

Use the getData function to retrieve specific datasets.
When you call getData, it will collect all datasets matching your criteria (using getIdsets internally) and save them as JSON files in a newly created data folder in your working directory.

pyi.getData(
    prop=None,        # property short name (e.g., 'dens')
    data_path=None,   # optional: path to your data
    cmp="",           # component name (e.g., 'benzene')
    ncmp="0",         # component number: 0=all, 1=pure, 2=binary, 3=triple
    year="",          # publish year
    auth="",          # author name
    keyw=""           # keyword
)

Note: getData has the same parameters as getIdsets. See the table above for details.

Property List

Only short versions of property names are available for the getIdsets and getData functions.

When you use getIdsets, the results are saved as a JSON file in a newly created data folder in your working directory. The output file is named {prop}_idsets_{other parameters}.json, where {prop} is the short property name and {other parameters} reflect your query criteria. The short property names correspond to those used in pyILT2.

Property Name ID Short
activity BPpY a
osmotic-coefficient VjHv phi
composition-at-phase-equilibrium dNip Xpeq
eutectic-composition MbEq Xeut
henrys-law-constant lIUh Hc
ostwald-coefficient eCTp L
tieline neae tline
upper-consolute-composition WbZo Xucon
critical-pressure BPNz Pc
critical-temperature rDNz Tc
lower-consolute-temperature qpSz
upper-consolute-pressure MvMG Pucon
upper-consolute-temperature bRXE Tucon
apparent-enthalpy cpbY Hap
apparent-molar-heat-capacity teHk capm
enthalpy-of-dilution rTYh Hdil
enthalpy-of-mixing-of-a-binary-solvent-with-component aeiA Hmix
enthalpy-of-solution VTiT
excess-enthalpy brzp Hex
partial-molar-enthalpy Sqxi Hpm
partial-molar-heat-capacity mFmK
enthalpy tnYd H
enthalpy-function kthO HvT
entropy qdUt S
heat-capacity-at-constant-pressure IZSt cp
heat-capacity-at-constant-volume KvgF cv
heat-capacity-at-vapor-saturation-pressure zJIE cpe
enthalpy-of-transition-or-fusion CXUw Hfus
enthalpy-of-vaporization-or-sublimation iaOF Hvap
equilibrium-pressure SwyC Peq
equilibrium-temperature ghKa Teq
eutectic-temperature lnrs Teut
monotectic-temperature LUaF Tmot
normal-melting-temperature NmYB Tm
interfacial-tension YQDr s
refractive-index bNnk n
relative-permittivity imdq rperm
speed-of-sound NlQd sos
surface-tension-liquid-gas ETUw slg
binary-diffusion-coefficient HooV
electrical-conductivity Ylwl econd
self-diffusion-coefficient jjnq Dself
thermal-conductivity pAFI Tcond
thermal-diffusivity KTcm Dterm
tracer-diffusion-coefficient vBeU Dtrac
viscosity PusA visc
normal-boiling-temperature hkog Tb
vapor-or-sublimation-pressure HwfJ
adiabatic-compressibility WxCH kS
apparent-molar-volume zNjL Vapm
density JkYu dens
excess-volume psRu Vex
isobaric-coefficient-of-volume-expansion hXfd aV
isothermal-compressibility Bvon kT
partial-molar-volume LNxL Vpm

Convert Functions

After retrieving datasets with an idsets request, the data is saved as a JSON file. The pyionics library provides functions to convert these JSON files to CSV or TSV formats using convert2csv and convert2tsv. Note that merging datasets and adding SMILES information require the data to be in CSV format.

Just write the folder name located inside the data folder; do not include data as the parent directory.To convert files, use the following functions:

Convert to CSV:

    pyi.convert2csv(folder_name='', file_name='')
    # Converts a JSON file to CSV format
    # Only one of the parameters (`folder_name` or `file_name`) is required.

Convert to TSV:

    pyi.convert2tsv(folder_name='', file_name='')
    # Converts a JSON file to TSV format
    # Only one of the parameters (`folder_name` or `file_name`) is required.

Add SMILES

Note : getSmiles function runs just csv files. Also for folder_name parameter it shoud start with csv_ (other case function do not works right).

    pyi.addSmiles(folder_name='', file_name='')

Merge datasets

MergeFIles is function to merge datasets in folder

    pyi.mergeFiles(folder_name)

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

pyionics-0.4.3.tar.gz (87.3 kB view details)

Uploaded Source

Built Distribution

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

pyionics-0.4.3-py3-none-any.whl (85.8 kB view details)

Uploaded Python 3

File details

Details for the file pyionics-0.4.3.tar.gz.

File metadata

  • Download URL: pyionics-0.4.3.tar.gz
  • Upload date:
  • Size: 87.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyionics-0.4.3.tar.gz
Algorithm Hash digest
SHA256 3875770e37d3fdac30b45338e3d7462bbb1cffad5cf1de8e8cde2c4607089e90
MD5 7a85ab836e4227e90909941546e98082
BLAKE2b-256 0c26e76d7328b758064db365aa07acf19cd62ff0b4628d8a0fa5ac38b8fe8308

See more details on using hashes here.

File details

Details for the file pyionics-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: pyionics-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 85.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyionics-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 99e814ab4a657a2cfaa3056a008f5a4a7d28856e0dfd126d547c37c44649a7ff
MD5 1d28578fa54ee771fcae4775e3e1f3d5
BLAKE2b-256 39666e25c840ae50a7ccfccf8b79a66daa9439a2e949bcaa66682aa0f5ab27dc

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