etl_ruby_wrapper 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +70 -0
- data/Rakefile +4 -0
- data/lib/etl_ruby_wrapper/version.rb +5 -0
- data/lib/etl_ruby_wrapper.rb +18 -0
- data/sig/etl_ruby_wrapper.rbs +4 -0
- metadata +55 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4fd9e6332e76a82686f74a9053f726b2d7fc71cec78cab8d331024f522988d38
|
4
|
+
data.tar.gz: 79ed2aa35256f0607fe85da102569c3941023a94ba3ab6577b4c50ce672e432b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5077711b23843eaa5ea6c8a10d6a0f4ac7837ebbea2d16914ce2cf6718195fd95aafcce3397c30eab1e773515855a75d9e0068f455adce623a1677b4066a10cd
|
7
|
+
data.tar.gz: 6db967bd376e6b2826331f0c56ca7e1657d467989df91a3b9d7a48f24f33768e5640054571f5c1a36433e9e3c90743bd8203cfec4c8a5307902130c88323fa94
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Trip Shanti
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# EtlRubyWrapper
|
2
|
+
|
3
|
+
EtlRubyWrapper is a Ruby gem that facilitates Extract, Transform, Load (ETL) operations by running a Go binary within a Ruby environment. It’s designed for projects that need efficient data processing using Go, with the convenience of orchestrating and handling processes in Ruby. This gem is especially useful for data migration tasks or integrating external data into your application.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
Add the gem to your application's Gemfile by executing:
|
7
|
+
|
8
|
+
```bash
|
9
|
+
Copy code
|
10
|
+
$ bundle add etl_ruby_wrapper
|
11
|
+
```
|
12
|
+
|
13
|
+
Or, if Bundler isn’t being used, install the gem directly:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
Copy code
|
17
|
+
$ gem install etl_ruby_wrapper
|
18
|
+
```
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
Here's an example of how to use EtlRubyWrapper:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
Copy code
|
25
|
+
require 'etl_ruby_wrapper'
|
26
|
+
|
27
|
+
# Initialize the ETL wrapper
|
28
|
+
wrapper = EtlRubyWrapper::ETL.new
|
29
|
+
|
30
|
+
# Set up paths
|
31
|
+
csv_path = "path/to/your_data.csv"
|
32
|
+
db_conn_str = "user=youruser dbname=yourdb sslmode=disable"
|
33
|
+
|
34
|
+
# Run the ETL process
|
35
|
+
begin
|
36
|
+
wrapper.run_etl(csv_path, db_conn_str)
|
37
|
+
puts "ETL Process Completed Successfully!"
|
38
|
+
rescue => e
|
39
|
+
puts "An error occurred: #{e.message}"
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
In this example, replace csv_path and db_conn_str with the paths to your CSV file and PostgreSQL connection string, respectively.
|
44
|
+
|
45
|
+
## Development
|
46
|
+
|
47
|
+
After checking out the repo, run bin/setup to install dependencies. Use bin/console for an interactive prompt to experiment with the code.
|
48
|
+
|
49
|
+
To install this gem onto your local machine, run:
|
50
|
+
|
51
|
+
```bash
|
52
|
+
Copy code
|
53
|
+
bundle exec rake install
|
54
|
+
```
|
55
|
+
|
56
|
+
To release a new version, update the version number in version.rb, then run:
|
57
|
+
|
58
|
+
```bash
|
59
|
+
Copy code
|
60
|
+
bundle exec rake release
|
61
|
+
```
|
62
|
+
|
63
|
+
This will create a git tag for the version, push the git commits and tag, and push the .gem file to rubygems.org.
|
64
|
+
|
65
|
+
## Contributing
|
66
|
+
|
67
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/gotoAndBliss/etl_ruby_wrapper. Please feel free to open issues or contribute to improve this gem.
|
68
|
+
|
69
|
+
## License
|
70
|
+
The gem is available as open source under the terms of the MIT License.
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module EtlRubyWrapper
|
2
|
+
class ETL
|
3
|
+
def binary_path
|
4
|
+
path = File.expand_path("../bin/etl_binary/etl_ruby_wrapper", __dir__)
|
5
|
+
puts "Computed binary path: #{path}"
|
6
|
+
path
|
7
|
+
end
|
8
|
+
|
9
|
+
def run_etl(csv_path = "path/to/data.csv", db_conn_str = "your_database_connection_string")
|
10
|
+
cmd = "#{binary_path} -csv=#{csv_path} -db='#{db_conn_str}'"
|
11
|
+
success = system(cmd)
|
12
|
+
|
13
|
+
unless success
|
14
|
+
raise "ETL binary not found or failed to execute"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: etl_ruby_wrapper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Trip Shanti
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-11-03 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: EtlRubyWrapper is a Ruby gem designed to facilitate ETL (Extract, Transform,
|
14
|
+
Load) operations by executing a Go binary. This gem allows you to easily run ETL
|
15
|
+
processes by managing the binary execution and error handling within a Ruby application.
|
16
|
+
It's ideal for projects that need efficient data processing but prefer leveraging
|
17
|
+
Ruby's simplicity for orchestration.
|
18
|
+
email:
|
19
|
+
- dev@sanskrit.one
|
20
|
+
executables: []
|
21
|
+
extensions: []
|
22
|
+
extra_rdoc_files: []
|
23
|
+
files:
|
24
|
+
- LICENSE.txt
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- lib/etl_ruby_wrapper.rb
|
28
|
+
- lib/etl_ruby_wrapper/version.rb
|
29
|
+
- sig/etl_ruby_wrapper.rbs
|
30
|
+
homepage: https://github.com/gotoAndBliss/etl_ruby_wrapper
|
31
|
+
licenses:
|
32
|
+
- MIT
|
33
|
+
metadata:
|
34
|
+
homepage_uri: https://github.com/gotoAndBliss/etl_ruby_wrapper
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
require_paths:
|
38
|
+
- lib
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 3.0.0
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubygems_version: 3.5.16
|
51
|
+
signing_key:
|
52
|
+
specification_version: 4
|
53
|
+
summary: A Ruby wrapper for running custom ETL (Extract, Transform, Load) processes
|
54
|
+
using a Go binary.
|
55
|
+
test_files: []
|