ts_dataset

This is a TypeScript module for interacting with datasetd targetting Deno

https://github.com/caltechlibrary/ts_dataset

Science Score: 52.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
    Organization caltechlibrary has institutional domain (www.library.caltech.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

This is a TypeScript module for interacting with datasetd targetting Deno

Basic Info
  • Host: GitHub
  • Owner: caltechlibrary
  • License: other
  • Language: JavaScript
  • Default Branch: main
  • Size: 1.27 MB
Statistics
  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 3
Created almost 2 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Support Codemeta

README.md

ts_dataset a TypeScript module for working with datasetd

The dataset project provides a JSON API for JSON object storage via the datasetd application. This repository hosts a TypeScript module targeting Deno for integrating datasetd JSON API managed dataset collections.

License Latest release

Table of contents

Introduction

The TypeScript ts_dataset module is for working with the JSON API provided by datasetd. There are two exported classes defined -- DatasetApiClient and Dataset. The first is a low level HTTP wrapper mapping basic dataset verbs to the JSON API. The later provides those verbs where the objects are TypeScript based. Most applications using dataset collections hosted via datasetd will use the latter class.

Here's a simple example of exercising some of the method available with the Dataset object. This demo code assumes datasetd running on localhost on port 8485 and a dataset set collection called "my_objects.ds" has been defined the in YAML configuration of datasetd.

~~~typescript import { Dataset } from "https://caltechlibrary.github.io/ts_dataset/mod.ts";

const port = 8485; const cname = "myobjects.ds";

const ds = new Dataset(port, c_name);

// Get a list of keys let keys = await ds.keys(); console.log(there are ${keys.length} object(s) found in ${c_name}); // Create a new object let key = "objectkeythree"; let obj = { "one": 1, "two": "number 2", "three": true, "updated": (new Date).toISOString() };

await ds.create(key, obj); keys = await ds.keys() console.log(there are now ${keys.length} object(s) found in ${c_name});

// Read back an object let nObj = await ds.read(key); console.log(this is the read object ${JSON.stringify(nObj, null, " ")});

// Update our object. obj.updated = (new Date).toLocaleString(); await ds.update(key, obj);

// Read back updated object nObj = await ds.read(key); console.log(this is the now our object ${JSON.stringify(nObj, null, " ")});

// Remove our object await ds.delete(key);

keys = await ds.keys() console.log(there are now ${keys.length} object(s) found in ${c_name}); ~~~

Installation

ts_dataset is a TypeScript module targeting Deno. Installation can be done via an import statement in your TypeScript module. You can also clone the GitHub repository at https://caltechlibrary.github.io/ts_dataset. The from value in your import statement should point to https://caltechlibrary.github.io/ts_dataset/mod.ts if you want to use it that way. Similarly you can add it to your project's deps.ts file with a line like.

~~~typescript export * from "https://caltechlibrary.github.io/ts_dataset/mod.ts"; ~~~

ts_dataset is only useful in conjunction with a running dataset web service. This is provided by datasetd available as part of installing dataset. See the GitHub repo https://github.com/caltechlibrary/dataset for more details.

Requirements

To (re)generate the website content clone this repository, change into it and run "make".

Run demo

I use tmux to run the demo. It's convenient. I start with one window and get everything setup and startup datasetd using a Deno task. Then I split the window and run the demo. Below is what I type to run the demo (comments indicate where to switch windows, explain actions).

~~~shell

Start up tmux

tmux

clone this repository and change directory

git clone https://github.com/caltechlibrary/tsdataset cd tsdataset

Use deno tasks to setup our test and demo dataset collections

deno task setup_datasets

Start the datasetd

deno task run_datasetd

Split the tmux window (e.g. Ctrl-b ") and run the demo

deno task demo ~~~

Known issues and limitations

  • this is a proof of concept only
  • only has small subset of dataset features
  • it is very experimental and subject to change
  • it is not suitable for production

Getting help

You can file a GitHub issue or reach out to the authors listed in the codemeta.json file. See SUPPORT file in this repository.

Contributing

Contributions and help are welcome. See CONTRIBUTING.md file in this repository.

License

Software produced by the Caltech Library is Copyright © 2024 California Institute of Technology. This software is freely distributed under a modified BSD 3-clause license. Please see the LICENSE file for more information.

Acknowledgments

This work was funded by the California Institute of Technology Library.


Caltech logo

Owner

  • Name: Caltech Library
  • Login: caltechlibrary
  • Kind: organization
  • Email: helpdesk@library.caltech.edu
  • Location: Pasadena, CA 91125

We manage the physical and digital holdings of the California Institute of Technology, provide services and training, and develop open-source software.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
title: "ts_dataset"
abstract: "A TypeScript module for interacting with datasetd"
authors:
  - family-names: Doiel
    given-names: R. S.
    orcid: "https://orcid.org/0000-0003-0900-6903"


maintainers:
  - family-names: Doiel
    given-names: R. S.
    orcid: "https://orcid.org/0000-0003-0900-6903"

repository-code: "https://github.com/caltechlibrary/ts_dataset"
version: 0.0.3
license-url: "https://github.com/caltechlibrary/ts_dataset/blob/main/LICENSE"
keywords: [ "software", "library", "typescript", "dataset" ]
date-released: 2024-07-17

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "name": "ts_dataset",
  "identifier": "ts_dataset",
  "description": "A TypeScript module for interacting with datasetd",
  "version": "0.0.4",
  "datePublished": "2024-07-17",
  "dateCreated": "2024-07-03",
  "dateModified": "2024-07-17",
  "author": [
    {
      "@type": "Person",
      "givenName": "R. S.",
      "familyName": "Doiel",
      "affiliation": {
        "@type": "Organization",
        "name": "California Institute of Technology Library"
      },
      "email": "rsdoiel@caltech.edu",
      "@id": "https://orcid.org/0000-0003-0900-6903"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "R. S.",
      "familyName": "Doiel",
      "affiliation": {
        "@type": "Organization",
        "name": "California Institute of Technology Library"
      },
      "email": "rsdoiel@caltech.edu",
      "@id": "https://orcid.org/0000-0003-0900-6903"
    }
  ],
  "funder": {
    "@id": "https://ror.org/05dxps055",
    "@type": "Organization",
    "name": "California Institute of Technology Library"
  },
  "copyrightHolder": [
    {
      "@id": "https://ror.org/05dxps055",
      "@type": "Organization",
      "name": "California Institute of Technology"
    }
  ],
  "copyrightYear": 2024,
  "license": "https://github.com/caltechlibrary/ts_dataset/blob/main/LICENSE",
  "isAccessibleForFree": true,
  "url": "https://github.com/caltechlibrary/ts_dataset",
  "codeRepository": "https://github.com/caltechlibrary/ts_dataset",
  "readme": "https://github.com/caltechlibrary/ts_dataset/blob/main/README.md",
  "releaseNotes": "https://github.com/caltechlibrary/ts_dataset/blob/main/CHANGES.md",
  "issueTracker": "https://github.com/caltechlibrary/ts_dataset/issues",
  "downloadUrl": "https://github.com/caltechlibrary/ts_dataset/archive/main.zip",
  "softwareHelp": "https://caltechlibrary.github.io/ts_typescript",
  "programmingLanguage": [
    {
      "@type": "ComputerLanguage",
      "name": "typescript",
      "version": "5.4.5"
    }
  ],
  "softwareRequirements": [
    "dataset >= 2.1.3",
    "Deno >= 1.44",
    "Pandoc >= 3.1",
    "GNU Make",
    "PageFind >= 1.1.0"
  ],
  "keywords": [
    "software",
    "library",
    "typescript",
    "dataset"
  ],
  "developmentStatus": "concept"
}

GitHub Events

Total
  • Push event: 3
Last Year
  • Push event: 3

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 2
  • Total pull requests: 0
  • Average time to close issues: 14 days
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 2
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: 14 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 1.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 2
  • Bot pull requests: 0
Top Authors
Issue Authors
  • github-actions[bot] (2)
Pull Request Authors
Top Labels
Issue Labels
bug (2)
Pull Request Labels

Dependencies

.github/workflows/static.yml actions
  • actions/checkout v4 composite
  • actions/configure-pages v5 composite
  • actions/deploy-pages v4 composite
  • actions/upload-pages-artifact v3 composite