Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
RajeshHegde committed Dec 30, 2019
2 parents 327ffc2 + 40fa8c1 commit 43154f2
Show file tree
Hide file tree
Showing 41 changed files with 768 additions and 701 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ logs/
media/
data/

# environment vars
polyaxon/polyaxon/env_vars/local.json

# project
logs/*
Expand All @@ -122,9 +120,6 @@ static/rest_framework
client/dist/
client/node_modules/
client/css/
client/polyaxon/**/*.js
client/polyaxon/**/*.js.map
/examples/polyaxon-logs/
client/npm-debug.log
# don't ignore static dist
!/static/dist
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
fail_fast: true
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v0.9.2
hooks:
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: debug-statements
- id: detect-private-key

- repo: local
hooks:
- id: isort
name: isort-local
entry : isort
language: python
types: [python]
exclude: .+/(settings)/.+
pass_filenames: true
- id: prospector
name: prospector-local
entry: prospector --messages-only
language: python
types: [python]
exclude: .+/(settings)/.+
pass_filenames: true
4 changes: 3 additions & 1 deletion .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ strictness: high
test-warnings: true
doc-warnings: true

max-line-length: 100
max-line-length: 120


ignore-patterns:
Expand All @@ -19,6 +19,7 @@ mccabe:

pylint:
disable:
- astroid-error
- abstract-method
- broad-except
- cyclic-import
Expand All @@ -37,3 +38,4 @@ pylint:
- missing-final-newline
options:
ignore: migrations
max-line-length: 120
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "venv/bin/python3.7"
}
56 changes: 0 additions & 56 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 - Polyaxon, Inc.
Copyright (c) 2019 - Dblue, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
95 changes: 48 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,82 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Build Status](https://travis-ci.com/polyaxon/polystores.svg?branch=master)](https://travis-ci.com/polyaxon/polystores)
[![PyPI version](https://badge.fury.io/py/polystores.svg)](https://badge.fury.io/py/polystores)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a33947d729f94f5da7f7390dfeef7f94)](https://www.codacy.com/app/polyaxon/polystores?utm_source=github.com&utm_medium=referral&utm_content=polyaxon/polystores&utm_campaign=Badge_Grade)
[![Slack](https://img.shields.io/badge/chat-on%20slack-aadada.svg?logo=slack&longCache=true)](https://join.slack.com/t/polyaxon/shared_invite/enQtMzQ0ODc2MDg1ODc0LWY2ZTdkMTNmZjBlZmRmNjQxYmYwMTBiMDZiMWJhODI2ZTk0MDU4Mjg5YzA5M2NhYzc5ZjhiMjczMDllYmQ2MDg)


# polystores

Polystores is an abstraction and a collection of clients to interact with cloud storages.
# Dblue Stores

Dblue Store is an abstraction and a collection of clients to interact with cloud storages.

## Install

```bash
$ pip install -U polystores
$ pip install -U dblue-stores
```

N.B. this module does not include by default the cloud storage's client requirements
to keep the library lightweight, the user needs to install the appropriate module to use with `polystores`.
N.B. this module does not include by default the cloud storage's client requirements
to keep the library lightweight, the user needs to install the appropriate module to use with `dblue-stores`.

### Install S3

```bash
pip install -U polystores[s3]
pip install -U dblue-stores[s3]
```

### Install GCS


```bash
pip install -U polystores[gcs]
pip install -U dblue-stores[gcs]
```

### Install Azure Storage

```bash
pip install -U dblue-stores[azure]
```

### Install SFTP

```bash
pip install -U polystores[azure]
pip install -U dblue-stores[sftp]
```

## Stores

This module includes clients and stores abstraction that can be used to interact with AWS S3, Azure Storage, and Google Cloud Storage.

This module includes clients and stores abstraction that can be used to interact with AWS S3, Azure Storage, Google Cloud Storage and SFTP.

## S3

### Normal instantiation

```python
from polystores.stores.s3_store import S3Store
from dblue_stores.stores.s3 import S3Store

s3_store = S3Store(endpoint_url=...,
access_key_id=...,
secret_access_key=...,
session_token=...,
region=...)
s3_store = S3Store(
endpoint_url=...,
access_key=...,
secret_key=...,
session_token=...,
region=...
)
```


### Using env vars

```bash
export AWS_ENDPOINT_URL=...
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_ACCESS_KEY=...
export AWS_SECRET_KEY=...
export AWS_SECURITY_TOKEN=...
exprot AWS_REGION=...
```

And then you can instantiate the store

```python
from polystores.stores.s3_store import S3Store
from dblue_stores.stores.s3 import S3Store

s3_store = S3Store()
```

### Using a client

```python
from polystores.stores.s3_store import S3Store
from dblue_stores.stores.s3 import S3Store

s3_store = S3Store(client=client)
```
Expand All @@ -101,25 +98,26 @@ s3_store.upload_dir(dirname, key, bucket_name=None, overwrite=False, encrypt=Fal
s3_store.download_dir(key, local_path, bucket_name=None, use_basename=True)
```


## GCS

### Normal instantiation

```python
from polystores.stores.gcs_store import GCSStore
from dblue_stores.stores.gcs import GCSStore

gcs_store = GCSStore(project_id=...,
credentials=...,
key_path=...,
key_path=...,
scopes=...)
gcs_store = GCSStore(
project_id=...,
credentials=...,
key_path=...,
keyfile_dict=...,
scopes=...
)
```

### Using a client

```python
from polystores.stores.gcs_store import GCSStore
from dblue_stores.stores.gcs import GCSStore

gcs_store = GCSStore(client=client)
```
Expand All @@ -139,11 +137,14 @@ gcs_store.download_dir(blob, local_path, bucket_name=None, use_basename=True)
### Normal instantiation

```python
from polystores.stores.azure_store import AzureStore
from dblue_stores.stores.azure import AzureStore

az_store = AzureStore(
account_name=...,
account_key=...,
connection_string=...
)

az_store = AzureStore(account_name=...,
account_key=...,
connection_string=...)
```

### Using env vars
Expand All @@ -155,16 +156,17 @@ export AZURE_CONNECTION_STRING=...
```

And then you can instantiate the store

```python
from polystores.stores.azure_store import AzureStore
from dblue_stores.stores.azure import AzureStore

az_store = AzureStore()
```

### Using a client

```python
from polystores.stores.azure_store import AzureStore
from dblue_stores.stores.azure import AzureStore

az_store = AzureStore(client=client)
```
Expand All @@ -185,7 +187,6 @@ az_store.download_dir(blob, local_path, container_name=None, use_basename=True)
pytest
```

## Credits

## License

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fpolyaxon%2Fpolystores.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fpolyaxon%2Fpolystores?ref=badge_large)
Most of the codes are borrowed from https://github.com/polyaxon/polystores
Loading

0 comments on commit 43154f2

Please sign in to comment.