{ "info": { "author": "amancevice", "author_email": "smallweirdnum@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Utilities" ], "description": "# fURI\n\n[![Build Status](https://travis-ci.org/amancevice/furi.svg?branch=master)](https://travis-ci.org/amancevice/furi)\n[![PyPI version](https://badge.fury.io/py/furi.svg)](https://badge.fury.io/py/furi)\n\nInteract with local & remote files by URI\n\n\n## Installation\n\n```\npip install furi # Install basic support\n\npip install furi[all] # Install AWS & SFTP dependencies\n\npip intsall furi[aws] # Install AWS dependencies\n\npip install furi[sftp] # Install SFTP dependencies\n```\n\n\n## Usage\n\n#### Reading Files\n\n```python\nimport furi\n\nwith furi.open('/path/to/some/file.ext') as local:\n print local.read()\n # => Hello, world!\n\nwith furi.open('file:///path/to/local/file.ext') as local:\n print local.read()\n # => Hello from Local file system\n```\n\nIf `furi` was installed with AWS dependencies S3 files can be read as well:\n\n```python\nwith furi.open('s3://bucket/path/to/key') as s3:\n print s3.read()\n # => Hello from S3!\n```\n\nSame for SFTP files:\n\n```python\nwith furi.open('sftp://user:pass@host/path/to/file.ext') as sftp:\n print sftp.read()\n # => Hello from SFTP\n\n```\n\n#### Walking Directories\n\n```python\n# Walk S3 key\nfor dirpath, dirnames, filenames in furi.walk('s3://bucket/path/to/key/'):\n print dirpath\n print dirnames\n print filenames\n\n# Walk S3 with supplied credentials\ncredentials = {\n 'aws_access_key_id' : '',\n 'aws_secret_access_key' : '' }\nfor dirpath, dirnames, filenames in furi.walk('s3://bucket/path/to/key/', **credentials):\n print dirpath\n print dirnames\n print filenames\n\n```\n\n## S3-backed files\n\nExample S3-file access:\n\n```python\n# Using ~/.boto or ENV variables to authenticate\ns3file = furi.open('s3://bucket/path/to/key')\n\n# Supply credentials\ns3file = furi.open('s3://bucket/path/to/key', \n aws_access_key_id='ACCESS', aws_secret_access_key='SECRET' )\n```\n\n\n## SFTP-backed files\n\nSupply the credentials as a part of the URI:\n\n```python\nsftpfile = furi.open('sftp://user:password@host/workdir/file.ext')\n```\n\nOr with a key:\n\n```python\nsftpfile = furi.open('sftp://user@host/workdir/file.ext', private_key='/path/to/ssh_id')\n```\n\n\n## Supported operations\n\n```python\n# Open a file in a supported open-mode\nwith furi.open('', mode='') as furifile: \n furifile.exists() # Test if file exists\n furifile.matches('regex pattern') # Match pattern to filename (not including path)\n furifile.read() # Read file contents' stream as string\n furifile.stream() # Get handle to file contents stream\n furifile.write('str or stream') # Write a string or stream to file\n furifile.connect(**credentials) # Connect to a remote file service (such as S3)\n```\n\n\n## Configurations/Mappings\n\nStructured JSON or YAML files can be loaded into a mapping object using the `furi.map()` function.\n\n\n### Local & S3 File Mapping\n\nMapping local or S3-backed file contents operations are not cached so every read has some cost to it. If numerous reads are expected it is recommended that the object is mapped into a dictionary. File-based mapping objects do not support write operations at this time.\n\n```python\nmymap = furi.map('s3://buket/path/to/mapping.json')\nmymap = furi.map('/path/to/local/mapping.yaml')\n\nprint mymap['key']\n# => \"Hello, world!\"\n\nprint mymap['otherkey'] # Reads file from S3 again\n# => \"Goodby, cruel world!\"\n\n# Reads the file once and caches it in `mymap`\nmymap = dict(furi.map('s3://buket/path/to/mapping.json')) \n```\n\n\n### DynamoDB Mapping\n\nSingle partition-key DynamoDB tables without sort-keys are also supported and use the URI format `\"dynamodb:///\"`. The returned mapping object can be queried like a dictionary.\n\n```python\nmynamo = furi.mapping('dynamodb://mytable/', region_name='us-east-1')\n\nprint mynamo['partition_key_value']\n# => { \"partition_key_name\" : \"partition_key_value\",\n# \"field1\": \"Hello, world!\",\n# \"field2\": \"Goodbye, cruel world!\" }\n```\n\n\n## Chained Mappings\n\nIt may be the case that you have a prioritized list of mapping files, where if a key cannot be found in the first map, the second is queried, then the third, and so on until a match is found or a `KeyError` is thrown. Use the `furi.chain()` function to chain mappings together.\n\n```python\nchains = 's3://bucket/path/to/map.yml', '/path/to/local.json'\nchainmap = furi.chain(*map(furi.map, chains))\n\nprint chainmap['key']\n# => \"Hello, world!\"\n\nprint chainmap['otherkey']\n# => WARNING:root:s3://bucket/path/to/map.yml :: KeyError('otherkey',)\n# \"Goodby, cruel world!\"\n```", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.smallweirdnumber.com", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "furi", "package_url": "https://pypi.org/project/furi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/furi/", "project_urls": { "Homepage": "http://www.smallweirdnumber.com" }, "release_url": "https://pypi.org/project/furi/0.7.0/", "requires_dist": null, "requires_python": "", "summary": "fURI File access through URIs.", "version": "0.7.0" }, "last_serial": 2208902, "releases": { "0.4.1": [ { "comment_text": "", "digests": { "md5": "1cf8c70d18216e584164aa087156de46", "sha256": "2a01075ad0c87bbb58142700f0efc5ff191412db436245425fcc0a0a89344364" }, "downloads": -1, "filename": "furi-0.4.1.tar.gz", "has_sig": false, "md5_digest": "1cf8c70d18216e584164aa087156de46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6405, "upload_time": "2016-02-18T20:15:49", "url": "https://files.pythonhosted.org/packages/d8/50/9bc5ed37209c64042dbdfb2517b46b1345b3e8d46b8490f3d7898c40041f/furi-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "f657ad811efa351e46d7817b7c53f1ff", "sha256": "71f7279fe1f37675c163b7a0992be861bc647730ade438a7142013e9fcf39c17" }, "downloads": -1, "filename": "furi-0.5.0.tar.gz", "has_sig": false, "md5_digest": "f657ad811efa351e46d7817b7c53f1ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8120, "upload_time": "2016-02-23T16:32:32", "url": "https://files.pythonhosted.org/packages/8e/80/ff68a0b49b32ce42938a6481ab86ae336846ffe347a650c155f0659bfa06/furi-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "caf7e6880c96be223ff162ef611c1ee9", "sha256": "54b9d0dc09ef6504eb3b768609ce16b49f747dba1631523e3f0be3e253427799" }, "downloads": -1, "filename": "furi-0.6.0.tar.gz", "has_sig": false, "md5_digest": "caf7e6880c96be223ff162ef611c1ee9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8406, "upload_time": "2016-02-29T16:02:26", "url": "https://files.pythonhosted.org/packages/85/d7/8772b42e2f94dbcd25cb47aafb5f34fac7495d864c8cdc6ab0dd6f2980f7/furi-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "38b98f60d9d5a8c954b7fdf0d2bec632", "sha256": "5b3f72d5164b7b0dd0003fdf7faca0dfa428574c88d5cb9aca735814b6020d30" }, "downloads": -1, "filename": "furi-0.6.1.tar.gz", "has_sig": false, "md5_digest": "38b98f60d9d5a8c954b7fdf0d2bec632", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8402, "upload_time": "2016-03-02T12:54:41", "url": "https://files.pythonhosted.org/packages/10/ff/2c9bc000f16f7f7253c39f36108e7620f7cac9b6518cd4b7c7d9bfc684d3/furi-0.6.1.tar.gz" } ], "0.6.10": [ { "comment_text": "", "digests": { "md5": "4d9b158537dcfe43b9f05b77fde4588c", "sha256": "d593265ea1f6d9f92e2712e148078a141fecb8116cceaf3863aff771c6c6e107" }, "downloads": -1, "filename": "furi-0.6.10.tar.gz", "has_sig": false, "md5_digest": "4d9b158537dcfe43b9f05b77fde4588c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9097, "upload_time": "2016-04-05T15:52:31", "url": "https://files.pythonhosted.org/packages/e2/7c/69e13ebeacc40c321c59f7a84c3ab5fe5ca7d8581af821cb9ac71bd3f42f/furi-0.6.10.tar.gz" } ], "0.6.11": [ { "comment_text": "", "digests": { "md5": "4ec4b73c248e8601b792d14c1c477ac9", "sha256": "d5a46fdfb7a0d63457e92edae52b35f41a2118fe4cbb0b139047fddeb240dc22" }, "downloads": -1, "filename": "furi-0.6.11.tar.gz", "has_sig": false, "md5_digest": "4ec4b73c248e8601b792d14c1c477ac9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9109, "upload_time": "2016-04-29T19:46:51", "url": "https://files.pythonhosted.org/packages/05/35/c9af260d4c22511a1f163441dbaad2ffd27fdcb63a62702c8d4e29e38af2/furi-0.6.11.tar.gz" } ], "0.6.12": [ { "comment_text": "", "digests": { "md5": "d021836b1f73853a7873a4f3e403d70a", "sha256": "b61e98d781254f5ee9bbdaf2c0586a9a589ca63a905d044cd68fc905737006ca" }, "downloads": -1, "filename": "furi-0.6.12.tar.gz", "has_sig": false, "md5_digest": "d021836b1f73853a7873a4f3e403d70a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9110, "upload_time": "2016-05-19T16:27:32", "url": "https://files.pythonhosted.org/packages/fd/7a/6f4137d5e188805e7445e041d24a08a29e62ac611258fd164f063973eb26/furi-0.6.12.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "c5becdf9dc5024842491d29466855375", "sha256": "f3611d474970df2026f12747437854f9a447ad0b80c3f7eeb851f39d951f0c53" }, "downloads": -1, "filename": "furi-0.6.2.tar.gz", "has_sig": false, "md5_digest": "c5becdf9dc5024842491d29466855375", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8406, "upload_time": "2016-03-02T15:08:19", "url": "https://files.pythonhosted.org/packages/b2/d1/1a7246423eaaacdb4076fa30eaa7c294da658d2b22a536d3936db2bd6a17/furi-0.6.2.tar.gz" } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "d7d68ab339c56d3e50bc7b8818b86460", "sha256": "0443dac63405545a0f4c53ca13887c93fa7e29c23627ae9c029da0d728904562" }, "downloads": -1, "filename": "furi-0.6.3.tar.gz", "has_sig": false, "md5_digest": "d7d68ab339c56d3e50bc7b8818b86460", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8493, "upload_time": "2016-03-02T19:47:08", "url": "https://files.pythonhosted.org/packages/0e/9c/e2ced21c2216531a39c1e04ad95b0796c74f6609dab0c109e2b644b1d657/furi-0.6.3.tar.gz" } ], "0.6.4": [ { "comment_text": "", "digests": { "md5": "57731102aac966dc8e36ec38f29a9d5b", "sha256": "5c6790af2294eba3f7bdc4604f3e3521569379c3373ef24a5a0845690fc2b800" }, "downloads": -1, "filename": "furi-0.6.4.tar.gz", "has_sig": false, "md5_digest": "57731102aac966dc8e36ec38f29a9d5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8589, "upload_time": "2016-03-03T15:38:00", "url": "https://files.pythonhosted.org/packages/f0/97/31328787a844ea43d5161e0384cfbeef07cfe19e45a4e36439097e121578/furi-0.6.4.tar.gz" } ], "0.6.5": [ { "comment_text": "", "digests": { "md5": "c5a95830295ac02263774fd6d680ab80", "sha256": "ac7483d7f6a7cedceacedc72969ff37618e183f9e70d086f6e11942b48f15955" }, "downloads": -1, "filename": "furi-0.6.5.tar.gz", "has_sig": false, "md5_digest": "c5a95830295ac02263774fd6d680ab80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8637, "upload_time": "2016-03-03T21:35:48", "url": "https://files.pythonhosted.org/packages/db/9e/0edf4aa43a01ebc2eaf9f8399e4cee7b0d463d135f8174ffcff7cd9d19b8/furi-0.6.5.tar.gz" } ], "0.6.6": [ { "comment_text": "", "digests": { "md5": "ca4816be50931574bb54d685940e080f", "sha256": "b41cb4cb8f821f5133279c325c0fb2ebaf56611cd343823615237b71c20fb6a2" }, "downloads": -1, "filename": "furi-0.6.6.tar.gz", "has_sig": false, "md5_digest": "ca4816be50931574bb54d685940e080f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8640, "upload_time": "2016-03-04T21:41:33", "url": "https://files.pythonhosted.org/packages/3c/6c/beb08d8bff212fad1ba42d598d4fe3e986f69b68fabdf33c4f93d15c2697/furi-0.6.6.tar.gz" } ], "0.6.7": [ { "comment_text": "", "digests": { "md5": "aebfeabf7ba676a25a43698e5ef9bebe", "sha256": "4a9899805131f0e51bb40ff230cbb337504d4bdc28f5df2dce38e481e38a2407" }, "downloads": -1, "filename": "furi-0.6.7.tar.gz", "has_sig": false, "md5_digest": "aebfeabf7ba676a25a43698e5ef9bebe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8558, "upload_time": "2016-03-17T14:06:13", "url": "https://files.pythonhosted.org/packages/15/04/481de4a71c6da6d71575d4f78e0530d32f07487aba7b0934cb419ab68d74/furi-0.6.7.tar.gz" } ], "0.6.8": [ { "comment_text": "", "digests": { "md5": "f2f9d202be0a3d423b046cb4992635a1", "sha256": "779aea79f857b5b3088a2f239757411263d26e9cd20d5f711824ad1e00077148" }, "downloads": -1, "filename": "furi-0.6.8.tar.gz", "has_sig": false, "md5_digest": "f2f9d202be0a3d423b046cb4992635a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8929, "upload_time": "2016-03-24T21:16:23", "url": "https://files.pythonhosted.org/packages/84/8c/a7e26fc1a1b46620fbb20e8a2d4c8033ea4c069432b55bc310148dfa5d0c/furi-0.6.8.tar.gz" } ], "0.6.9": [ { "comment_text": "", "digests": { "md5": "26c7d7674fdb58be173056bd2b4bf38f", "sha256": "aa5deac48265d7a546f514430fbe826b4c4cc42550c0cfaf51e4bd53513bdec2" }, "downloads": -1, "filename": "furi-0.6.9.tar.gz", "has_sig": false, "md5_digest": "26c7d7674fdb58be173056bd2b4bf38f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8967, "upload_time": "2016-03-29T19:58:01", "url": "https://files.pythonhosted.org/packages/ae/ff/f399ed62eab31b3df79fd760f80f213b6079b47e1a38249abda02fa7e3d4/furi-0.6.9.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "9e25a569a3a2773ec00608b317cf75ef", "sha256": "3a78eb4442ccf34d9cc819ebbf6a9249c337976500ce184204760830f0d8682b" }, "downloads": -1, "filename": "furi-0.7.0.tar.gz", "has_sig": false, "md5_digest": "9e25a569a3a2773ec00608b317cf75ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9127, "upload_time": "2016-07-07T22:38:44", "url": "https://files.pythonhosted.org/packages/73/65/e82dccc483c2faa5a9aff9c34176c8582f483449cc4a8e410ac3eef35568/furi-0.7.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e25a569a3a2773ec00608b317cf75ef", "sha256": "3a78eb4442ccf34d9cc819ebbf6a9249c337976500ce184204760830f0d8682b" }, "downloads": -1, "filename": "furi-0.7.0.tar.gz", "has_sig": false, "md5_digest": "9e25a569a3a2773ec00608b317cf75ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9127, "upload_time": "2016-07-07T22:38:44", "url": "https://files.pythonhosted.org/packages/73/65/e82dccc483c2faa5a9aff9c34176c8582f483449cc4a8e410ac3eef35568/furi-0.7.0.tar.gz" } ] }