In [1]:
#2019-03-19 16:40:00.507134
%load_ext metapack.jupyter.magic
In [2]:
CACHE_DIR='/Users/eric/Library/Application Support/metapack/'
RESOURCE_NAME='df'
RESOLVED_URL='file:///Users/eric/proj/virt-proj/data-project/metatab-packages/example.com/example-ipynb/metadata.ipynb#df'
WORKING_DIR='/Users/eric/proj/virt-proj/data-project/metatab-packages/example.com/example-ipynb'
METATAB_DOC='metapack+file:///Users/eric/proj/virt-proj/data-project/metatab-packages/example.com/example-ipynb/metadata.ipynb'
METATAB_WORKING_DIR='/Users/eric/proj/virt-proj/data-project/metatab-packages/example.com/example-ipynb'
METATAB_PACKAGE='metapack+file:///Users/eric/proj/virt-proj/data-project/metatab-packages/example.com/example-ipynb/'
url='metadata.ipynb#df'
name='df'
description='Random UUIDs, integers and numbers'
In [3]:
METAPACK_BUILDING=True
An example data package, from the Metatab tutorial at https://github.com/CivicKnowledge/metatab-py/blob/master/README.rst
In [4]:
import seaborn as sns
import metapack as mp
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
%matplotlib inline
%load_ext metapack.jupyter.magic
sns.set_context('notebook')
mp.jupyter.init()
In [5]:
# Code goes after metadata, before schema
df = pd.DataFrame({
'rand': np.random.randint(0,100,1000)
})
In [6]:
Section: Schema|AltName|DataType|Description|Datatype
Table: simple-example
Table.Column: id
.Datatype: integer
Table.Column: uuid
.Datatype: string
Table.Column: int
.Datatype: integer
Table.Column: float
.Datatype: number
Table: df
Table.Column: rand
.Datatype: integer
In [ ]:
%mt_materialize df '/Users/eric/Library/Application Support/metapack/_materialized_data/example_data_package-2017-us-2'
In [ ]:
%mt_materialize_all '/Users/eric/Library/Application Support/metapack/_materialized_data/example_data_package-2017-us-2'
In [ ]:
%mt_show_metatab
In [ ]:
%mt_show_libdirs