Skip to main content

Table Data Sync

Project description

TABDANC (Table Data Sync)

Tabdanc 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
    {
      "table_name": "table_name"
    }
    
  • .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
    • The column name of the .td file must be the same as the header name of the .csv file
    {
      "columns": [
        {
          "name": "column_name1",
          "type": "int4"
        },
        {
          "name": "column_name2",
          "type": "varchar(255)"
        },
        ...
      ]
    }
    

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 tabdanc

Usage

Command Help

# help tabdanc command
$ tabdanc -h

Config Settings

First, you need to set config to use tabdanc

# help
$ tabdanc config -h

# create config file 
$ tabdanc config --create

# show config information
$ tabdanc config --list

# update config file
$ tabdanc 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
$ tabdanc update -h

# update table
$ tabdanc 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
$ tabdanc upload -h

# upload all files
$ tabdanc upload -a

# upload one file
$ tabdanc upload -f file_name

# upload multiple files
$ tabdanc 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
$ tabdanc download -h

# download all files
$ tabdanc download -a

# download one file
$ tabdanc download -f file_name

# download multiple files
$ tabdanc 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.

tabdanc-0.0.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file tabdanc-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: tabdanc-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6

File hashes

Hashes for tabdanc-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e8b709c718c88e87a13b8ce2ca31f9be19885cf3631338cb0c7916cece390b7
MD5 bebf5dd4b305b04e90df77421c11b2f3
BLAKE2b-256 8701e3a89435c575af053de7b08cc401cd6fab7f98f03e6280a00d9d8a31b3f6

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