<commit_before>==========
 CamliPy
==========

Unofficial Python client for `Camlistore <http://camlistore.org/>`_.

This is a work in progress.

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


TODO
====

- Download big files uploaded with filewriter.
- Handle symlink/hard link (inode)
- Handle multi-claim in ``Claim``
- Create a C extension for the rolling checksum part.

License (MIT)
=============

Copyright (c) 2013 <NAME>

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.
<commit_msg>Added a Getting Started section.<commit_after>=========
 CamliPy
=========

Unofficial Python client for `Camlistore <http://camlistore.org/>`_.

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.


TODO
====

- Handle symlink/hard link (inode)
- Handle multi-claim in ``Claim``
- Check out Keep schema
- Create a C extension for the rolling checksum part.


Getting Started
===============

.. code-block:: python

	from camlipy import Camlistore

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

	c.get_blob('sha1-0d31c43041edf303d9d136c918a1337abc9bde97')

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

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

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


Working the command line tool
-----------------------------

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

.. code-block:: console

	$ 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 <NAME>

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.

{'fraction_non_alphanumeric': 0.10438292964244521, 'fraction_numerical': 0.040945790080738176, 'mean_word_length': 4.43730407523511, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4059211', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1020, 'n_words': 431}