Skip to main content

Common API for asynchronous file management

Project description

UniversalIO

UniversalIO is a library for Python developers looking to seamlessly integrate multiple different file storage solutions.

The concept was born out of a need for a project to allow users to specify files which might be in the Azure Blob Storage, Azure File Store, on a network drive, or on a SFTP server and then manipulate these files. In addition, there was a need to write the same file back to multiple different locations. The solution was to wrap the specific API for those storage solutions in an API that allowed the system to operate on them consistently, as well as coordinating file transfers between them. The need for batch operations led to the adoption of asyncio and its implementations for most of the backend, though non-asynchronous methods are available as well.

Operations Supported

  • is_dir()
  • is_file()
  • exists()
  • parent()
  • child(child_name)
  • basename()
  • joinpath(*paths)
  • remove()
  • read(block_size)
  • write(bytes)
  • text(encoding)
  • copy()
  • move()
  • mkdir(recursive)
  • rmdir(recursive)
  • crawl()
  • detect_encoding()
  • is_local_to(resource)

Asynchronous versions of most of the above exist with the suffix _async

Storage Solutions Supported

  • Local/network drives (via aiofiles)
  • SFTP (via asyncssh)
  • Azure Blob Storage (via azure.storage.blob.aio)
  • HTTP servers (via aiohttp)
    • Requires GET support for read access
    • Requires PUT support for write access
    • Requires DELETE support for delete
    • Supports MKCOL for basic directory/collection creation
    • Supports COPY, falls back to a GET and a PUT, for file copying
    • Supports MOVE, falls back to a COPY and a DELETE, for file moving

Planned Enhancements

  • Some restructuring to match the pathlib API as much as possible
  • Support for pulling credentials from TOML files in user's home directory
  • Support for Azure File Storage
  • Support for FTP and FTPS
  • Support for direct HTTP access and HTML scraping
  • Support for a batch file uploader/downloader
  • Support for glob() matching and other searching options
  • Support for pathlib-style with_name() to change the file name
  • Support for touch()
  • Support for writing text directly
  • Support for HTTP authentication methods, including a custom method to support custom API calls
  • More direct support for file copy/moving if the descriptor and connection is the same
  • Considering support for SSH/SCP
  • Considering support for relative file paths on local/network drives (challenging to understand what the root would be?)
  • Considering support for chmod/etc (but not supported on Windows)
  • Considering support for symbolic link creation (but complex on Windows)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

universalio-0.0.10.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

universalio-0.0.10-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file universalio-0.0.10.tar.gz.

File metadata

  • Download URL: universalio-0.0.10.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for universalio-0.0.10.tar.gz
Algorithm Hash digest
SHA256 b9f07afdbbf962bfb9ba1ce6d4c5be60f02614ffd45d753ca239dc9630161eb8
MD5 c20a2719a9d13047a797ffabc9c75612
BLAKE2b-256 5f648762b0089ef8ba2471a206b73952e86f24abc2e09b7da8037ab4914d0aca

See more details on using hashes here.

File details

Details for the file universalio-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: universalio-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for universalio-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 bfb0688d38c9f7a3b550e38a9bec3820d89545843030c1d51ec1fa94cd662385
MD5 275f59730d3a1cad6923012ef4f2f463
BLAKE2b-256 cd9789f4e59101522058ae815dd03271db0af02e1839cfcdd016dfcb68f721c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page