All Projects → GSA → ckan-php-manager

GSA / ckan-php-manager

Licence: GPL-3.0 license
A tool for managing a CKAN data catalog

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to ckan-php-manager

calcardbackup
calcardbackup: moved to https://codeberg.org/BernieO/calcardbackup
Stars: ✭ 67 (+378.57%)
Mutual labels:  export
export-command
Exports WordPress content to a WXR file.
Stars: ✭ 12 (-14.29%)
Mutual labels:  export
great-migration
Copy objects from Rackspace to S3
Stars: ✭ 15 (+7.14%)
Mutual labels:  export
svelte-datagrid
Svelte data grid spreadsheet best best features and performance from excel
Stars: ✭ 48 (+242.86%)
Mutual labels:  export
Reports.JS
Stimulsoft Reports.JS is a reporting tool for Node.js and JavaScript applications.
Stars: ✭ 33 (+135.71%)
Mutual labels:  export
icingaweb2-module-pdfexport
PDF export functionality for Icinga Web 2
Stars: ✭ 27 (+92.86%)
Mutual labels:  export
importer-exporter
3D City Database client for high-performance import and export of 3D city model data
Stars: ✭ 104 (+642.86%)
Mutual labels:  export
evernote-backup
Backup & export all Evernote notes and notebooks
Stars: ✭ 104 (+642.86%)
Mutual labels:  export
Data-Export
Data-Export支持将链上数据导出到MySQL、ES等便于进行大数据处理的存储介质中,解决区块链数据复杂查询、分析、可视化和处理的问题。
Stars: ✭ 37 (+164.29%)
Mutual labels:  export
wechat-export
📃 Export WeChat chat histories to HTML files.
Stars: ✭ 585 (+4078.57%)
Mutual labels:  export
pockexport
Export/access your Pocket data, including highlights!
Stars: ✭ 124 (+785.71%)
Mutual labels:  export
ProcessMigrator
ProcessWire module that facilitates automated migration and sharing of page trees along with their templates and fields.
Stars: ✭ 29 (+107.14%)
Mutual labels:  export
skinner
Skin export / import tools for Autodesk Maya
Stars: ✭ 68 (+385.71%)
Mutual labels:  export
DataDefinitions
Data Definitions Plugin for Pimcore
Stars: ✭ 70 (+400%)
Mutual labels:  export
spreadsheet
Yii2 extension for export to Excel
Stars: ✭ 79 (+464.29%)
Mutual labels:  export
exitwp-for-hugo
Exitwp is tool primarily aimed for making migration from one or more Wordpress blogs to the Hugo blog engine as easy as possible.
Stars: ✭ 43 (+207.14%)
Mutual labels:  export
ExcelExport
Classes to generate Excel/CSV Report in ASP.NET Core
Stars: ✭ 39 (+178.57%)
Mutual labels:  export
browserexport
backup and parse browser history databases (chrome, firefox, safari, and other chrome/firefox derivatives)
Stars: ✭ 54 (+285.71%)
Mutual labels:  export
elastic-query-export
🚚 Export Data from ElasticSearch to CSV/JSON using a Lucene Query (e.g. from Kibana) or a raw JSON Query string
Stars: ✭ 56 (+300%)
Mutual labels:  export
klatexformula
Generate images from LaTeX equations that you can drag and drop, copy and paste or save to disk.
Stars: ✭ 70 (+400%)
Mutual labels:  export

ckan-php-manager

Build Status Codacy Badge Join the chat at https://gitter.im/GSA/ckan-php-manager

A bunch of scripts to perform tasks using CKAN API and https://github.com/GSA/ckan-php-client

Requirements

Installation

Clone repository

$ git clone https://github.com/GSA/ckan-php-manager.git

Composer

Use composer to install/update dependencies

If you don't have Composer, install it:

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

Install dependencies:

$ composer install

Configuration

Copy config.sample.php to config.php. Update it with your custom values, if needed.

$ cp inc/config.sample.php inc/config.php

Usage

Export all packages by Agency name, including all Sub Agencies

  • Update cli/export_packages_by_org.php, editing the title of exported organization ORGANIZATION_TO_EXPORT
  • Run importer using php
    $ php cli/export_packages_by_org.php

Script is taking all terms, including sub-agencies from http://www.data.gov/app/themes/roots-nextdatagov/assets/Json/fed_agency.json and makes CKAN requests, looking for packages by these organization list.

Results can be found in /results/{timestamp} dir after script finished its work, including _{term}.log with package counts for each agency.

DMS legacy tag

To add tag add_legacy_dms_and_make_private to all datasets of some group:

  • Update ORGANIZATION_TO_TAG in the cli/add_legacy_dms_and_make_private.php
  • Double check CKAN_URL and CKAN_API_KEY for editing datasets
  • Run script
    $ php cli/add_legacy_dms_and_make_private.php

Assign groups and category tags to datasets

  • Put csv files to /data dir, with assign_<any-title>.csv (must have assign_ prefix) The format of these files must be: dataset, group, categories

    First line is caption, leave the first line in each file: dataset,group,categories

    Then put one dataset per line.

    1. Dataset can be: * Dataset url, ex. https://catalog.data.gov/dataset/food-access-research-atlas * Dataset name, ex. download-crossing-inventory-data-highway-rail-crossing * Dataset id

    2. Group just one group per line. If you need to add multiple groups, you must create another row in csv with same dataset and another group, because all the categories are tagged by current row group. Make sure your group exist in your CKAN instance (to list all existing groups, go to http://catalog.data.gov/api/3/action/group_list?all_fields=true , replacing catalog.data.gov with your CKAN domain)

    3. Categories one of multiple categories per current row group, separated by semicolon ;

    Example csv file:

    dataset, group, categories
    https://catalog.data.gov/dataset/food-access-research-atlas,Agriculture,"Natural Resources and Environment"
    aerial-image-of-alaskas-arctic-coastal-plain-1955,Climate,"Arctic; Arctic Ocean, Sea Ice and Coasts; Permafrost and Arctic Landscapes"
    28d30c1f-75a5-4042-b0fc-de26cc7d70f2,Climate,Arctic; Arctic Development and Transport
    
  • Double check CKAN_URL and CKAN_API_KEY for editing datasets, defined in inc/config.php

  • Run script

    $ php cli/tagging/assign_groups_and_tags.php
  • Detailed logs and results are stored in folder results/[time-stamp]_ASSIGN_GROUPS

Remove groups and category tags from datasets (revert previous script changes)

  • Prepare same csv file as for previous script, and put them to /data dir, with remove_<any-title>.csv
    $ php cli/tagging/remove_groups_and_tags.php
  • This command will remove listed categories from the dataset of the row. If an empty list of categories is provided, this command will remove the group and all categories from the dataset.

CKAN API DOCs

http://docs.ckan.org/en/latest/api/index.html

Docker setup

To minimize requirements on a system, we've added a minimal setup with docker-compose. This should replace the above usage instructions as the default workflow.

$ docker-compose build
$ docker-compose run --rm app php cli/harvest_stats_csv.php

Run the tests.

$ docker-compose run --rm app phpunit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].