Skip to main content

pypofatu

A python package to curate Pofatu data.

Build Status PyPI

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypofatu-2.0.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

pypofatu-2.0.0-py2.py3-none-any.whl (22.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pypofatu-2.0.0.tar.gz.

File metadata

  • Download URL: pypofatu-2.0.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pypofatu-2.0.0.tar.gz
Algorithm Hash digest
SHA256 30b15b696c3b902913d9fa093846409fd7d849f26b09109943f4259ea59a49c9
MD5 84c22a1c9bb835a576e75f200c3de5b1
BLAKE2b-256 420d85d08f001e1e929ae0a1d6abfeeccadce4dae1d33c3f502cd226583c9cf5

See more details on using hashes here.

File details

Details for the file pypofatu-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pypofatu-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pypofatu-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 30037820c20fd8eb114f24b83c5d880d88d7fb2e301d1fa47bd904a62fd8d7d7
MD5 230b4bc58da3300fa2aac0bfd9adb1a9
BLAKE2b-256 36c519d69dff3999f7c79eb7df18cc92ff48fa8455c69e50a6b7930700962f19

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