Skip to main content

A small example package

Project description

Installation

pip install manonaid_helpers

See PyPi for package index.

Requirements

Azure Storage connection string has to be set as environment variable AZURE_STORAGE_CONNECTION_STRING or the seperate environment variables AZURE_STORAGE_KEY and AZURE_STORAGE_NAME which will be used to create the connection string.

Set variables like below: For Windows PowerShell $env:AZURE_STORAGE_CONNECTION_STRING = 'blahblahblah....'

For Command Prompt set AZURE_STORAGE_CONNECTION_STRING=blahblahblah....

Usage

Download

1. Fetch as pd.DataFrame

We can use the returnAsDataFrameDict() method to fetch one or multiple blobs as DataFrames

While fetching multiple blobs the return object is a dictonary of DataFrames with the blob name(with the extension) as the key.

If type_correct_date_time_cols is set as True: For all blobs that contain columns with names containing "date" or "time" are converted to datetime with format="%Y-%m-%dT%H:%M:%S"

delimitter is set to',' by default

from manonaid_helpers.download import Download

df = Download(
    source="cyi5", 
    extension=".csv", 
    folder="pack_test/"
).returnAsDataFrameDict()

2. Download a specific folder from a container

We can download a folder by setting the folder argument.

from manonaid_helpers.download import Download

Download(
   source='cyi5',
   folder="pack_test/",
   extension='.csv',
).returnAsDataFrameDict()

3. Download a given list of files

We can give a list of files to download with the list_files argument.

from manonaid_helpers.download import Download

Download(
   source='cyi5',
   folder="pack_test/",
   extension='.csv',
   list_files=["20230301_ais_accuracy.csv"],
).returnAsDataFrameDict()

List blobs

With the Utils.list_blobs method we can do advanced listing of blobs in a container or specific folder in a container. We have several argument we can use to define our scope of information:

  • name_starts_with: This can be used to filter files with certain prefix, or to select certain folders: name_starts_with=folder1/subfolder/lastfolder/

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

manonaid_helpers-0.1.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

manonaid_helpers-0.1.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file manonaid_helpers-0.1.4.tar.gz.

File metadata

  • Download URL: manonaid_helpers-0.1.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.8

File hashes

Hashes for manonaid_helpers-0.1.4.tar.gz
Algorithm Hash digest
SHA256 23f00f1e41157d932d0b98acc38d157d04dabf5e4fb1a1495196022914a313a8
MD5 0fdf5144dfc3bb9b849daffb51ee9c35
BLAKE2b-256 ee834d37e84997719088548f6956823cb50e28e7b1f5e4e1559c76edecc15d04

See more details on using hashes here.

File details

Details for the file manonaid_helpers-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for manonaid_helpers-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5559b4e22394ee20e132040d3cd34800b5d78ec4dfe811185b822f03bf55f495
MD5 cbb950e37accf5c2517d5b7a887c6a18
BLAKE2b-256 29fad544289dfbb2bbce66ca2c82f39a54a87f08950d057631e7a732d507a6ca

See more details on using hashes here.

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