{"id":23473015,"url":"https://github.com/caltechlibrary/caltechdata_api","last_synced_at":"2025-04-14T18:42:25.661Z","repository":{"id":59849067,"uuid":"87960443","full_name":"caltechlibrary/caltechdata_api","owner":"caltechlibrary","description":"Python library for using the CaltechDATA API","archived":false,"fork":false,"pushed_at":"2025-04-07T22:57:06.000Z","size":18308,"stargazers_count":11,"open_issues_count":4,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-12T22:06:52.003Z","etag":null,"topics":["inveniordm"],"latest_commit_sha":null,"homepage":"https://caltechlibrary.github.io/caltechdata_api/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caltechlibrary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null}},"created_at":"2017-04-11T17:17:44.000Z","updated_at":"2025-04-07T22:57:09.000Z","dependencies_parsed_at":"2023-02-18T11:07:47.956Z","dependency_job_id":"e53f18e8-ef42-41de-a30b-84e90c5748d2","html_url":"https://github.com/caltechlibrary/caltechdata_api","commit_stats":{"total_commits":273,"total_committers":6,"mean_commits":45.5,"dds":"0.39560439560439564","last_synced_commit":"3906e1606bfdb71476589243b217fc1fd1d1bd95"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fcaltechdata_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fcaltechdata_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fcaltechdata_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caltechlibrary%2Fcaltechdata_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caltechlibrary","download_url":"https://codeload.github.com/caltechlibrary/caltechdata_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248938377,"owners_count":21186396,"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":["inveniordm"],"created_at":"2024-12-24T17:14:43.538Z","updated_at":"2025-04-14T18:42:25.647Z","avatar_url":"https://github.com/caltechlibrary.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CaltechDATA API Python Library\n\n[![DOI](https://img.shields.io/badge/dynamic/json.svg?label=DOI\u0026query=$.pids.doi.identifier\u0026uri=https://data.caltech.edu/api/records/wfjr5-kw507/versions/latest)](https://data.caltech.edu/records/wfjr5-kw507/latest)\n\nThe `caltechdata_api` Python library provides a convenient interface for interacting with the CaltechDATA API. It allows users to write files, create DataCite 4 standard JSON records, edit existing records, and retrieve metadata from the CaltechDATA repository.\n\n## Features\n\n### Writing and Editing Records\n- `caltechdata_write`: Writes files and a DataCite 4 standard JSON record to the CaltechDATA repository.\n- `caltechdata_edit`: Edits existing records in CaltechDATA.\n\n### Metadata Operations\n- `get_metadata`: Retrieves metadata from CaltechDATA records.\n\n## Requirements\n\n- Python 3.6+\n\n## Installation\n\nInstall the library via pip:\n\n```shell\npip install caltechdata_api\n```\n\n## Examples\n\nThere are some example python scripts in the GitHub repository.\n\n### Create a record:\n\n```shell\npython write.py example.json -fnames logo.gif\n# Output: pbkn6-m9y63 (unique identifier)\n```\n\u003e The response will be the unique identifier for the record. You can put this at\nthe end of a url to visit the record (e.g.\nhttps://data.caltechlibrary.dev/records/pbkn6-m9y63)\n\n### Edit a record \nMake changes to the example.json file to see a change)\n```\npython edit.py example.json -id pbkn6-m9y63\n10.33569/pbkn6-m9y63\n```\n\u003e The response is the DOI for the record, which includes the unique identifier\nfor the record in the default configuration.\n\n## Using Custom DOIs \nSome groups have worked with the library to create custom DOIs. These can be\npassed in the metadata like:\n\n```shell\npython write.py example_custom.json -fnames logo.gif\nm6zxz-p4j22\n```\n\nAnd then you can edit with\n```\npython edit.py example_custom.json -id m6zxz-p4j22\n10.5281/inveniordm.1234\n```\n\nThis returns the custom DOI of the record if it is successful.\n\n\n## Setup and Authentication\n\n1. Acquire a personal access token from your CaltechDATA account (found under \"Applications\" at the top right of your screen).\n2. Copy the token to a file named token.bash.\n3. Load the token in the command line using source token.bash.\n\n## Note on Testing\n\nOnly test your application on the test repository (`data.caltechlibrary.dev`).  Testing the API on the public \nrepository will generate junk records that are annoying to delete.\n\n## Using the Command Line Interface\n\nIf you would like to interact with the CaltechDATA API using the Command line Interface (CLI), please [see the detailed documentation](https://caltechlibrary.github.io/caltechdata_api/caltechdata_api/cli-documentation-for-users).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechlibrary%2Fcaltechdata_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaltechlibrary%2Fcaltechdata_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaltechlibrary%2Fcaltechdata_api/lists"}