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

Add --optimized mode #55

Open
igorbrigadir opened this issue Nov 7, 2022 · 4 comments
Open

Add --optimized mode #55

igorbrigadir opened this issue Nov 7, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@igorbrigadir
Copy link
Collaborator

igorbrigadir commented Nov 7, 2022

The current output favors preserving as much information as possible from the original json, but there is some duplication, and a bunch of columns can be removed as they're rarely super useful.

The new --optimized mode will generate CSVs that drop a bunch of columns to save space:

edit_controls.edits_remaining
edit_controls.editable_until
entities.cashtags
entities.hashtags
entities.mentions
withheld.scope
withheld.copyright
author.id
author.entities.description.cashtags
author.entities.description.hashtags
author.entities.description.mentions
author.url
author.withheld.scope
author.withheld.copyright
geo.coordinates.coordinates
geo.coordinates.type
geo.country
geo.full_name
geo.geo.type
matching_rules
__twarc.retrieved_at
__twarc.url
__twarc.version

(exact list to be revised later)

These are the most commonly not present or duplicate ones, where the missing data can be inferred from the columns left over, or with the cashtags, hashtags, mentions, with twitter-text for example.

Should probably fix #36 and #47 first before this.

@edsu
Copy link
Member

edsu commented Nov 7, 2022

I'm interested in hearing where the need for this optimization arose. Was it a problem generating the CSV, or reading the generated CSV in another application? It sounds like the latter?

@igorbrigadir
Copy link
Collaborator Author

Just trying to deduplicate columns and remove mostly empty ones, so more can fit into memory, and other tools like great expectations or pandas profiling have an easier time.

@edsu
Copy link
Member

edsu commented Nov 7, 2022

Would being able to write to parquet help in situations like that?

@igorbrigadir
Copy link
Collaborator Author

Yep! Definitely i think #29 goes hand in hand with this - I think all of these things are basically the same task for me to do lol

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

No branches or pull requests

2 participants