Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A python wrapper for the CDStar API

Project Description

# pycdstar
Python client library for CDStar

[![Documentation Status](](
[![Build Status](](

## Usage

from pycdstar.api import Cdstar

# Initialize a client object, with connection info from a config file
cdstar = Cdstar()

# create a new object
obj = cdstar.get_object()
# with initially no associated metadata
assert obj.metadata is None

# assigning to the metadata property will create a metadata record
obj.metadata = {"creator": "pycdstar"}

# retrieve the now existing object
obj = cdstar.get_object(
assert 'creator' in obj.metadata

# again, initially the bitstreams property is an empty list
assert not obj.bitstreams

# we add a bitstream by uploading a local file
bitstream = obj.add_bitstream(fname='README.txt')
# and re-read the object
# a bitstreams read method returns an iterator to allow for streaming,
# i.e. chunked downloads
assert ''.join(list(
assert len(obj.bitstreams) == 1

# to make sure the newly created resources are properly indexed, we allow
# for a short delay

# now we search for a string we know to exist in the uploaded bitstream
res ='ssh')
assert len(res)
# the first element in the search results list has the bitstream as
# associated resource
assert 'ssh' in ''.join(list(res[0]

query = 'pycdstar'
res =, index='metadata')
assert len(res)
res =, index='fulltext')
assert not len(res)

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(19.4 kB) Copy SHA256 Hash SHA256
Source Oct 28, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting