Skip to main content

Data format for storing structured data in spreadsheet tables

Project description

https://travis-ci.org/Metatab/metatab.svg?branch=master

Parse and manipulate structured data and metadata in a tabular format.

Metatab is a data format that allows structured metadata – the sort you’d normally store in JSON, YAML or XML – to be stored and edited in tabular forms like CSV or Excel. Metatab files look exactly like you’d expect, so they are very easy for non-technical users to read and edit, using tools they already have. Metatab is an excellent format for creating, storing and transmitting metadata. For more information about metatab, visit http://metatab.org.

This repository has a Python module and executable. For a Javascript version, see the metatab-js repository.

What is Metatab For?

Metatab is a tabular format that allows storing metadata for demographics, health and research datasets in a tabular format. The tabular format is much easier for data creators to write and for data consumers to read, and it allows a complete data packages to be stored in a single Excel file.

Install

Install the package from PiPy with:

$ pip install metatab

Or, install the master branch from github with:

$ pip install https://github.com/CivicKnowledge/metatab.git

Then test parsing using a remote file with:

$ metatab -j https://raw.githubusercontent.com/CivicKnowledge/metatab/master/test-data/example1.csv

Run metatab -h to get other program options.

The test-data directory has test files that also serve as examples to parse. You can either clone the repo and parse them from the files, or from the Github page for the file, click on the raw button to get raw view of the flie, then copy the URL.

Running tests

Run python setup.py tests to run normal development tests. You can also run tox, which will try to run the tests with python 3.4, 3.5 and 3.6, ignoring non-existent interpreters.

Development Testing with Docker

Testing during development for other versions of Python is a bit of a pain, since you have to install the alternate version, and Tox will run all of the tests, not just the one you want.

One way to deal with this is to install Docker locally, then run the docker test container on the source directory. This is done automatically from the Makefile in metatab/test, just run:

$ cd metatab/test
$ make build # to create the container image
$ make test
# or just ..
$ make

You can also run the container shell, and run tests from the command line.

$ cd metatab/test
$ make build # to create the container image
$ make shell # to run bash the container

You now have a docker container where the /code directory is the metatab source dir.

Now, run tox to build the tox virtual environments, then enter the specific version you want to run tests for and activate the virtual environment.

# tox
# cd .tox/py34
# source bin/activate # Activate the python 3.4 virtual env
# cd ../../
# python setup.py test # Cause test deps to get installed
#
# python -munittest metatab.test.test_parser.TestParser.test_parse_everython  # Run one test

Note that your development environment is mounted into the Docker container, so you can edit local files and test the changes in Docker.

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

metatab-0.8.5.tar.gz (115.6 kB view details)

Uploaded Source

File details

Details for the file metatab-0.8.5.tar.gz.

File metadata

  • Download URL: metatab-0.8.5.tar.gz
  • Upload date:
  • Size: 115.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

File hashes

Hashes for metatab-0.8.5.tar.gz
Algorithm Hash digest
SHA256 597e6453ea7058319db83bba6a6e9e7f96921d106d43256c273e520c80f33bea
MD5 72a017d6f29bfab47cac4aaa2a8d8174
BLAKE2b-256 334cf5da4a00a7abd12b3b54f1fb206bb5e5de486e9d4f02f933c911ffa06e0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page