Skip to main content

Lightweight tool for investigating data files in an s3 repository

Project description

cfs3

Package of tools for manipulating data held in S3 which can make use of the CF compliant metadata in the files, and use, if it exists extra information conforming to a user defined "Data Reference Syntax" (DRS) which covers some structured requirements for data and file attributes and filenames.

For now, you need to git clone it, and install from the cloned repository using pip install --use-pep517 -e .

You will almost certainly need to configure your access details using a minio configuration file as described below.

s3view

Lightweight tool for navigating around an S3 repository, utilising minio tools (hence, to use it, you need to set up a minio configuration file (config.json) in your ~./mc directory. See below.)

To run it, simply run the script s3view, and there is help within that.

Currently commands supported are:

  • loc (for changing minio locations)
  • cb (for changing buckets)
  • cd, ls, rm (all do what you would expect)
  • mv (only lets you rename stuff within a bucket. Note that this is expensive as it really involves a copy. Try not to need to do it!)

Note that unlike other packages, we treat each bucket as it's own independent file system. We could tream them like top level directories, but we don't. For now.

Yes we know there are easier ways to do most of this (the minio command line tools for example), but this package does different things by default, and we want to be able to use elements of it in other code. We may well extend it to be a bit more "climate data aware" as well. Early days.

Testing and Reliability

The unittest framework is not yet ready, so it's very much caveat emptor for now.

JASMIN Access

For those of you using this on JASMIN, the procedure to get going on the object store is

  1. You need to have applied for, and got access to one or more tenancies (in the example below, I'll show you how I got set up for the hiresgw tenany, you will need to do this for each and every S3 tenancy you have access to).

  2. Create your secret key here: https://s3-portal.jasmin.ac.uk/object-store/hiresgw-o/create-keys. Note that you need a different secret key for each object store tenancy.

Look out for the use of quotes in your secret key, you will have to escape them in your configuration files. E.g. if your secret key looks like gubbins_"_moregubbins you will need to enter it in your config files as gubbins_\"_moregubbins

  1. Do your minio configuration as below.

Minio Configuration

If you are working inside JASMIN and from outside JASMIN, you can set up your minio configuration files in each place so that your code is complete agnostic about where you are, it just "gets it right".

In this case, you will want to copy two versions of your config and secret key into your .mc/config.json, one for JASMIN itself, and one for your (remote) sites (e.g. RACC, laptop etc).

Mine look like:

  • at JASMIN:
"hrs3":{
            "url": "http://hiresgw-o.jc.rl.ac.uk",
			"accessKey": "Stuff",
			"secretKey": "Longer \" Stuff",
			"api": "S3v4",
      	    "path": "auto"    
		},

and elsewhere:

"hrs3":{
            "url": "https://hiresgw-o.s3-ext.jc.rl.ac.uk",
			"accessKey": "Stuff",
			"secretKey": "Longer \" Stuff",
			"api": "S3v4",
      	    "path": "auto"    
		},

Note the workspace is hiresgw-o in both cases, but it is https in one and http in the other, and the s3-ext in the elsewhere one. Note also that this is just one part of the minio configuration file, you will have multiple entries in your file, which will then look something like this:

{
        "version": "10",
        "aliases": {
            "hrs3": { ...},
            "another": { ...}
        }
}

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

cfs3-0.2.1.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfs3-0.2.1-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file cfs3-0.2.1.tar.gz.

File metadata

  • Download URL: cfs3-0.2.1.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cfs3-0.2.1.tar.gz
Algorithm Hash digest
SHA256 654199e7f1a5b4cfa1392ef06b4c7d8e85336a3b5d5b49f336588dcbc63d7b06
MD5 76d075bcc198b0ffc83fb0295805bf87
BLAKE2b-256 2ce61c208b6adde81ffaa5d95d5921b4560865789b2c8a0c6bef2a99b3191ff2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cfs3-0.2.1.tar.gz:

Publisher: build-and-deploy-on-pypi.yml on NCAS-CMS/cfs3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cfs3-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: cfs3-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cfs3-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5dfe1cc5879554ce3cd7ffb49faaed163b89acedab08218e3cee03def6120275
MD5 a2d74956663e05ec52d93b1185f686b5
BLAKE2b-256 a72d411a62eec2deb26c49902472ec108f8e8cd79e25f5af765d73d257237213

See more details on using hashes here.

Provenance

The following attestation bundles were made for cfs3-0.2.1-py3-none-any.whl:

Publisher: build-and-deploy-on-pypi.yml on NCAS-CMS/cfs3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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