Skip to main content

“DAI-Lab” An open source project from Data to AI Lab at MIT.

Development Status PyPI Shield Github Actions Shield Coverage Status

MetaData

This project aims to formally define a JSON schema which captures the structure of a relational database.

Install

Requirements

MetaData has been developed and tested on Python 3.5, 3.6, 3.7 and 3.8

Also, although it is not strictly required, the usage of a virtualenv is highly recommended in order to avoid interfering with other software installed in the system in which MetaData is run.

Install with pip

The easiest and recommended way to install MetaData is using pip:

pip install metad

This will pull and install the latest stable release from PyPi.

If you want to install from source or contribute to the project please read the Contributing Guide.

Quickstart

In this short tutorial we will guide you through a series of steps that will help you getting started with MetaData.

Creating Metadata Objects

You can also help create Metadata objects from scratch. The following code will create a MetaData object, add a table, and then save it to a JSON file.

from metad import MetaData

metadata = MetaData()

metadata.add_table({
    "id": "users",
    "name": "users",
    "primary_key": "id",
    "fields": [
        {"name": "id", "data_type": "id"},
        {"name": "name", "data_type": "text"}
    ],
})

Then, to export this object to a JSON file, you can run the following:

metadata.to_json("your_metadata.json")

Validating JSON Files

The core functionality of this library is to validate JSON files. The following code will load the metadata file for the hello_world dataset and validate it.

from metad import MetaData

metadata = MetaData.from_json("your_metadata.json")
metadata.validate()

What's next?

For more details about MetaData and all its possibilities and features, please check the documentation site.

History

0.0.1 (2020-06-08)

  • Populate data subtype in MySQL connector - Issue #11 by @k15z
  • Modifying the schema to support non-unique table names - Issue #13 by @k15z

0.0.1 (2020-05-22)

  • First release on PyPI.

Metadata

Release files for metad 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metad 0.0.2
File Size Uploaded
metad-0.0.2.tar.gz 54.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metad 0.0.2
File Interpreter ABI Platform
metad-0.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 66.7 kB

Release files / metad-0.0.2.tar.gz

Download URL metad-0.0.2.tar.gz
Size 54.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9b93f28364b2fbe78a00b83c6930210625a364020a26ec22cf0d3d378c2961b1
BLAKE2b-256 checksum
How to use checksums
f2f20497a2ebff8062715f9bac398ee89304624462be348babe02f4cd44ad530
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

Release files / metad-0.0.2-py2.py3-none-any.whl

Download URL metad-0.0.2-py2.py3-none-any.whl
Size 12.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
04d93d243fb09f881a7ab5aa77ff9c13956030a10be039196e940b9f6dc4df60
BLAKE2b-256 checksum
How to use checksums
5237912748222b9b1155aa94d5e9cbed0608e86c759c04c71a9d778431574679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page