Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiles & Formats (Airtable (JSON)) #44

Closed
IAmVigneswaran opened this issue Apr 28, 2023 · 10 comments
Closed

Profiles & Formats (Airtable (JSON)) #44

IAmVigneswaran opened this issue Apr 28, 2023 · 10 comments
Assignees
Labels
enhancement New feature or request profiles Ideas for new profiles
Milestone

Comments

@IAmVigneswaran
Copy link
Contributor

@orchetect I wondering if we can add an additional profile for Airtable that is in JSON format.

If @theogscott going to use AirtableKit, it would be great if the CLI and Library is able to provide a native way to generate the output data in JSON format.

From the example of AirtableKit, the library will aspects data in this format :

let fields: [[String: Any]] = [
  [
    "name" : "Record 1",
    "isCool" : true
    "age" : 25,
    "updatedTime" : Date()
  ],
  [
    "name" : "Record 2",
    "isCool" : true
    "age" : 22,
    "updatedTime" : Date()
  ]
]

let records = fields.map { Record(fields: $0) }

let publisher = airtable.create(tableName: tableName, records: records)

I wonder if it would allow easier facilitation of uploading the data directly to Airtable via Marker Data App. Hence, @theogscott could pass the .json file programmatically.

The current Airtable profile could be rename to Airtable (CSV). We could still keep the this profile for users who want to upload the data manually.

@IAmVigneswaran IAmVigneswaran added enhancement New feature or request profiles Ideas for new profiles labels Apr 28, 2023
@orchetect
Copy link
Contributor

JSON is definitely possible and not hard to add.

Would the key names be the same as the CSV table column names?

@IAmVigneswaran
Copy link
Contributor Author

Yes, the key column names would be identical to our Airtable CSV.

@orchetect
Copy link
Contributor

orchetect commented Apr 28, 2023

Why not just always output both a csv file and a json file? No additional arguments or options required and it's no extra overhead really.

The done file can contain both file paths.

@orchetect
Copy link
Contributor

This is implemented. Will be in next alpha build.

@orchetect orchetect added the pending closure This issue is completed and will be closed soon label Apr 28, 2023
@IAmVigneswaran
Copy link
Contributor Author

Why not just always output both a csv file and a json file? No additional arguments or options required and it's no extra overhead really.

The done file can contain both file paths.

Yes, that could work too! Thank you.

@orchetect orchetect self-assigned this Apr 28, 2023
@orchetect orchetect added this to the 0.2.0 milestone Nov 1, 2023
@orchetect orchetect removed the pending closure This issue is completed and will be closed soon label Nov 1, 2023
@IAmVigneswaran
Copy link
Contributor Author

Even though Airlift supports both .csv or .json, I think we can remove creation of .json file for Airtable profile. It becomes a little redundant in our use-case.

This is to standardise output format filetype.

@IAmVigneswaran IAmVigneswaran modified the milestones: 0.2.0, 0.2.4 Nov 22, 2023
@orchetect
Copy link
Contributor

There isn't any harm in generating both files and it takes zero time and very little disk space. If it's ever needed in future then you already have it.

@IAmVigneswaran
Copy link
Contributor Author

There isn't any harm in generating both files and it takes zero time and very little disk space. If it's ever needed in future then you already have it.

True, there is no harm.

We just the code in but we just off the generation part for now?

@orchetect
Copy link
Contributor

Sure, if you want.

@IAmVigneswaran
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request profiles Ideas for new profiles
Projects
None yet
Development

No branches or pull requests

2 participants