pypofatu
A python package to curate Pofatu data.
Installation
Install pypofatu from PyPI running
pip install pypofatu
preferably in a new virtual environment, to keep your system's Python installation unaffected.
Installing pypofatu will also install a command line program pofatu, which provides
functionality to curate and query Pofatu data. Run
pofatu -h
for details on usage.
pypofatu operates on data as displayed by the Pofatu database. This
data curated in a GitHub repository which is accessed by pypofatu locally. Thus, in order to use
pypofatu you must clone the pofatu/pofatu-data repository or download
a release version.
Curation workflow
Check the data in the repository for consistency:
pofatu --repos PATH/TO/REPOS check
Create a distribution of the data:
pofatu --repos PATH/TO/REPOS dist
A distribution consists of
- a set of CSV files described by CSVW metadata
- an SQLite database created from the CSVW package
Querying
Exploratory analysis of the data is possible with off-the-shelf tools such as grep,
head etc. on the UNIX shell. More accurate analysis can be done with tools that exploit the
CSV structure, e.g. the tools from the csvkit package. Ultimate control and performance is
possible using the SQLite database.
The pofatu query command provides a convenience wrapper to query the database (once it has been
created via pofatu dist):
Run
pofatu --repos tests/repos/ dist
pofatu --repos tests/repos/ query .schema
to see the SQL schema of the database or
pofatu --repos tests/repos/ query "select count(*) from 'measurements.csv'"
INFO SQLite database at dist/pofatu.sqlite
count(*)
----------
78
to run simple queries. More complex queries can be written as SQL to a text file and run with
cat query.sql | pofatu --repos tests/repos/ query --format pipe -
| sample_id | sample_category | location_region | location_subregion | location_latitude | location_longitude | TiO2 [%] | Fe2O3 [%] |
|---|---|---|---|---|---|---|---|
| charleux2014_Eiao-1 | SOURCE | MARQUESAS | EIAO | -8.00 | -140.70 | 4.00 | 12.80 |
| charleux2014_Eiao-101 | SOURCE | MARQUESAS | EIAO | -8.00 | -140.70 | 4.90 | 13.30 |
| charleux2014_Eiao-102 | SOURCE | MARQUESAS | EIAO | -8.00 | -140.70 | 4.40 | 14.80 |
| charleux2014_Eiao-103 | SOURCE | MARQUESAS | EIAO | -8.00 | -140.70 | 4.40 | 14.00 |
Release files for pypofatu 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypofatu-2.0.0.tar.gz | 22.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pypofatu-2.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 45.2 kB
Release files / pypofatu-2.0.0.tar.gz
| Download URL | pypofatu-2.0.0.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30b15b696c3b902913d9fa093846409fd7d849f26b09109943f4259ea59a49c9
|
|
BLAKE2b-256 checksum How to use checksums |
420d85d08f001e1e929ae0a1d6abfeeccadce4dae1d33c3f502cd226583c9cf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / pypofatu-2.0.0-py2.py3-none-any.whl
| Download URL | pypofatu-2.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
30037820c20fd8eb114f24b83c5d880d88d7fb2e301d1fa47bd904a62fd8d7d7
|
|
BLAKE2b-256 checksum How to use checksums |
36c519d69dff3999f7c79eb7df18cc92ff48fa8455c69e50a6b7930700962f19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|