Skip to main content

Table Data Syncer

Project description

TABDANCE (Table Data Syncer)

Tabdance is a library that maintain and manage latest data.

Main Feature compares the .csv data stored in the database with the .csv file in local repository and if they are different, update the table with the latest data. (In this case, the latest data is the data in local repository)

Local repository must exist files, .csv, .meta, .td.
(If any of the three files is not exist, it will not be updated)

  • .csv: .csv file is the data file you want to maintain and manage.
  • .meta: .meta file is a json file in which the table name where the csv should be saved is written.
    • .meta file name must be the same as the .csv file name
    • column_match is an optional value. Set column_match when csv header and table column are different.
    • An error occurs if the csv_header is not in the .csv file or the table_column is not in the .td file.
    {
      "table_name": "table_name",
      "column_match": {
        "csv_header": "table_column",
        ...
      }
    }
    
  • .td: .td file is a json file in which table schema definitions(column name, coulmn type) are written.
    • .td file name must be the same as the table name
    {
      "columns": [
        {
          "name": "column_name1",
          "type": "int4",
          "primary_key": true
        },
        {
          "name": "column_name2",
          "type": "varchar(255)",
          "primary_key": false // same as not declared primary_key
        },
        ...
      ]
    }
    

There is one .td file per table, and multiple .csv files can be entered in one table. In this case, .meta files are created as many as the number of .csv files, and one .td file is created.

Additional Feature is that data files can be uploaded and downloaded by ssh connection between local repository and remote repository.

Getting Started

Built With

  • Python >= 3.8

Installation

$ pip install tabdance

Usage

Command Help

# help tabdance command
$ tabdance -h

Config Settings

First, you need to set config to use tabdance

# help
$ tabdance config -h

# create config file 
$ tabdance config --create

# show config information
$ tabdance config --list

# update config file
$ tabdance config --update {section.option} {value}

Table Update

You can use the update command to add the csv file to your database.
If the csv file stored in the database is changed, the changed csv file is updated to the database using the update command.

# help
$ tabdance update -h

# update table
$ tabdance update

File Upload / Download

When upload or download through the '-f' option, enter only the file name without the extension.
When enter upload or download command, files related to the file name are upload or download. ex) .csv .meta .td

Upload

If you use the upload command, you can upload files from the local repository to the remote repository.

# help
$ tabdance upload -h

# upload all files
$ tabdance upload -a

# upload one file
$ tabdance upload -f file_name

# upload multiple files
$ tabdance upload -f file_name1 file_name2

Download

If you use the download command, you can download files from the remote repository to the local repository.

# help
$ tabdance download -h

# download all files
$ tabdance download -a

# download one file
$ tabdance download -f file_name

# download multiple files
$ tabdance download -f file_name1 file_name2

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabdance-1.0.4-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file tabdance-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: tabdance-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for tabdance-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b3da77f3908dd4d30b294e01a2d58a4294b5831845247cf6f5df5af63c4953d8
MD5 62ff8f86053676a671ad0bf40eb3aab7
BLAKE2b-256 1fbbedcb92e9c31639df6cee1184d12949e064773e4c3a7c3fa4d76018dba09a

See more details on using hashes here.

Supported by

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