Name | aiofs JSON |
Version |
0.2.2
JSON |
| download |
home_page | None |
Summary | Wrap data sources like files with asyncio python |
upload_time | 2024-12-11 14:08:08 |
maintainer | None |
docs_url | None |
author | Salvador Ruiz |
requires_python | <4.0,>=3.12 |
license | LGPL |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Python Anyncronous File System
There are a broad variety of data sources in the current software: sql databases, files, no-sql databases, cloud storages, ... and every one has its own methods and ways to accesing the data.
A good software architecture should not be have a strong dependency to these concrete methods and this is the purpose of this library: *Abstract the acccess to data sources from a software application*
There already are som libraries for this purpose in python (like `filesystem` ) but it is not fully oriented to asyncronous programming. It has taken as reference the library `aiofiles` as pattern to define the system
## Usage
There are only two basic classes which wrapp any data source:
1. `FileLike`, which is an object with basic file methods:
1. Binary `read` method to access to data bytes of the file.
2. Asyncronous binary `write` method for writing bytes to the file.
3. Context management: `read` and `write` shall be ran within a context for assuring the proper closing and handling of file inside filesystem.
2. `FileLikeSystem`, which is a file system for the files. They have the following methods:
1. `open` is the main method because it is the way to create and access to `FileLike` object. It is very important to have clear the future handling of the file:
1. If the file will be used to only read, the `mode` should be `r`. This the default mode.
2. If the file exist and will be written, the `mode` should be `r+` if you will have a reading + writing process or `w` if it only will be written.
2. `rm` to remove one or some files
3. `ls` to list the filenames accesibles in the file system.
There are the following possible exception:
- `BlockingIOError` if two clients are writing at the same time
- `FileNotFound` if the file does not exist in the file system
## Installation
Depending of what data source will be used, it is necessary to define extras:
1. If you are using a Operating File System it is not necessary any extras
2. If you are using Redis Data System, you'll need to add `redis` extra. The directory structure will be stored within the name of the variable. Ex. `directory/path/filename.bin` will be mapped as `directory:path:filename.bin`.
3. If you are using Azure blobs, you will need to add extra `azure`. The directory structure will go directly to the blob name. The file system is mapped to an unique blob container.
An example of manual installation for azure environment could be: `pip install aiofs[azure]`
## TODOS
- [ ] It is intended to access to random access to files.
- [ ] Amplify the file system methods to a better file handling
- [ ] Add new data sources
Raw data
{
"_id": null,
"home_page": null,
"name": "aiofs",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Salvador Ruiz",
"author_email": "salvador.ruiz.r@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d2/02/e2f6c6cde30620a6d600402a7a6d907792dad7acffd2000769d6e2c570bb/aiofs-0.2.2.tar.gz",
"platform": null,
"description": "# Python Anyncronous File System\n\nThere are a broad variety of data sources in the current software: sql databases, files, no-sql databases, cloud storages, ... and every one has its own methods and ways to accesing the data.\n\nA good software architecture should not be have a strong dependency to these concrete methods and this is the purpose of this library: *Abstract the acccess to data sources from a software application*\n\nThere already are som libraries for this purpose in python (like `filesystem` ) but it is not fully oriented to asyncronous programming. It has taken as reference the library `aiofiles` as pattern to define the system\n## Usage\n\nThere are only two basic classes which wrapp any data source:\n1. `FileLike`, which is an object with basic file methods:\n 1. Binary `read` method to access to data bytes of the file.\n 2. Asyncronous binary `write` method for writing bytes to the file.\n 3. Context management: `read` and `write` shall be ran within a context for assuring the proper closing and handling of file inside filesystem.\n2. `FileLikeSystem`, which is a file system for the files. They have the following methods:\n 1. `open` is the main method because it is the way to create and access to `FileLike` object. It is very important to have clear the future handling of the file:\n 1. If the file will be used to only read, the `mode` should be `r`. This the default mode.\n 2. If the file exist and will be written, the `mode` should be `r+` if you will have a reading + writing process or `w` if it only will be written.\n 2. `rm` to remove one or some files\n 3. `ls` to list the filenames accesibles in the file system.\n\nThere are the following possible exception:\n- `BlockingIOError` if two clients are writing at the same time\n- `FileNotFound` if the file does not exist in the file system\n\n## Installation\n\nDepending of what data source will be used, it is necessary to define extras:\n1. If you are using a Operating File System it is not necessary any extras\n2. If you are using Redis Data System, you'll need to add `redis` extra. The directory structure will be stored within the name of the variable. Ex. `directory/path/filename.bin` will be mapped as `directory:path:filename.bin`.\n3. If you are using Azure blobs, you will need to add extra `azure`. The directory structure will go directly to the blob name. The file system is mapped to an unique blob container.\n\nAn example of manual installation for azure environment could be: `pip install aiofs[azure]`\n\n## TODOS\n - [ ] It is intended to access to random access to files.\n - [ ] Amplify the file system methods to a better file handling\n - [ ] Add new data sources\n",
"bugtrack_url": null,
"license": "LGPL",
"summary": "Wrap data sources like files with asyncio python",
"version": "0.2.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9ac4b71333394425046d5b050a101d4872399493d4435ebb19f72d923c794036",
"md5": "62d95cd0c45c45108e7586077045cb8e",
"sha256": "9b29d91d44a400bab2ab44b3eb04cf5e82243cb80881b8405869cd7e4a341342"
},
"downloads": -1,
"filename": "aiofs-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "62d95cd0c45c45108e7586077045cb8e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 7850,
"upload_time": "2024-12-11T14:08:06",
"upload_time_iso_8601": "2024-12-11T14:08:06.094847Z",
"url": "https://files.pythonhosted.org/packages/9a/c4/b71333394425046d5b050a101d4872399493d4435ebb19f72d923c794036/aiofs-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d202e2f6c6cde30620a6d600402a7a6d907792dad7acffd2000769d6e2c570bb",
"md5": "7eab11e6fdf8df2e81c40adf05d1476c",
"sha256": "a4a0d249e34abfe5b15c59d8f6d2cf953f6394f62eb0905eaae238832990fe46"
},
"downloads": -1,
"filename": "aiofs-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "7eab11e6fdf8df2e81c40adf05d1476c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 6381,
"upload_time": "2024-12-11T14:08:08",
"upload_time_iso_8601": "2024-12-11T14:08:08.458886Z",
"url": "https://files.pythonhosted.org/packages/d2/02/e2f6c6cde30620a6d600402a7a6d907792dad7acffd2000769d6e2c570bb/aiofs-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-11 14:08:08",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "aiofs"
}