Skip to content

CivilWarGovernorsOfKentucky/cwgk_loader

Repository files navigation

CwgkLoader

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/cwgk_loader. To experiment with that code, run bin/console for an interactive prompt.

Installation

The gem is not published on RubyGem.org yet. For now, please build it locally.

Run this only if you haven't cloned the git repository yet.

git clone https://github.com/CivilWarGovernorsOfKentucky/cwgk_loader.git 

To get new updates and build the gem

cd cwgk_loader
git pull
gem build cwgk_loader.gemspec

Last, install the gem. Check the gem version that you've built. It is the last line of the output of the gem build cwgk_loader.gemspec command. Then run the following to install it.

gem install cwgk_loader-x.x.x.gem

Check if everything has been installed correctly - use command cwgk_loader

# cwgk_loader
Commands:
  cwgk_loader help [COMMAND]                   # Describe available commands or one specific command
  cwgk_loader upload [ID] -c, --config=CONFIG  # upload files. It can also upload a single file, or multiple files separated by ;.

Usage

First, set up github repository for TEI files

git clone https://github.com/CivilWarGovernorsOfKentucky/TestDocuments

Then create a config file. It should have the following format. Fill in with your settings.

API_ROOT=YOUR_API_ROOT_USUALLY_http://omeka_site/api
API_KEY=YOUR_API_KEY

GIT_ROOT_DIR=/path/to/TestDocuments/
GIT_USERNAME=your_git_username
[email protected]

# DATABASE
DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=omeka_db
DB_USERNAME=omeka_user
DB_PASSWORD=omeka_password

To upload a single file

cwgk_loader upload -c <config-file.txt> <tei> 

Replace <config-file.txt> with the path of your config file. Replace <tei> with the identifier of the tei file, or the file name. For example, to upload N00000247.xml, you can either use

cwgk_loader upload -c config.txt N00000247

or

cwgk_loader upload -c config.txt N00000247.xml

To upload multiple files, concatenate them with :. For example, the following will upload three files.

cwgk_loader upload -c config.txt N00000247:O00001186:KYR-0001-007-0306

Note that you can mix files with different entity types, or entity tei with document tei files.

About

Load TEI documents into CWGK omeka repository

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •