dwca

command module
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 4 Imported by: 0

README

DwCA is an app and a Go library to deal with Darwin Core Archive files.

Fast reader and writer of Darwin Core Archive Files. For now only checklist files are supported.

Installation

Homebrew on Mac OS X, Linux, and Linux on Windows (WSL2)

TLDR:

```bash
brew tap gnames/gn
brew install dwca
```

Homebrew is a popular package manager for Open Source software originally developed for Mac OS X. Now it is also available on Linux, and can easily be used on MS Windows 10 or 11, if Windows Subsystem for Linux (WSL) is installed.

Note that Homebrew requires some other programs to be installed, like Curl, Git, a compiler (GCC compiler on Linux, Xcode on Mac). If it is too much, go to the Linux and Mac without Homebrew section.

  1. Install Homebrew according to their instructions.

  2. Install dwca with:

    brew tap gnames/gn
    brew install dwca
    # to upgrade
    brew upgrade dwca
    
Manual Install

dwca consists of just one executable file, so it is pretty easy to install it by hand. To do that download the binary executable for your operating system from the latest release.

Linux and Mac without Homebrew

Move dwca executable somewhere in your PATH (for example /usr/local/bin)

sudo mv path_to/gnfinder /usr/local/bin
Go

Install Go v1.22 or higher.

git clone git@github.com:/gnames/dwca
cd dwca
make tools
make install

Configuration

When you run dwca -V command for the first time, it will create a [dwca.yml][dwca.yml] configuration file.

This file should be located in the following places:

MS Windows: C:\Users\AppData\Roaming\dwca.yml

Mac OS: $HOME/.config/dwca.yml

Linux: $HOME/.config/dwca.yml

This file allows to set options that will modify behaviour of dwca according to your needs. It will spare you from entering the same flags for the command line application again and again.

Command line flags will override the settings in the configuration file.

It is also possible to setup environment variables. They will override the settings in both the configuration file and from the flags.

Settings Environment variables
RootPath DWCA_ROOT_PATH
OutputArchiveCompression DWCA_OUTPUT_ARCHIVE_COMPRESSION
OutputCSVType DWCA_OUTPUT_CSV_TYPE
JobsNum DWCA_JOBS_NUM

Usage

Usage as a command line app

To see flags and usage:

dwca --help
# or just
dwca

To see the version of its binary:

dwca -V

Normalizing DwCA file

dwca normalize input_file.zip  <output.zip>
## change number of concurrent jobs
dwca normalize -j 100 input_file.zip  <output.zip>
## change to comma-separated format for the output
dwca normalize -c csv input_dwca.zip
## change to a `tar.gz` archive
dwca normalize -a tar input_dwca.zip

If output path is not given, the output will be {input file name}.norm.zip or {input file name}.norm.tar.gz

Development

To install the latest dwca

git clone git@github.com:/gnames/dwca
cd gnfinder
make tools
make install

Testing

To avoid conflicts in filesystem run tests in sequential order.

go test -p 1 -count=1 ./...

Documentation

Overview

Copyright © 2024 Dmitry Mozzherin <dmozzherin@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
internal
pkg
ent/eml
package eml contains structures that represent the EML file format.
package eml contains structures that represent the EML file format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL