Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MeltanoLabs/tap-csv
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: YouCruit/tap-csv
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Apr 6, 2022

  1. Copy the full SHA
    b58e56f View commit details
  2. Happy with incremental

    spacecowboy committed Apr 6, 2022
    Copy the full SHA
    66e7dec View commit details
  3. Copy the full SHA
    4f82f0d View commit details
  4. Copy the full SHA
    85f80e5 View commit details
  5. Fixed lint errors

    spacecowboy committed Apr 6, 2022
    Copy the full SHA
    1830407 View commit details

Commits on Apr 7, 2022

  1. Copy the full SHA
    f69b4dd View commit details
  2. Fixed start from casing

    spacecowboy committed Apr 7, 2022
    Copy the full SHA
    16adbb7 View commit details
  3. Copy the full SHA
    9f1f766 View commit details
  4. Copy the full SHA
    077091d View commit details
  5. Copy the full SHA
    90ad619 View commit details

Commits on Apr 20, 2022

  1. Copy the full SHA
    9026c42 View commit details
  2. Copy the full SHA
    cb11609 View commit details
  3. Fixed crash

    spacecowboy committed Apr 20, 2022
    Copy the full SHA
    f4e147a View commit details
  4. Handle missing files

    spacecowboy committed Apr 20, 2022
    Copy the full SHA
    ff3b953 View commit details

Commits on Apr 26, 2022

  1. Added dialect option

    spacecowboy committed Apr 26, 2022
    Copy the full SHA
    2b71485 View commit details
  2. Copy the full SHA
    843cf1b View commit details
  3. Copy the full SHA
    dee950f View commit details

Commits on Sep 30, 2022

  1. Copy the full SHA
    22671fc View commit details
  2. Added sample config

    spacecowboy committed Sep 30, 2022
    Copy the full SHA
    cdd4c89 View commit details
  3. Upgraded SDK version

    spacecowboy committed Sep 30, 2022
    Copy the full SHA
    f61b0fa View commit details
  4. Added some info prints

    spacecowboy committed Sep 30, 2022
    Copy the full SHA
    c4eeaa8 View commit details
  5. Formatted code

    spacecowboy committed Sep 30, 2022
    Copy the full SHA
    d675203 View commit details

Commits on Oct 4, 2022

  1. Batch size is unlimited

    spacecowboy committed Oct 4, 2022
    Copy the full SHA
    350146a View commit details
  2. Added batch config

    spacecowboy committed Oct 4, 2022
    Copy the full SHA
    5035fb6 View commit details
  3. Copy the full SHA
    2f076d6 View commit details
  4. Print tweaks

    spacecowboy committed Oct 4, 2022
    Copy the full SHA
    4494d90 View commit details
  5. Copy the full SHA
    3460b8a View commit details
  6. Tweaks

    spacecowboy committed Oct 4, 2022
    Copy the full SHA
    eda2455 View commit details
  7. Copy the full SHA
    b37c18a View commit details
  8. Copy the full SHA
    ec4702d View commit details

Commits on Oct 10, 2022

  1. Format code

    spacecowboy committed Oct 10, 2022
    Copy the full SHA
    07c3a0b View commit details
  2. Merge pull request #1 from YouCruit/batch

    Batch
    spacecowboy authored Oct 10, 2022
    Copy the full SHA
    833b020 View commit details
Showing with 969 additions and 769 deletions.
  1. +14 −0 .editorconfig
  2. +58 −26 README.md
  3. +237 −679 poetry.lock
  4. +4 −4 pyproject.toml
  5. +10 −0 sample-config.json
  6. +30 −0 tap_csv/__init__.py
  7. +234 −47 tap_csv/client.py
  8. +83 −8 tap_csv/tap.py
  9. +9 −0 tap_csv/tests/data/alphabet.csv
  10. +4 −0 tap_csv/tests/data/header_a_yes.csv
  11. +3 −0 tap_csv/tests/data/header_z_no.csv
  12. +13 −0 tap_csv/tests/data/tab.txt
  13. +13 −0 tap_csv/tests/data/tilde.txt
  14. +254 −1 tap_csv/tests/test_core.py
  15. +3 −4 tox.ini
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space

[*.json]
indent_size = 2

[*.py]
indent_style = space
indent_size = 4
84 changes: 58 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,12 +7,11 @@ Built with the [Meltano SDK](https://sdk.meltano.com) for Singer Taps and Target

## Capabilities

* `state`
* `sync`
* `catalog`
* `discover`

Note: This tap currently does not support incremental state.

## Settings

| Setting | Required | Default | Description |
@@ -22,25 +21,52 @@ Note: This tap currently does not support incremental state.

A full list of supported settings and capabilities is available by running: `tap-csv --about`

The `config.json` contains an array called `files` that consists of dictionary objects detailing each destination table to be passed to Singer. Each of those entries contains:
The `config.json` contains an array called `files` that consists of dictionary objects detailing each destination table to be passed to Singer. Each of those entries contains:
* `entity`: The entity name to be passed to singer (i.e. the table)
* `path`: Local path to the file to be ingested. Note that this may be a directory, in which case all files in that directory and any of its subdirectories will be recursively processed
* `path`: Local path to the file to be ingested. Note that this may be a directory, in which case all files in that directory be processed if they also match the `prefix`.
* `prefix`: The required (case-insensitive) prefix of the filename for it to be processed.
* `keys`: The names of the columns that constitute the unique keys for that entity
* `start_from`: The replication key to start from. The format is `filename:rownumber` in lowercase.
* `delimiter`: What separator is used in the CSV files.
* `dialect`: What dialect is used in the CSV files. See <https://docs.python.org/3/library/csv.html#csv.list_dialects>
* `encoding`: What encoding is used in the CSV files.
* `quotechar`: What character is used for quoting in the CSV files.
* `header`: In case some or all files are missing a header, it can be specified here. Rows which match the specified header are skipped. So files with or without headers can be included in the same batch.

It is also possible to define a global `path` value which will be used as a fallback in case `path` is not specified for
the individual files object.

Example:

```json
{
"files": [
{ "entity" : "leads",
"path" : "/path/to/leads.csv",
"keys" : ["Id"]
},
{ "entity" : "opportunities",
"path" : "/path/to/opportunities.csv",
"keys" : ["Id"]
}
]
"path": "/path/to/default/",
"files": [
{
"entity": "leads",
"path": "/path/to/leads/",
"prefix": "lead_con",
"delimiter": ",",
"dialect": "excel",
"encoding": "utf-8",
"quotechar": "\"",
"header": [
"Id",
"Column1",
"Column2"
],
"keys": [
"Id"
],
"start_from": "lead_contracts.csv:8"
},
{
"entity": "opportunities",
"keys": [
"Id"
]
}
]
}
```

@@ -49,29 +75,35 @@ Optionally, the files definition can be provided by an external json file:
**config.json**
```json
{
"path": "/path/to/default/",
"csv_files_definition": "files_def.json"
}
```


**files_def.json**
```json
[
{ "entity" : "leads",
"path" : "/path/to/leads.csv",
"keys" : ["Id"]
},
{ "entity" : "opportunities",
"path" : "/path/to/opportunities.csv",
"keys" : ["Id"]
}
[
{
"entity": "leads",
"path": "/path/to/leads.csv",
"keys": [
"Id"
]
},
{
"entity": "opportunities",
"path": "opportunities.csv",
"keys": [
"Id"
]
}
]
```

## Installation

```bash
pipx install git+https://github.com/MeltanoLabs/tap-csv.git
pipx install git+https://github.com/youcruit/tap-csv.git
```

## Usage
@@ -142,5 +174,5 @@ meltano elt tap-csv target-jsonl

### SDK Dev Guide

See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
develop your own taps and targets.
Loading