Skip to content

jesserobertson/earthchem-pyclient

Repository files navigation

Earthchem & PyData

PyPI GitHub license

This project wraps the Earthchem web services to provide easy access to geochemical data from IEDA in ready-to-use format in your favourite PyData environment.

Maintainer: Jess Robertson (jesse.robertson at csiro.au)

Service master develop
Test status Build Status Build Status
Test coverage Codecov branch Codecov branch

So why would I want to use this?

Run this example in a live Jupyter notebook: Binder

Say you wanted to know how many Archean-aged samples have been submitted to IEDA by your colleague named Dr S Barnes:

>>> import earthchem
>>> q = earthchem.Query(
        author='barnes',
        geologicalage='archean'
    )
>>> q.count()
876

Nice, let's take a look at the compositions of these

>>> df = q.dataframe(max_rows=500)
>>> df.head()
Downloading pages: 100%|██████████| 10/10 [00:04<00:00,  2.24it/s]

Table output

Hmm looks like Dr Barnes is a bit of a komatiite expert

>>> fig = df.mgo.hist()
>>> fig.set_xlabel('MgO (wt %)')
>>> fig.set_ylabel('Sample count')

Plot output

Maybe we'd like to see this as a ternary plot instead...

>>> earthchem.plot.ternaryplot(df, components=['mgo', 'al2o3', 'cao'])

Plot output

Great, I'm sold. How do I get it?

Provided you have python installed, this library is just a pip install earthchem away.

If you don't have Python we recommend taking a look at the marvellous Anaconda distribution - just pick your relevant platform download from here.