Also it is possible to pull your existing data frame into a data package:

You can easily load resources from a data package as Pandas data frames by simply using datapackage.push_datapackage function:

Storage

Package implements Tabular Storage interface.

We can get storage this way:

>>> from jsontableschema_pandas import Storage >>> storage = Storage ()

Storage works as a container for Pandas data frames. You can define new data frame inside storage using storage.create method:

>>> storage . create ( 'data' , { ... 'primaryKey' : 'id' , ... 'fields' : [ ... { 'name' : 'id' , 'type' : 'integer' }, ... { 'name' : 'comment' , 'type' : 'string' }, ... ] ... }) >>> storage . buckets [ 'data' ] >>> storage [ 'data' ] . shape ( 0 , 0 )

Use storage.write to populate data frame with data:

>>> storage . write ( 'data' , [( 1 , 'a' ), ( 2 , 'b' )]) >>> storage [ 'data' ] id comment 1 a 2 b

Also you can use tabulator to populate data frame from external data file:

>>> import tabulator >>> with tabulator . Stream ( 'data/comments.csv' , headers = 1 ) as stream : ... storage . write ( 'data' , stream ) >>> storage [ 'data' ] id comment 1 a 2 b 1 good

As you see, subsequent writes simply appends new data on top of existing ones.