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.0.0.tar.gz (60.5 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.0.0-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cfs3-0.0.0.tar.gz
Algorithm Hash digest
SHA256 0590b500d442b444066bcf00aa9b2e5a37050549a7087b6bf640200ff1f248d4
MD5 b4b78ffea0d4020cd41dec31ca92f8dd
BLAKE2b-256 859a16a4fe2ca4736b8f8dd08e2122dcaf7e0e442ab77aa8ad62975220d8cb2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for cfs3-0.0.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: cfs3-0.0.0-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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aee8b8072b08c67f033020071d36ed21a3ed691d9915aa20f8df25994eac825c
MD5 bab4bfd1ccaa6d6a62a337d21ea69df7
BLAKE2b-256 189d735f96831ec2699bc67885845f08b76b70905fae59bf65f2f829c3b8345c

See more details on using hashes here.

Provenance

The following attestation bundles were made for cfs3-0.0.0-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