{"id":31530204,"url":"https://github.com/frictionlessdata/frictionless-ckan-mapper","last_synced_at":"2025-10-04T01:19:27.015Z","repository":{"id":48189148,"uuid":"106801961","full_name":"frictionlessdata/frictionless-ckan-mapper","owner":"frictionlessdata","description":"🛠️  A library for mapping CKAN metadata \u003c=\u003e Frictionless metadata","archived":false,"fork":false,"pushed_at":"2022-11-30T19:59:27.000Z","size":221,"stargazers_count":9,"open_issues_count":7,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-21T10:15:42.799Z","etag":null,"topics":["ckan","frictionless","frictionlessdata"],"latest_commit_sha":null,"homepage":"https://frictionlessdata.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frictionlessdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-13T09:02:05.000Z","updated_at":"2022-11-24T04:56:41.000Z","dependencies_parsed_at":"2022-08-03T15:30:25.429Z","dependency_job_id":null,"html_url":"https://github.com/frictionlessdata/frictionless-ckan-mapper","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/frictionlessdata/frictionless-ckan-mapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frictionlessdata%2Ffrictionless-ckan-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frictionlessdata%2Ffrictionless-ckan-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frictionlessdata%2Ffrictionless-ckan-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frictionlessdata%2Ffrictionless-ckan-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frictionlessdata","download_url":"https://codeload.github.com/frictionlessdata/frictionless-ckan-mapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frictionlessdata%2Ffrictionless-ckan-mapper/sbom","scorecard":{"id":411436,"data":{"date":"2025-08-11","repo":{"name":"github.com/frictionlessdata/frictionless-ckan-mapper","commit":"794eaa33a01a2bb88d0d25279a94aeee92fde395"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/16 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T22:48:12.421Z","repository_id":48189148,"created_at":"2025-08-18T22:48:12.421Z","updated_at":"2025-08-18T22:48:12.421Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278252321,"owners_count":25956278,"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","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ckan","frictionless","frictionlessdata"],"created_at":"2025-10-04T01:19:15.053Z","updated_at":"2025-10-04T01:19:27.007Z","avatar_url":"https://github.com/frictionlessdata.png","language":"Python","readme":"# Frictionless CKAN Mapper\n\nA library for mapping CKAN metadata \u003c=\u003e Frictionless metadata.\n\nThe library has zero dependencies (not even on Data Package libs). You can use it directly or use it for inspiration. Detailed outline of the algorithm is in the docs or you can read the code.\n\n[![Travis](https://img.shields.io/travis/frictionlessdata/frictionless-ckan-mapper/master.svg)](https://travis-ci.org/frictionlessdata/frictionless-ckan-mapper)\n[![Coveralls](http://img.shields.io/coveralls/frictionlessdata/frictionless-ckan-mapper/master.svg)](https://coveralls.io/r/frictionlessdata/frictionless-ckan-mapper?branch=master)\n[![PyPi](https://img.shields.io/pypi/v/frictionless-ckan-mapper.svg)](https://pypi.python.org/pypi/frictionless-ckan-mapper)\n[![SemVer](https://img.shields.io/badge/versions-SemVer-brightgreen.svg)](http://semver.org/)\n[![Chat on Discord](https://img.shields.io/discord/695635777199145130)](https://discord.gg/2UgfM2k)\n\n\u003c!-- toc --\u003e\n\n- [Frictionless CKAN Mapper](#frictionless-ckan-mapper)\n  - [Installation](#installation)\n  - [Getting started](#getting-started)\n    - [CKAN =\u003e Frictionless](#ckan--frictionless)\n    - [Frictionless =\u003e CKAN](#frictionless--ckan)\n  - [Reference](#reference)\n    - [`ckan_to_frictionless`](#ckan_to_frictionless)\n      - [`resource(ckandict)`](#resourceckandict)\n      - [`dataset(ckandict)`](#datasetckandict)\n    - [`frictionless_to_ckan`](#frictionless_to_ckan)\n      - [`resource(fddict)`](#resourcefddict)\n      - [`package(fddict)`](#packagefddict)\n  - [Design](#design)\n    - [CKAN reference](#ckan-reference)\n    - [Algorithm: CKAN =\u003e Frictionless](#algorithm-ckan--frictionless)\n    - [Algorithm: Frictionless =\u003e CKAN](#algorithm-frictionless--ckan)\n  - [Developers](#developers)\n    - [Install the source](#install-the-source)\n    - [Run the tests](#run-the-tests)\n    - [Building and publishing the package](#building-and-publishing-the-package)\n      - [Build the distribution package locally for testing purposes](#build-the-distribution-package-locally-for-testing-purposes)\n      - [Test the package at test.pypi.org](#test-the-package-at-testpypiorg)\n      - [Tag a new Git release and publish to the official PyPi](#tag-a-new-git-release-and-publish-to-the-official-pypi)\n    \u003c!-- tocstop --\u003e\n\n## Installation\n\n- Python: install Python. The library is compatible with both Python 2.7+ and Python 3.3+.\n\n```bash\npip install frictionless-ckan-mapper\n```\n\n**Note:** The package is installed as `frictionless-ckan-mapper` and then imported as `frictionless_ckan_mapper`.\n\n## Getting started\n\n### CKAN =\u003e Frictionless\n\n```python\n# get a CKAN metadata item\nckan_dataset = {\n  \"name\": \"my-dataset\",\n  \"title\": \"My awesome dataset\",\n  \"url\": \"http://www.example.com/data.csv\"\n}\n\n# or load from an API e.g.\n# ckan_dataset = json.load(urllib.urlopen(\n#     https://demo.ckan.org/api/3/package_show?id=my_dataset\n# ))\n\nfrom frictionless_ckan_mapper import ckan_to_frictionless as converter\n\n# convert to frictionless\nfrictionless_package = converter.dataset(ckan_dict)\n\nprint(frictionless_package)\n```\n\n### Frictionless =\u003e CKAN\n\n```python\nfrictionless = {\n  'name': \"f11s-dataset\",\n  'path': \"https://datahub.io/data.csv\"\n}\n\nfrom frictionless_ckan_mapper import frictionless_to_ckan as f2c\n\nckanout = f2c.dataset(frictionless)\n\nprint(ckanout)\n```\n\n## Reference\n\nThis package contains two modules:\n\n- `frictionless_to_ckan`\n- `ckan_to_frictionless`\n\nYou can import them directly like so:\n\n```python\nfrom frictionless_ckan_mapper import ckan_to_frictionless\nfrom frictionless_ckan_mapper import frictionless_to_ckan\n```\n\n### `ckan_to_frictionless`\n\n#### `resource(ckandict)`\n\n```python\nfrom frictionless_ckan_mapper import ckan_to_frictionless as converter\n\n# ... Some code with a CKAN dictionary ...\n\noutput_frictionless_dict = converter.resource(ckan_dictionary)\n```\n\n#### `dataset(ckandict)`\n\n```python\nfrom frictionless_ckan_mapper import ckan_to_frictionless as converter\n\n# ... Some code with a CKAN dictionary ...\n\noutput_frictionless_dict = converter.dataset(ckan_dictionary)\n```\n\n### `frictionless_to_ckan`\n\n#### `resource(fddict)`\n\n```python\nfrom frictionless_ckan_mapper import frictionless_to_ckan as converter\n\n# ... Some code with a Frictionless dictionary ...\n\noutput_ckan_dict = converter.resource(frictionless_dictionary)\n```\n\n#### `package(fddict)`\n\n```python\nfrom frictionless_ckan_mapper import frictionless_to_ckan as converter\n\n# ... Some code with a Frictionless dictionary ...\n\noutput_ckan_dict = converter.package(frictionless_dictionary)\n```\n\n## Design\n\n```text\nFrictionless   \u003c=\u003e        CKAN\n--------------------------------------\nData Package   \u003c=\u003e   Package (Dataset)\nData Resource  \u003c=\u003e   Resource\nTable Schema   \u003c=\u003e   Data Dictionary?? (datastore resources can have schemas)\n```\n\n### CKAN reference\n\n**Summary:**\n\n- Class diagram below of key objects (without attributes)\n- Objects with their attributes in this spreadsheet: https://docs.google.com/spreadsheets/d/1XdqGTFni5Jfs8AMbcbfsP7m11h9mOHS0eDtUZtqGVSg/edit#gid=1925460244\n\n```mermaid\nclassDiagram\n\nclass Package\nclass Resource\nclass DataDictionary\n\nPackage *-- Resource\nResource o-- DataDictionary\n```\n\n![mermaid-diagram-20200703112520](https://user-images.githubusercontent.com/32682903/86486065-f9c08100-bd1f-11ea-8a1a-8f3befca0e6e.png)\n\nSource for CKAN metadata structure:\n\n- Dataset (Package): https://docs.ckan.org/en/2.8/api/index.html#ckan.logic.action.create.package_create\n  - `Package.as_dict` method: https://github.com/ckan/ckan/blob/2.8/ckan/model/package.py#L195-L223\n  - `package_show` ...\n\n* Resource: https://docs.ckan.org/en/2.8/api/index.html#ckan.logic.action.create.resource_create\n\n### Algorithm: CKAN =\u003e Frictionless\n\nSee the code in [`frictionless_ckan_mapper/ckan_to_frictionless.py`](./frictionless_ckan_mapper/ckan_to_frictionless.py)\n\n### Algorithm: Frictionless =\u003e CKAN\n\nSee the code in [`frictionless_ckan_mapper/frictionless_to_ckan.py`](./frictionless_ckan_mapper/frictionless_to_ckan.py)\n\n## Developers\n\n### Install the source\n\n- Clone the repo:\n\n  ```bash\n  git clone https://github.com/frictionlessdata/frictionless-ckan-mapper.git\n  ```\n\n- And install it with pip:\n\n  ```bash\n  pip install -e .\n  ```\n\n### Run the tests\n\nUse the excellent `pytest` suite as follows:\n\n```bash\npytest tests\n```\n\nTo test under both Python 2 and Python 3 environments, we use `tox`. You can run the following command:\n\n```bash\nmake test\n```\n\n**Note:** Make sure that the necessary Python versions are in your environment `PATH` (Python 2.7 and Python 3.6).\n\n### Building and publishing the package\n\nTo see a list of available commands from the `Makefile`, execute:\n\n```bash\nmake list\n```\n\n#### Build the distribution package locally for testing purposes\n\nIf a previous build exists, make sure to also remove it before building again:\n\n```bash\nmake distclean\n```\n\nThen:\n\n```bash\nmake dist\n```\n\nAlternatively, this command will accomplish the same to build packages for both Python 2 and Python 3:\n\n```bash\npython setup.py sdist bdist_wheel --universal\n```\n\n#### Test the package at test.pypi.org\n\n```bash\npython -m twine upload --repository testpypi dist/*\n```\n\nThe package will be publicly available at https://test.pypi.org/project/frictionless-ckan-mapper/ and you will be able to `pip install` it as usual.\n\n#### Tag a new Git release and publish to the official PyPi\n\nMake sure to update the version of the package in the file `frictionless_ckan_mapper/VERSION`. Then:\n\n```bash\nmake release\n```\n\nYou can quickly review the version to release with `make version`, which will print the current version stored in `VERSION`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrictionlessdata%2Ffrictionless-ckan-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrictionlessdata%2Ffrictionless-ckan-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrictionlessdata%2Ffrictionless-ckan-mapper/lists"}