{ "info": { "author": "Michael Dorman", "author_email": "mjdorma+reststore@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Other Audience", "License :: OSI Approved :: Apache Software License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Security", "Topic :: System :: Monitoring" ], "description": "Introduction to reststore \n*************************\n\nWhy reststore?\n\n reststore is used by my friends and I as a simple way to share and store\n samples of malware. Large volumes of files are what we're in it for. The\n advantage we get from using reststore is in its ability to return slices \n of hashes based on chronological ordering of data insert. It implements\n a simple yet powerful fetch, cache, and store pattern that makes handling\n large volumes of data a trivial problem. \n \nWhat is reststore:\n\n * A convenient way to store large quantities of data.\n * Ability to access data locally or access it via a server hosting the\n reststore webapp. \n * Chain together multiple webapp servers until they reach the single\n authoritative reststore webapp.\n\nWhat's in reststore: \n\n * A simple interface called Files which gives full control over and access\n to reststore's capabilities. \n * Flexible configuration to support more complex deployments of reststore.\n * A set of command line operations to get, put, and list data.\n * A RESTful webapi so data can be accessed in a client agnostic manner. \n\n\n\nProject hosting provided by `github.com`_.\n\n\nInstall\n=======\n\nSimply run the following::\n\n > python setup.py install\n \nor `PyPi`_:: \n\n > pip install reststore\n \n\nGetting started\n===============\n\n\nCoding with reststore\n---------------------\nFiles and FilesClient are the two main classes used to access data from a store.\n\nA local session:: \n\n $ ipython\n\n In [1]: import reststore\n\n In [2]: files = reststore.Files()\n\n In [3]: files.\n files.get files.hash_len files.put \n files.hash_func files.index files.select \n\n In [3]: files.put(\"test data\")\n Out[3]: 'eb733a00c0c9d336e65691a37ab54293'\n\n In [4]: files.put(\"test with some more data\")\n Out[4]: 'a99fb3880c8ac126b3cf6163aa965305'\n\n In [5]: files.put(\"test with some more data... and more\")\n Out[5]: 'e93a9d514c57f96d158864754f1ca330'\n\n In [6]: files['e93a9d514c57f96d158864754f1ca330']\n Out[6]: u'/tmp/files/00195/00065/3'\n\n In [7]: files.select(2,-1)\n Out[7]: ['e93a9d514c57f96d158864754f1ca330']\n\n In [8]: files.select(1,-1)\n Out[8]: [a99fb3880c8ac126b3cf6163aa965305', e93a9d514c57f96d158864754f1ca330']\n\n In [9]: for hexdigest in files:\n ...: print hexdigest \n ...: \n eb733a00c0c9d336e65691a37ab54293\n a99fb3880c8ac126b3cf6163aa965305\n e93a9d514c57f96d158864754f1ca330\n\nThe exact same code above will work using the FilesClient class which will\nseamlessly interface with a reststore webapp server.\n\n\nConfiguring reststore\n---------------------\n\nreststore has a very simple configuration system. Configuration is applied\nin the following order:\n\n * defaults from reststore.config\n * /etc/reststore.yaml\n * ~/reststore.yaml\n * environ <- each config value is written RESTSTORE_[INTERFACE]_[NAME]=Value\n\nExample of the default config::\n\n $ cat ~/.reststore.yaml \n \n client: {uri: 'http://127.0.0.1:8586/'}\n files: {assert_data_ok: false, hash_function: md5, name: files, root: /tmp, tune_size: 100000000}\n webapp: {debug: false, host: 127.0.0.1, port: 8586, proxy_requests: false, quiet: false,\n server: wsgiref}\n \n\nCommand line interface\n----------------------\n\nExploring the command line interface should expose the core features of\nreststore::\n\n $ reststorei -h\n\n NAME reststore - control over the reststore \n\n SYNOPSIS\n reststore [COMMAND]\n\n Commands:\n get [FILE-OPTIONS] [HEXDIGEST]\n Return a filepath to the data behind hexdigest. \n\n arguments \n HEXDIGEST of the data to lookup in reststore. \n\n read [FILE-OPTIONS] [HEXDIGEST] > stdout\n Attempt to retrieve a file and write it out to stdout. A check is\n made in the local reststore first, if the file is in available, an\n attempt to read the file from the web reststore is made. \n \n arguments \n HEXDIGEST of the data to lookup in reststore. \n\n put [FILE-OPTIONS] FILEPATH(s) \n Put a file into the reststore. \n \n arguments \n Path(s) of files to be loaded into the reststore.\n\n unzip [OPTIONS FILE-OPTIONS] ZIPFILE \n Extra files from a zipfile straight into the reststore. \n \n arguments \n A path to the zip file to extract into the reststore.\n\n options\n --password=\n Define a password for unzipping the zip file.\n --flush=1000 \n Number of files to read into memory before flushing through\n to the reststore.\n\n list [OPTIONS FILE-OPTIONS] \n list out hexdigests found in the reststore. \n \n options\n --select=[A:B]\n List all of the hashes between A:B. Hashes are stored\n chronologically. 0 is the first file inserted, -1 is the last\n file inserted. i.e. select the last 1000 hexdigests -1001:-1\n\n len [FILE-OPTIONS]\n print out the number of files stored in the reststore. \n \n web [OPTIONS FILE-OPTIONS] [[HOST:][PORT]] \n Run the RESTful web app.\n \n arguments \n HOST:PORT defaults to 127.0.0.1:8586\n\n options\n --server=wsgiref\n Choose the server adapter to use.\n --debug=False \n Run in debug mode.\n --quiet=False\n Run in quite mode.\n --proxy_requests=False\n If True, this web app will proxy requests through to \n the authoritative server defined by the client uri.\n\n File options:\n --name=files\n Set the default reststore name (i.e. domain or realm) \n --hash_function=md5\n Set the hash function to be used\n --tune_size=100000000\n Set the approximate size the reststore may grow up to.\n --root=/tmp\n Set the root for the reststore.\n --assert_data_ok=False\n Do extra checks when reading and writing data.\n --weboff\n This flag forces access to a local repository only.\n --uri=http://170.0.229.223:8586/\n The uri to the upstream reststore web server.\n\n\n\nIssues\n======\n\nSource code for *reststore* is hosted on `GitHub\n`_. \nPlease file `bug reports `_\nwith GitHub's issues system.\n\n\nChange log\n==========\n\nversion 0.0.1 (08/06/2013)\n \n * unzip insert and bulk put\n\nversion 0.0.0 (06/05/2013)\n\n\n\n\n\n.. _github.com: https://github.com/provoke-vagueness/reststore\n.. _PyPi: http://pypi.python.org/pypi/reststore", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/provoke-vagueness/reststore", "keywords": null, "license": "Apache Software Licence", "maintainer": null, "maintainer_email": null, "name": "reststore", "package_url": "https://pypi.org/project/reststore/", "platform": "cygwin,win,linux", "project_url": "https://pypi.org/project/reststore/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/provoke-vagueness/reststore" }, "release_url": "https://pypi.org/project/reststore/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "RESTful datastore. A simple way to store large amounts of average sized files.", "version": "0.0.2" }, "last_serial": 773620, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "cdd9be9b836f87ca6b1e5d3ee80b88f5", "sha256": "af36dc68361c5d292da9f5d37e91f02e864e39442a1171d9fc57ec57e5d3f011" }, "downloads": -1, "filename": "reststore-0.0.0.tar.gz", "has_sig": false, "md5_digest": "cdd9be9b836f87ca6b1e5d3ee80b88f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16833, "upload_time": "2013-06-05T13:50:13", "url": "https://files.pythonhosted.org/packages/3f/bd/f62bdaeba5ff9ea9c964d1bebb330cae1b75811a3ea346937db39d4f3899/reststore-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "b4595281415b165712d9b94fbfaeba55", "sha256": "bed0d76873bb1536962a65ecc4b2c7bb02d03ea539327e7aa47ea5abfb19f78c" }, "downloads": -1, "filename": "reststore-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b4595281415b165712d9b94fbfaeba55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18096, "upload_time": "2013-06-08T13:35:03", "url": "https://files.pythonhosted.org/packages/28/66/69c8402614892ce12bc90915da2bc871064c4a90b8b4e90b513d7669c371/reststore-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "329b53dc6ee0268d07c21f55bcecc3f6", "sha256": "fd1125b440152ed86c8b5f1a4647a829ec4864df902cfd476bdd54c90d29d106" }, "downloads": -1, "filename": "reststore-0.0.2.tar.gz", "has_sig": false, "md5_digest": "329b53dc6ee0268d07c21f55bcecc3f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18168, "upload_time": "2013-06-18T10:27:07", "url": "https://files.pythonhosted.org/packages/95/d8/30cf607a02554e2f51edc36078561275decc00687032d41389bcd0ad0350/reststore-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "329b53dc6ee0268d07c21f55bcecc3f6", "sha256": "fd1125b440152ed86c8b5f1a4647a829ec4864df902cfd476bdd54c90d29d106" }, "downloads": -1, "filename": "reststore-0.0.2.tar.gz", "has_sig": false, "md5_digest": "329b53dc6ee0268d07c21f55bcecc3f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18168, "upload_time": "2013-06-18T10:27:07", "url": "https://files.pythonhosted.org/packages/95/d8/30cf607a02554e2f51edc36078561275decc00687032d41389bcd0ad0350/reststore-0.0.2.tar.gz" } ] }