Skip to main content

Standard Interfaces for Object Transformation - File I/O Structures

Project description

sito-io

Standard Interfaces for Transforming Objects - File I/O

The goal of this library is to provide data structures and interfaces which are at least as ergonomic as existing file I/O and path primitives (open, Path, etc), while providing strongly typed functionality to facilitate transformations of collections of files.

Core concepts

Resource

A Resource is the core unit of abstraction. It is kind of like a sum type of a os.Path and urllib.parse.ParseResult. Its essence is to act as a handle to a more sophisticated resource, such as a file, directory, URL, endpoint, transaction, FIFO, special file, etc.

Context

A Context is a Resource that can be used to "anchor" another Resource. For example, a context might be http://example.com, /home/user, or even .. A context can be:

  • Fully qualified - file:///home/user/foo/bar, http://example.com/foo/bar, ftp://example.com/foo/bar
  • Absolute - /home/user/foo/bar, /home/user/arch.tar::/foo/bar
  • Relative - ./bar - Relative contexts must be rooted before they can be fully resolved
  • Naive - bar - Naive contexts must be rooted before they can be fully resolved

Manifest

A Manifest is a collection of Resources. This might be files on disk (or a description thereof, it need not exist), or files in a TAR file, or endpoints. The primary purpose is to facilitate moving collections of files atomically, capturing I/O of a process, and "slurping up" the data, thus allowing stateful processes to be modeled as a transaction. This makes a process behave less like a mutation and more like a lambda, improving referential transparency in pipelines.

A Manifest can be used to generate a ManifestFile, a serialized index of the manifest. This can be packed with the files and give an easy handle to verify the contents of a transaction.

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

sito_io-0.0.2.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

sito_io-0.0.2-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

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