Coder Social home page Coder Social logo

dc-aps / dcpyutils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from navdeep-g/setup.py

0.0 2.0 0.0 84 KB

๐Ÿ“ฆ A Human's Ultimate Guide to setup.py.

Home Page: https://github.com/kennethreitz/setup.py/blob/master/setup.py

License: Apache License 2.0

Python 100.00%

dcpyutils's Introduction

๐Ÿ“ฆ dcPyUtils

This is a python utils from DataCanvas APS.

Installation

pip install dcPyUtils

Usages

  • add support to connect private s3 compatible host (eg: ceph rgw) from pandas

    Just set host url / access key / secret key by dcutils.mix_pd_s3():

    from dcutils import mix_pd_s3
    
    s3_host = 'http://xxx.xxx.xxx.xxx:12345'
    access_key = 'xxxxxxxxx'
    secret_key = 'xxxxxxxxxxxxxxxxxxxxxxx'
    
    mix_pd_s3(s3_host, access_key, secret_key)

    Then, read/write data from s3 host with url "s3://<bucket>/<object_name>"

    import pandas as pd
    
    local_file = 'foo.csv'
    s3_bucket = 'test'
    s3_object = "s3://%s/%s" % (s3_bucket, local_file)
    
    # load orignal data from file system
    df = pd.read_csv(local_file)
    
    # save df into s3
    df.to_csv(s3_object, index=False, header=True)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.