Code Monkey home page Code Monkey logo

metapack's Introduction

Metatab

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.

metapack's People

Contributors

ericbusboom avatar roll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

roll rkiyengar

metapack's Issues

Line and YAML Oriented Editing.

Implement reading and writing from line ( txt or toml ) and yaml oriented files.

On the CLI, if the user explicitly references an alternative file ( TOML or YAML ) the system will load the alternative. On save, it will save first to the alternative format, then save again to the CSV format.

Improve use of AppUrl

A lot of the use of AppUrl involves join() and .path, particularly in the cil code. These should be changed to use Url methods. .

Allow reading and writing metadata as lines

When reading a directory as a metatab package, check if there is a lines or YAML file that is newer than the .csv, and read those first.

When writing, write the CSV file ands the Lines or YAML file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.