This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# pycdstar
Python client library for CDStar

[![Documentation Status](https://readthedocs.org/projects/pycdstar/badge/?version=latest)](http://pycdstar.readthedocs.org/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/clld/pycdstar.svg?branch=master)](https://travis-ci.org/clld/pycdstar)
[![codecov.io](http://codecov.io/github/clld/pycdstar/coverage.svg?branch=master)](http://codecov.io/github/clld/pycdstar?branch=master)


## Usage

```python
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(obj.id)
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
obj.read()
# a bitstreams read method returns an iterator to allow for streaming,
# i.e. chunked downloads
assert ''.join(list(bitstream.read()))
assert len(obj.bitstreams) == 1

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

# now we search for a string we know to exist in the uploaded bitstream
res = cdstar.search('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].resource.read()))

query = 'pycdstar'
res = cdstar.search(query, index='metadata')
assert len(res)
res = cdstar.search(query, index='fulltext')
assert not len(res)
bitstream.delete()
obj.delete()
```
Release History

Release History

0.3.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pycdstar-0.3.2.tar.gz (19.4 kB) Copy SHA256 Checksum SHA256 Source Oct 28, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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