
# dpgenZ: Print your buckets and .csv files from Minio
## Powered by FPT Infomation System

# How to install?
```
pip install dpgenZ
```
## or

Windows
```
py -m pip install dpgenZ
```
Linux/Mac OS
```
python3 -m pip install dpgenZ
```


# How to use dpgenZ?

## You can use to one of codes below here:


ACCESS_KEY: Access key in your Minio Services Account.

SECRET_KEY: Secret key in your Minio Services Account.

BUCKET_NAME: Your Bucket name.

OBJECT_NAME: The Object name in your Bucket (This file that only enter file name, do not enter file format).


## Print file from Minio

### Example:

Print file from:
   Access key: dpZ
   Secret key: dpZcrawl
   Bucket name: abc
   Object name: hihi

### Print .txt file

```

import dpgenZ

a = dpgenZ.Storage(ACCESS_KEY, SECRET_KEY)

a.readtext(BUCKET_NAME, OBJECT_NAME)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.readtext('abc', 'hihi')

```

### Print .csv file

```

import dpgenZ

a = dpgenZ.Storage(ACCESS_KEY, SECRET_KEY)

a.readcsv(BUCKET_NAME, OBJECT_NAME)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.readcsv('abc', 'hihi')

```

### Print .xlsx file

```

import dpgenZ

a = dpgenZ.Storage(ACCESS_KEY, SECRET_KEY)

a.readexcel(BUCKET_NAME, OBJECT_NAME)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.readexcel('abc', 'hihi')

```

### Print .parquet file

```

import dpgenZ

a = dpgenZ.Storage(ACCESS_KEY, SECRET_KEY)

a.readparquet(BUCKET_NAME, OBJECT_NAME)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.readparquet('abc', 'hihi')

```

### Print .orc file

```

import dpgenZ

a = dpgenZ.Storage(ACCESS_KEY, SECRET_KEY)

a.readorc(BUCKET_NAME, OBJECT_NAME)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.readorc('abc', 'hihi')

```

## Write file from Minio

ACCESS_KEY: Access key in your Services Account.

SECRET_KEY: Secret key in your Services Account.

BUCKET_NAME_IN: Your Bucket name (INPUT).

OBJECT_NAME_IN: The Object name in your Bucket (INPUT) (This file that only enter file name, do not enter file format).

BUCKET_NAME_OUT: Your Bucket name (OUTPUT).

OBJECT_NAME_OUT: The Object name in your Bucket (OUTPUT) (.csv file) (This file that only enter file name, do not enter file format).

# Example:

 Write file from:
   Access key: dpZ
   Secret key: dpZcrawl
   Bucket name: abc
   Object name: hihi

Write to:
   Bucket name: xyz
   Object name: huhu

### Write .txt file

```

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writetext(BUCKET_NAME_IN,OBJECT_NAME_IN,BUCKET_NAME_OUT,OBJECT_NAME_OUT)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writetext('abc', 'hihi', 'xyz', 'huhu')

```

### Write .csv file

```

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writecsv(BUCKET_NAME_IN,OBJECT_NAME_IN,BUCKET_NAME_OUT,OBJECT_NAME_OUT)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writecsv('abc', 'hihi', 'xyz', 'huhu')

```

### Write .xlsx file

```

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writeexcel(BUCKET_NAME_IN,OBJECT_NAME_IN,BUCKET_NAME_OUT,OBJECT_NAME_OUT)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writeexcel('abc', 'hihi', 'xyz', 'huhu')

```

### Write .parquet file

```

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writeparquet(BUCKET_NAME_IN,OBJECT_NAME_IN,BUCKET_NAME_OUT,OBJECT_NAME_OUT)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writeparquet('abc', 'hihi', 'xyz', 'huhu')

```

### Write .orc file

```

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writeorc(BUCKET_NAME_IN,OBJECT_NAME_IN,BUCKET_NAME_OUT,OBJECT_NAME_OUT)


# Example:

import dpgenZ

a = dpgenZ.Storage('dpZ', 'dpZcrawl')

a.writeorc('abc', 'hihi', 'xyz', 'huhu')

```

## Read database from Postgres

USER: Your Postgres User

PASSWORD: Your Postgres Password

HOST: Your Postgres Host

PORT: Your Postgres Port

DATABASE: Your Postgres Database

EXECUTE: Your Query

```

import dpgenZ

a = dpgenZ.Postgres(USER, PASSWORD, HOST, PORT, DATABASE)

a.readpostgres(EXECUTE)

```

## Write database from Postgres

USER: Your Postgres User

PASSWORD: Your Postgres Password

HOST: Your Postgres Host

PORT: Your Postgres Port

DATABASE: Your Postgres Database

EXECUTE: Your Query

ACCESS_KEY: Access key in your Minio Services Account.

SECRET_KEY: Secret key in your Minio Services Account.

BUCKET_NAME_OUT: Your Bucket name (OUTPUT).

OBJECT_NAME_OUT: The Object name in your Bucket (OUTPUT) (.csv file) (This file that only enter file name, do not enter file format).

```

import dpgenZ

a = dpgenZ.Postgres(USER, PASSWORD, HOST, PORT, DATABASE)

a.writepostgres(EXECUTE, ACCESS_KEY, SECRET_KEY, BUCKET_NAME_OUT, OBJECT_NAME_OUT)

```

