Skip to main content

Unofficial Python client for Camlistore.

This is a work in progress.

Camlipy try to behave exactly the same way that the original Camlistore Go client. It means you can download file uploaded with camput or the web ui, and file uploaded with Camlipy works well with the ui and camget.

Installation

$ sudo pip install camlipy

TODO

  • Handle symlink/hard link (inode)

  • Sharing support

  • Handle multi-claim in Claim

  • Check out Keep schema

  • Create a C extension for the rolling checksum part.

  • A read-only FUSE support?

Getting Started

from camlipy import Camlistore

c = Camlistore('http://localhost:3179')

# Basic put/get
my_blob = 'my blob'
blob_ref = c.put_blob(my_blob)

restored_blob = c.get_blob(blob_ref)

# Retrieve a blob
c.get_blob('sha1-0d31c43041edf303d9d136c918a1337abc9bde97')

# Dump blobs without metadata
c.put_blobs(['My Blob'])
# or
with open('/path/to/file', 'rb') as fh:
    c.put_blobs([fh])

# Put/restore files
c.put_file('/path/to/myfile')
# or
c.put_file(fileobj=open('/path/to/myfile'), permanode=True)

# Get as a fileobj (temporary file)
c.get_file('sha1-0d31c43041edf303d9d136c918a1337abc9bde97')
# Or get directly in a file
with open('/path/to/restored_file', 'wb') as fh:
    c.get_file('sha1-0d31c43041edf303d9d136c918a1337abc9bde97', fh)

# Put/restore directories
blob_ref = c.put_directory('/path/to/my/dir')
c.get_directory(blob_ref)

# Search blobs
c.search('tag:mytag')

Working the command line tool

Camlipy provide a basic command line utility, that let put/get blobs. It supports raw blob, file and directory.

$ camlipy config https://mycamlistorehost.com
$ camlipy put /path/to/file
$ camlipy put /this/path --permanode
$ camlipy get sha1-0d31c43041edf303d9d136c918a1337abc9bde97
$ camlipy get sha1-0d31c43041edf303d9d136c918a1337abc9bde97 --contents
$ echo 'My Blob' | camlipy put -

License (MIT)

Copyright (c) 2013 Thomas Sileo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for camlipy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for camlipy 0.1.1
File Size Uploaded
camlipy-0.1.1.tar.gz 18.4 kB Details

Release files / camlipy-0.1.1.tar.gz

Download URL camlipy-0.1.1.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fba9edeeee542542ed49b68a3b07b9ef0388622a618ac3948a23aeda5be5d7ba
BLAKE2b-256 checksum
How to use checksums
416f93a8c3306b7f9cccb0a92a51f54946a75e668f05366469c186c71f28c319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

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