Skip to main content

CaltechDATA API Python Library

DOI

The 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.

Features

Writing and Editing Records

  • caltechdata_write: Writes files and a DataCite 4 standard JSON record to the CaltechDATA repository.
  • caltechdata_edit: Edits existing records in CaltechDATA.

Metadata Operations

  • get_metadata: Retrieves metadata from CaltechDATA records.

Requirements

  • Python 3.9+

Installation

Install the library via pip:

pip install caltechdata_api

Or add it to a uv project:

uv add caltechdata_api

You can also run a script using uv:

uv run write.py

Examples

There are some example python scripts in the GitHub repository.

Create a record:

uv run write.py example.json -fnames logo.gif
# Output: pbkn6-m9y63 (unique identifier)

The response will be the unique identifier for the record. You can put this at the end of a url to visit the record (e.g. https://data.caltechlibrary.dev/records/pbkn6-m9y63)

Edit a record

Make changes to the example.json file to see a change)

uv run edit.py example.json -id pbkn6-m9y63
10.33569/pbkn6-m9y63

The response is the DOI for the record, which includes the unique identifier for the record in the default configuration.

Using Custom DOIs

Some groups have worked with the library to create custom DOIs. These can be passed in the metadata like:

uv run write.py example_custom.json -fnames logo.gif
m6zxz-p4j22

And then you can edit with

uv run edit.py example_custom.json -id m6zxz-p4j22
10.5281/inveniordm.1234

This returns the custom DOI of the record if it is successful.

Setup and Authentication

  1. Acquire a personal access token from your CaltechDATA account (found under "Applications" at the top right of your screen).
  2. Copy the token to a file named token.bash.
  3. Load the token in the command line using source token.bash.

Note on Testing

Only test your application on the test repository (data.caltechlibrary.dev). Testing the API on the public repository will generate junk records that are annoying to delete.

Using the Command Line Interface

If you would like to interact with the CaltechDATA API using the Command line Interface (CLI), please see the detailed documentation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

caltechdata_api-2.2.1.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

caltechdata_api-2.2.1-py3-none-any.whl (49.1 kB view details)

Uploaded Python 3

File details

Details for the file caltechdata_api-2.2.1.tar.gz.

File metadata

  • Download URL: caltechdata_api-2.2.1.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for caltechdata_api-2.2.1.tar.gz
Algorithm Hash digest
SHA256 f873af5094723af3f47c05f9dec49b81ec1295c91b834125d30011b4b33617bd
MD5 c3099b62ed888278d1dac95ffd6e0a84
BLAKE2b-256 31d2cd78705c1cddac59dc0115d328c8c119e133e3dcea6c8284ea45941c9e54

See more details on using hashes here.

File details

Details for the file caltechdata_api-2.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for caltechdata_api-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a560b7ee965d7435ac458d6034502114f3e75647db5366ddb1a4a1d49cd8e976
MD5 d81efe8df417436ffcb6a0e09733a8a2
BLAKE2b-256 38117216d3cbda5bd0b86f63ff9cf49d85fc968d4882fa2bb5681ef595054717

See more details on using hashes here.

Release history Release notifications | RSS feed

2.2.2

2 files

This release

2.2.1 This release

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.11.0

2 files

1.10.6

2 files

1.10.5

2 files

1.10.4

2 files

1.10.3

2 files

1.10.2

2 files

1.10.1

2 files

1.10.0

2 files

1.9.1

2 files

1.9.0

2 files

1.8.2

2 files

1.8.1

2 files

1.8.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.5

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

3 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page