{"id":15608480,"url":"https://github.com/hypercubed/chi-datapackage","last_synced_at":"2025-06-30T08:04:22.266Z","repository":{"id":57197857,"uuid":"63518114","full_name":"Hypercubed/chi-datapackage","owner":"Hypercubed","description":"Project-chi Datapackage normalization... and more.","archived":false,"fork":false,"pushed_at":"2016-12-01T07:18:22.000Z","size":215,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T09:07:26.025Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/Hypercubed/Project-Chi","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hypercubed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-17T06:29:46.000Z","updated_at":"2016-12-05T13:56:57.000Z","dependencies_parsed_at":"2022-09-16T13:12:23.021Z","dependency_job_id":null,"html_url":"https://github.com/Hypercubed/chi-datapackage","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fchi-datapackage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fchi-datapackage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fchi-datapackage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fchi-datapackage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hypercubed","download_url":"https://codeload.github.com/Hypercubed/chi-datapackage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246194812,"owners_count":20738748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T05:21:03.313Z","updated_at":"2025-03-29T14:25:20.235Z","avatar_url":"https://github.com/Hypercubed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chi-datapackage\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n\n\u003e A utility library for working with [Data Package files](http://frictionlessdata.io/guides/data-package/) in Node and the browser.\n\u003e Designed for use in [Project χ](https://github.com/Hypercubed/Project-Chi).\n\n## Features\n\n* DataPackage and resource loader (node and browser compatible).\n* DataPackage and resource normalizer.\n* Resource translators (tsv, csv, yaml, json, etc).\n* JSON Table Schema processor (include type casting).\n* Customizable loader, mime-types, translators, and data-types.\n* Generates an observable Data Package data store.\n\n## Goals\n\n* A set of utilities for working with DataPackages and JSON Table Schema.\n* Be a core component of [Project χ](https://github.com/Hypercubed/Project-Chi) but work independently.\n* Maximize compliance with the the DataPackages and JSON Table Schema specifications.\n\n## Install\n\n```sh\nnpm install --save chi-datapackage\n```\n\nor\n\n```sh\njspm npm:chi-datapackage\n```\n\n## Basic usage\n\n```js\nimport dp from 'chi-datapackage';\n\ndp.makePackage('//datapackage/path/or/url').load()\n  .then(datapackage =\u003e {\n    /* so something */\n  });\n```\n\n## Advanced usage\n\n```js\nconst MimeLookup = require('mime-lookup');\n\nconst Normalizer = require('chi-datapackage/src/normalizer');\nconst Processor = require('chi-datapackage/src/processor');\nconst SchemaProcessor = require('chi-datapackage/src/schema');\nconst Loader = require('chi-datapackage/src/loader');\n\nconst mimeDb = require('chi-datapackage/src/lib/mime.json');         // or your custom mimeDb\nconst translators = require('chi-datapackage/src/lib/translators');  // or your custom translators\nconst types = require('chi-datapackage/src/lib/types');              // or your custom types\nconst fetch = require('chi-datapackage/src/lib/fetch');              // or your custom fetch promise\n\nconst mimeLookup = new MimeLookup(mimeDb);\nconst normalize = new Normalizer({mimeLookup});\nconst schemaProcessor = new SchemaProcessor({types});\nconst process = new Processor({translators, schemaProcessor});\nconst load = new Loader({fetch});\n\nload\n  .datapackage('//datapackage/path/or/url')\n  .then(p =\u003e normalize.datapackage(p))\n  .then(p =\u003e normalize.resources(p))\n  .then(p =\u003e load.resources(p))\n  .then(p =\u003e process.datapackage(p))\n  .then(p =\u003e {\n    /* so something */\n  });\n```\n\n## License\n\nCopyright (c) 2015-2016 RIKEN, Japan.\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n\n[npm-url]: https://npmjs.org/package/chi-datapackage\n[npm-image]: https://img.shields.io/npm/v/chi-datapackage.svg?style=flat-square\n\n[travis-url]: https://travis-ci.org/Hypercubed/chi-datapackage\n[travis-image]: https://img.shields.io/travis/Hypercubed/chi-datapackage.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Fchi-datapackage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypercubed%2Fchi-datapackage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Fchi-datapackage/lists"}