sqoopy
======
Python CLI to generate custom [sqoop](http://sqoop.apache.org/) import statements.
Modified from [https://github.com/wikimedia/sqoopy/](https://github.com/wikimedia/sqoopy/).
## Installation
You can install `sqoopy` via `pip`:
```bash
$ pip install sqoopy
```
## Usage
`sqoopy` will generate custom [sqoop](http://sqoop.apache.org/) import statements given a few simple options:
```bash
usage: sqoopy [-h] [-c CONNECT] [-d TARGET_DIR] [-t TABLES]
Python CLI to generate custom sqoop import statements.
optional arguments:
-h, --help show this help message and exit
-c CONNECT, --connect CONNECT
A jdbc connection string.
-d TARGET_DIR, --target-dir TARGET_DIR
The directory to send output to. If sending to s3, use
"{table}" to insert the table name into the directory.
EG: s3://my-bucket/{table}/
-t TABLES, --tables TABLES
(Optional) comma-separated list of tables that need to
be inspected. If not supplied, all tables will be
imported.
```
For example, here is a simple command that will generate an import command given the [test database](tests/test.db):
```bash
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/
```
This will output:
```
sqoop import --connect=sqlite:///tests/test.db --table=test --target-dir=s3://foo-bar/
```
If you'd like to programmatically add the table name to the `target-dir`, use `{table}`:
```
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/{table}
```
This will output:
```
sqoop import --connect=sqlite:///tests/test.db --table=test --target-dir=s3://foo-bar/test/
```
If you'd like to use a custom list of tables to import, use the `--tables` argument, with each table name separated by a comma:
```
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/{table} --tables=test
```
Finally, you can also passthrough any other `sqoop import` arguments:
```bash
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/{table} --tables=test --split-by id --num-mappers 4
```
This will output:
```
sqoop import --connect=sqlite:///tests/test.db --table=test --target-dir=s3://foo-bar/test/ --split-by id --num-mappers 4
```
## Tests
You can run tests by first installing `nose`:
```
$ pip install nose
$ nosetests
```
======
Python CLI to generate custom [sqoop](http://sqoop.apache.org/) import statements.
Modified from [https://github.com/wikimedia/sqoopy/](https://github.com/wikimedia/sqoopy/).
## Installation
You can install `sqoopy` via `pip`:
```bash
$ pip install sqoopy
```
## Usage
`sqoopy` will generate custom [sqoop](http://sqoop.apache.org/) import statements given a few simple options:
```bash
usage: sqoopy [-h] [-c CONNECT] [-d TARGET_DIR] [-t TABLES]
Python CLI to generate custom sqoop import statements.
optional arguments:
-h, --help show this help message and exit
-c CONNECT, --connect CONNECT
A jdbc connection string.
-d TARGET_DIR, --target-dir TARGET_DIR
The directory to send output to. If sending to s3, use
"{table}" to insert the table name into the directory.
EG: s3://my-bucket/{table}/
-t TABLES, --tables TABLES
(Optional) comma-separated list of tables that need to
be inspected. If not supplied, all tables will be
imported.
```
For example, here is a simple command that will generate an import command given the [test database](tests/test.db):
```bash
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/
```
This will output:
```
sqoop import --connect=sqlite:///tests/test.db --table=test --target-dir=s3://foo-bar/
```
If you'd like to programmatically add the table name to the `target-dir`, use `{table}`:
```
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/{table}
```
This will output:
```
sqoop import --connect=sqlite:///tests/test.db --table=test --target-dir=s3://foo-bar/test/
```
If you'd like to use a custom list of tables to import, use the `--tables` argument, with each table name separated by a comma:
```
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/{table} --tables=test
```
Finally, you can also passthrough any other `sqoop import` arguments:
```bash
$ sqoopy --connect=sqlite:///tests/test.db --target-dir=s3://foo-bar/{table} --tables=test --split-by id --num-mappers 4
```
This will output:
```
sqoop import --connect=sqlite:///tests/test.db --table=test --target-dir=s3://foo-bar/test/ --split-by id --num-mappers 4
```
## Tests
You can run tests by first installing `nose`:
```
$ pip install nose
$ nosetests
```
Release files for sqoopy 0.0.75
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sqoopy-0.0.75.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sqoopy-0.0.75.macosx-10.10-intel.exe | Details |
Total release size: 113.9 kB
Release files / sqoopy-0.0.75.tar.gz
| Download URL | sqoopy-0.0.75.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f9072bba996ee3ef6b1b17a1784c5186bcbb9b4cb34399e7a5178f7828aaebd
|
|
BLAKE2b-256 checksum How to use checksums |
4df6255f93da5c211d751f6af2c9dc3aded9eba08e14f0dddaa4b80d5e1662ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sqoopy-0.0.75.macosx-10.10-intel.exe
| Download URL | sqoopy-0.0.75.macosx-10.10-intel.exe |
|---|---|
| Size | 108.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
592b0f32ab8a88b49b1dd11051fe7468b0cf38b3759b0f1afd905bab4908c69b
|
|
BLAKE2b-256 checksum How to use checksums |
7565c5336d20b6356789ed6777b4d6d7c4573de1179808227ae74d2d3e4233e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |