Skip to main content

akagi

https://img.shields.io/pypi/v/akagi.svg https://img.shields.io/travis/ayemos/akagi.svg https://readthedocs.org/projects/akagi/badge/?version=latest https://pyup.io/repos/github/ayemos/akagi/shield.svg https://codeclimate.com/github/ayemos/akagi/badges/coverage.svg

akagi

  • Free software: MIT license

Features

akagi enables you to access various data sources such as Amazon Redshift, Amazon S3 and Google Spreadsheet (more in future) from python.

Installation

Install via pip:

pip install akagi

or from source:

$ git clone https://github.com/ayemos/akagi akagi
$ cd akagi
$ python setup.py install

Setup

To use RedshiftDataSource, you need to set environment variable AKAGI_UNLOAD_BUCKET the name of the Amazon S3 bucket you like to use as intermediate storage of Redshift Unload command.

$ export AKAGI_UNLOAD_BUCKET=xyz-unload-bucket.ap-northeast-1

To use SpreadsheetDetaSource, you need to set environment variable GOOGLE_APPLICATION_CREDENTIAL to indicate your service account credentials file. You can get the credential from here.

Associated client has to have read access to the sheets.

$ export GOOGLE_APPLICATION_CREDENTIAL=$HOME/.credentials/service-1a2b.json

Example

RedshiftDataSource

from akagi.data_sources import RedshiftDataSource

ds = RedshiftDataSource('select * from (select user_id, path from logs.imp limit 10000')

for d in ds:
    print(d) # iterate on result

S3DataSource

from akagi.data_sources import S3DataSource

ds = S3DataSource.for_prefix(
        'image-data.ap-northeast-1',
        'data/image_net/zebra',
        file_format='binary')

for d in ds:
    print(d) # iterate on result

SpreadsheetDataSource

from akagi.data_sources import LocalDataSource

ds = SpreadsheetDataSource(
      '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms',  # sample sheet provided by Google
      sheet_range='Class Data!A2:F31')

for d in ds:
    print(d) # iterate on result

LocalDataSource

from akagi.data_sources import LocalDataSource

ds = LocalDataSource(
      './PATH/TO/YOUR/DATA/DIR',
      file_format='csv')

for d in ds:
    print(d) # iterate on result

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Metadata

Release files for akagi 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for akagi 0.4.1
File Interpreter ABI Platform Actions
akagi-0.4.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for akagi-0.4.1-py2.py3-none-any.whl

Release files / akagi-0.4.1-py2.py3-none-any.whl

Download URL akagi-0.4.1-py2.py3-none-any.whl
Size 15.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e8a2abc5abfac83bf834c8cbc31b753c3cbd87eb5ed9f2cc796a535fd770c7fc
BLAKE2b-256 checksum
How to use checksums
28fbd918f1f5c3db0f50eb24badb95c478041027baa2ab0d8c675459c018756b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3

Security for akagi 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page