{"id":17254294,"url":"https://github.com/ispaneli/fstorage","last_synced_at":"2026-03-09T12:32:34.700Z","repository":{"id":129505011,"uuid":"592358454","full_name":"ispaneli/fstorage","owner":"ispaneli","description":"Fstorage, Secure file storage, SYNC/ASYNC clients, easy to learn, fast to code.","archived":false,"fork":false,"pushed_at":"2023-03-22T18:04:20.000Z","size":161,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T19:22:49.480Z","etag":null,"topics":["aiohttp-client","api-client","asgi","async","asyncio","client-server","cryptography","fastapi","file-manager","filesystem","python","python-types","python3","requests","security","storage-api","storage-engine","swagger","swagger-ui","uvicorn"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/fstorage","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ispaneli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-23T15:06:12.000Z","updated_at":"2023-08-20T06:48:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c920494-e00d-46cc-9aa7-99012d13618a","html_url":"https://github.com/ispaneli/fstorage","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispaneli%2Ffstorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispaneli%2Ffstorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispaneli%2Ffstorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ispaneli%2Ffstorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ispaneli","download_url":"https://codeload.github.com/ispaneli/fstorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248829234,"owners_count":21168176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp-client","api-client","asgi","async","asyncio","client-server","cryptography","fastapi","file-manager","filesystem","python","python-types","python3","requests","security","storage-api","storage-engine","swagger","swagger-ui","uvicorn"],"created_at":"2024-10-15T07:08:15.635Z","updated_at":"2026-03-09T12:32:34.656Z","avatar_url":"https://github.com/ispaneli.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/fstorage\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/ispaneli/fstorage/master/docs/img/logo.png\" alt=\"FStorage\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eFstorage, Secure file storage, SYNC/ASYNC clients, easy to learn, fast to code.\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/fstorage\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/fstorage?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/fstorage\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/fstorage.svg?color=%2334D058\" alt=\"Supported Python versions\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/fstorage\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://static.pepy.tech/personalized-badge/fstorage?period=total\u0026units=none\u0026left_color=grey\u0026right_color=brightgreen\u0026left_text=Downloads\" alt=\"Total downloads\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**Source Code**:\n\u003ca href=\"https://github.com/ispaneli/fstorage\" target=\"_blank\"\u003e\n  https://github.com/ispaneli/fstorage\n\u003c/a\u003e\n\n---\n\n**FStorage** is a simple asynchronous secure file storage for microservices.\n\nIt is implemented on the **\u003ca href=\"https://pypi.org/project/fastapi/\" class=\"external-link\" target=\"_blank\"\u003eFastAPI\u003c/a\u003e** web framework.\n\nTo run the file storage, you need:\n* **\u003ca href=\"https://www.postgresql.org/\" class=\"external-link\" target=\"_blank\"\u003ePostgreSQL\u003c/a\u003e**\n\n**WARNING**: With the usual installation of `pip install fstorage`, the requirements are not installed (for more info, see [How to install](#how-to-install-with-requirements))!\n\n---\n\n## How to install with requirements\n\nTo deploy the FStorage on the **server**:\n\n```bash\npip install 'fstorage[server]'\n```\n\nTo use **synchronous client**:\n\n```bash\npip install 'fstorage[sync_client]'\n```\n\nTo use **asynchronous client**:\n\n```bash\npip install 'fstorage[async_client]'\n```\n\n---\n\n## How to deploy storage\n\nConfigure virtual environment variables in terminal:\n\n```bash\nexport POSTGRESQL_URL=\"postgresql+asyncpg://\u003cdb_username\u003e:\u003cdb_password\u003e@\u003cdb_host\u003e:\u003cdb_port\u003e/\u003cdb_name\u003e\"\nexport STORAGE_PATH=\"/Users/\u003clocal_username\u003e/.fstorage/storage\"\n```\n\nConfigure **logging.ini**:\n\n```ini\n[loggers]\nkeys=root\n\n[handlers]\nkeys=logfile, logconsole\n\n[formatters]\nkeys=logformatter\n\n[logger_root]\nlevel=INFO\nhandlers=logfile, logconsole\n\n[formatter_logformatter]\nformat=[%(asctime)s.%(msecs)03d] %(levelname)s [%(thread)d] - %(message)s\n\n[handler_logfile]\nclass=handlers.RotatingFileHandler\nlevel=INFO\nargs=('/Users/\u003clocal_username\u003e/.fstorage/logfile.log', 'a')\nformatter=logformatter\n\n[handler_logconsole]\nclass=handlers.logging.StreamHandler\nlevel=INFO\nargs=()\nformatter=logformatter\n```\n\nRun this code:\n\n```python\nimport os\n\nfrom fstorage.server import storage_run\n\n\nif __name__ == '__main__':\n    storage_run(\n        storage_path=os.getenv('STORAGE_PATH'),\n        log_config_path=\"logging.ini\",\n        \n        db_async_url=os.getenv('POSTGRESQL_URL'),\n        db_echo=True,\n        db_future=True,\n        db_drop_all=False,\n\n        host='127.0.0.1',\n        port=8_000,\n        reload=False,\n        workers_num=1\n    )\n```\n\n---\n\n## How to use synchronous client\n\n```python\nfrom fstorage.client.synch.client import SyncClient\n\n\nif __name__ == '__main__':\n    client = SyncClient(\"http://127.0.0.1:8000\")\n\n    upload_response: dict = client.upload(open(\"example.file\", 'rb'))\n    print(upload_response)\n    # {'id': \"\u003cfile_id\u003e\"}\n\n    get_response: dict = client.get(upload_response['id'])\n    print(get_response)\n    # {'filename': \"example.file\", 'bytes': '\u003cdata_as_bytes\u003e'}\n\n    client.delete(upload_response['id'])\n\n    try:\n        client.get(upload_response['id'])\n    except FileExistsError as error:\n        print(error)\n        # \"The file with this ID doesn't exist.\"\n\n    try:\n        client.delete(upload_response['id'])\n    except FileExistsError as error:\n        print(error)\n        # \"The file with this ID doesn't exist.\"\n```\n\n---\n\n## How to use asynchronous client\n\n```python\nimport asyncio\n\nfrom fstorage.client.asynch.client import AsyncClient\n\n\nasync def example():\n    client = AsyncClient(\"http://127.0.0.1:8000\")\n\n    upload_response: dict = await client.upload(open(\"example.file\", 'rb'))\n    print(upload_response)\n    # {'id': \"\u003cfile_id\u003e\"}\n\n    get_response: dict = await client.get(upload_response['id'])\n    print(get_response)\n    # {'filename': \"example.file\", 'bytes': '\u003cdata_as_bytes\u003e'}\n\n    await client.delete(upload_response['id'])\n\n    try:\n        await client.get(upload_response['id'])\n    except FileExistsError as error:\n        print(error)\n        # \"The file with this ID doesn't exist.\"\n\n    try:\n        await client.delete(upload_response['id'])\n    except FileExistsError as error:\n        print(error)\n        # \"The file with this ID doesn't exist.\"\n\n\nif __name__ == '__main__':\n    asyncio.run(example())\n```\n\n---\n\n## License\n\nThis project is licensed under the terms of the [MIT license](https://github.com/ispaneli/fstorage/blob/master/LICENSE).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fispaneli%2Ffstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fispaneli%2Ffstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fispaneli%2Ffstorage/lists"}