a Python library to work with the echemdb repository
Project description
The echemdb repository contains high quality experimental and theoretical data on electrochemical systems.
This module provides a Python library to interact with the data in the repository.
In the following we provide installation instructions for the echemdb module and a short summary of the basic usage of the Python API. Detailed installation instructions, description of the modules, advanced usage examples, including local database creation, are provided in our documentation.
Installation instructions
Clone the repository and install echemdb
pip install git+https://github.com/echemdb/echemdb.git
Python API
The current state of the website can be downloaded and stored in a database.
>>> from echemdb.cv.database import Database
>>> 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 information about its source
>>> 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}
Among other metadata, the entry also has information on the original publication's figure properties (entry.figure_description) and the entry.system in general.
The data related to an entry can be returned as a pandas dataframe (values are provided in SI units) and can be stored as a CSV file (or any other format supported by pandas).
>>> entry.df
t E j
0 0.000000 -0.196962 0.043009
1 0.011368 -0.196393 0.051408
...
>>> entry.df.to_csv('../testtesttest.csv', index=False)
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
Release history Release notifications | RSS feed
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 echemdb-0.2.0.tar.gz.
File metadata
- Download URL: echemdb-0.2.0.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
350c5775157c24f25fbff80ac23bf59f2aede68a7e811917fb7548644b1feac0
|
|
| MD5 |
5663aa7b2847708365801e7fa98a3304
|
|
| BLAKE2b-256 |
96c047cebf92618a7abce8cc574aac37646b3f9af67a2ecbe24dc910aafbf05f
|
File details
Details for the file echemdb-0.2.0-py3-none-any.whl.
File metadata
- Download URL: echemdb-0.2.0-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 pkginfo/1.8.2 readme-renderer/27.0 requests/2.27.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c349152c4fedf2ecca2046c89a17ddb7b441faf8d1a218b7603027fe4c5ec15
|
|
| MD5 |
64d0edcd54127f8d386cbbeb11e30e56
|
|
| BLAKE2b-256 |
3087f7ca552c5abc507e143ed4f2633b8158782657b1958a012dccb5478f3e32
|