Skip to main content

a Python library to work with the echemdb repository

Project description

Binder DOI

The echemdb Python package can interact with a database of frictionless datapackages containing electrochemical data following echemdb's metadata schema. Such a database can be generated from the data on echemdb.org or from local files.

Detailed installation instructions, description of the modules, advanced usage examples, including local database creation, are provided in our documentation.

Installation instructions

Install the latest stable version of echemdb from PyPI or conda.

pip install echemdb
conda install -c conda-forge echemdb

Python API

The currently available data shown on echemdb.org can be downloaded and stored in a database.

>>> from echemdb.cv.cv_database import CVDatabase
>>> db = Database()

Filtering the database for entries having specific properties, e.g., containing Pt as working electrode material, returns a new database.

>>> db_filtered = db.filter(lambda entry: entry.system.electrodes.working_electrode.material == 'Pt')

A single entry can be retrieved with the identifiers provided on the website (see for example engstfeld_2018_polycrystalline_17743_f4b_1)

>>> entry = db['engstfeld_2018_polycrystalline_17743_f4b_1']

Each entry has a set of descriptors such as its source or the electrochemical system.

>>> entry.source # or entry['source']
{'citation key': 'engstfeld_2018_polycrystalline_17743', 'curve': 1, 'url': 'https://doi.org/10.1002/chem.201803418', 'figure': '4b', 'version': 1}

The data related to an entry can be returned as a pandas dataframe (values are provided in SI units).

>>> entry.df
           t	        E	       j
0	0.000000	-0.196962	0.043009
1	0.011368	-0.196393	0.051408
...

The dataframe can be returned with custom or original figure axes' units by rescaling the entry.

>>> entry.rescale({'E' : 'mV', 'j' : 'uA / m2'}).df
          t           E             j
0  0.000000 -196.961730  43008.842162
1  0.011368 -196.393321  51408.199892
...
>>> entry.rescale('original').df
          t         E         j
0  0.000000 -0.196962  4.300884
1  0.011368 -0.196393  5.140820
...

The units and reference electrodes can be found in the resource schema. The units are updated upon rescaling an entry.

>>> entry.package.get_resource('echemdb')['schema']
{'fields':
[{'name': 't', 'unit': 's', 'type': 'number'},
{'name': 'E', 'unit': 'V', 'reference': 'RHE', 'type': 'number'},
{'name': 'j', 'unit': 'A / m2', 'type': 'number'}]}

The data can be visualized in a plotly figure:

>>> entry.plot()

License

The contents of this repository are licensed under the GNU General Public License v3.0 or, at your option, any later version.

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

echemdb-0.5.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

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

echemdb-0.5.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file echemdb-0.5.0.tar.gz.

File metadata

  • Download URL: echemdb-0.5.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for echemdb-0.5.0.tar.gz
Algorithm Hash digest
SHA256 941f52e01319dd89eb6f26beacd99fdbc88079fc257134624f24b2fe3facab66
MD5 678bc6b107efbde3f9759efa8c452de4
BLAKE2b-256 119bece6f3bc1ff817e6c2f55f02bbf931a0996248d4e2c46445806a13b76046

See more details on using hashes here.

File details

Details for the file echemdb-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: echemdb-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for echemdb-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cabda81b4515f4571c1f908d1751cb7674414712ef1156f79f3de028b6053561
MD5 9c32760eb9e659114e73fc1d45cbc551
BLAKE2b-256 40cb46dd28c82102cbf306d90173d470d7d5d48b668883cad8b7cf04fe4e0e94

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