Skip to main content

Convenient filesystem interface over Oracle Cloud's Object Storage

Project description

Oracle Cloud Infrastructure Object Storage fsspec implementation

​ ​ The Oracle Cloud Infrastructure Object Storage service is an internet-scale, high-performance storage platform that offers reliable and cost-efficient data durability. With Object Storage, you can safely and securely store or retrieve data directly from the internet or from within the cloud platform. ​ ocifs is part of the fsspec intake/filesystem_spec ecosystem

a template or specification for a file-system interface, that specific implementations should follow, so that applications making use of them can rely on a common interface and not have to worry about the specific internal implementation decisions with any given backend. ​ ocifs joins the list of file systems supported with this package. ​ The intake/filesystem_spec project is used by Pandas, Dask and other data libraries in python, this package adds Oracle OCI Object Storage capabilties to these libraries. ​

Example Usage:

from ocifs import OCIFileSystem

fs = OCIFilesystem("~/.oci/config")"oci://<my_bucket>@<my_namespace>/<my_prefix>")
# [<my_bucket>@<my_namespace>/<my_prefix>/obj1, <my_bucket>@<my_namespace>/<my_prefix>/obj2]"oci://<my_bucket>@<my_namespace>/<my_prefix>/obj1")
# b"Hello World"

with"oci://<my_bucket>@<my_namespace>/<my_prefix>/obj3", 'w') as f:
    f.write("Adding a third object.")

fs.copy("oci://<my_bucket>@<my_namespace>/<my_prefix>/obj3", "oci://<my_bucket>@<my_namespace>/<my_prefix>/obj1")

with"oci://<my_bucket>@<my_namespace>/<my_prefix>/obj1") as f:
# b"Adding a third object."

Or Use With Pandas:

import pandas as pd
import ocifs

df = pd.read_csv(
    storage_options={"config": "~/.oci/config"},

Getting Started:

python3 -m pip install ocifs

Software Prerequisites:

Python >= 3.6

Environment Variables for Authentication:

export OCIFS_IAM_TYPE=api_key
export OCIFS_CONFIG_LOCATION=~/.oci/config

Note, if you are operating on OCI with an alternative valid signer, such as resource principal, instead set the following:

export OCIFS_IAM_TYPE=resource_principal



The built-in filesystems in fsspec are maintained by the intake project team, where as ocifs is an external implementation (similar to s3fs, gcsfs, adl/abfs, and so on), which is maintained by Oracle.

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

ocifs-1.2.1.tar.gz (23.9 kB view hashes)

Uploaded Source

Built Distribution

ocifs-1.2.1-py3-none-any.whl (18.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