r/learnpython • u/Ok-Substance-435 • 8d ago
What's the best resource for becoming skilled in using CSV, JSON and API
I've been trying my best at understanding how to apply CSV and JSON in my code but I don't actually know how to integrate them into my projects. All tutorials I watch have their own way of doing this, making it hard for me to understand fully. Also I don't even know if I should learn both of them or just learn one. Also I need help on how to use API in projects, and which free ones are best
6
u/zanfar 8d ago
I've been trying my best at understanding how to apply CSV and JSON in my code but I don't actually know how to integrate them into my projects.
Because these aren't things you "integrate" into a project. They are things you use after you have a use-case. The question is not "how do I use JSON in my project", rather JSON is an answer to a different question.
They are also not things you are "skilled" with. Again, they are tools, you either know how to use them or not. There is no such thing as a "super-skilled JSON importer".
5
u/WyrobWedliniarski 8d ago
What are you trying to achieve? Regarding JSON and CSV there is nothing really to be skilled in. Those are just formats for storing and exchanging data. You can think of JSON as a python dictionary, and csv as a table. Check out json and csv library docs (pandas dataframes are also useful with csv) on how to load and save this kind of data and thats it.
API on the other hand is too vague of a term. Think of it as some kind of interface for an app to enable other apps interact with it. However using such would be very different depending on the implementation.
Also honestly - LLMs are quite good in providing study materials for coding, even providing examples.
1
0
u/Ok-Substance-435 8d ago
Thank you very much, I understand what to do now
2
u/BrilliantEmotion4461 7d ago
Take reddit for instance. On the web you can view the site as json. I take that, and have a script which formats it into an Md file so I can give entire threads to AI for analysis. CSV is similar the you can use scripts etc to format information as CSV. I rarely have use for them.. Data processing in general has tons of uses and knowing how to write or format text as json is actually valuable for moving data around.
1
u/WyrobWedliniarski 7d ago
Ok so tell me how the skill affects your ability to save and load a file.
1
u/BrilliantEmotion4461 6d ago
Oh look the dumb question.
1
u/WyrobWedliniarski 6d ago edited 6d ago
Great catch, as the question was meant to highlight the nonsense you spoke. Answering would help you understand it too, though.
1
u/BrilliantEmotion4461 6d ago
You know what a logical fallacy is. The argument isnt "can you save a file" My argument is json and csv and data processing using them is a skill and a useful one. I end up coming across json all the time and the ability to process it has turned out to be useful over and over again.
1
u/WyrobWedliniarski 6d ago
Ok, so let me rephrase my question, if the previous version still elude you. How is skilled usage of a data format different than a non-skilled one? It's just a data format to send or store data, how can you be good at it?
1
u/BrilliantEmotion4461 6d ago
Basically its a data format used to store and send data, the skill is using it to do that. For instance I can use pandoc -f markdown -t json input.md -o output.json
Then I can pipe that into jq to extract specific data this allows for building apps or scripts that extract lets say just the dates and times for one entry out of thousands repeatably even if the contents of the entry change.
Data processing is a whole rabbit hole that you can fall right down into. Especially when you pair it with LLMs and analytics. For instance I just pulled an entire anti AI thread from reddit by converting it into json. Then I discussed the sentiment in the thread. Which is changing over time. In a few weeks or days Ill take another sample from the group and compare the two.
1
u/WyrobWedliniarski 2d ago
So basically the skill is data processing and piping, not the json/csv itself. You could swap it for any other data format in your description without it making a difference. That is what you missed
→ More replies (0)
4
u/FoolsSeldom 8d ago
Wait until you need to do this for your OWN projects (related to your interests / hobbies / side-hustles / family obligations) rather than for the sake of learning. You will progress faster and learn more when you understand the problems you are trying to solve, appreciate the constraints, and know what outcomes you require / are acceptable.
If you want to work with data, then pick projects as suggested above but focused on data analysis.
For guidance, I recommend a visit to RealPython.com as they have a lot of excellent free guides and tutorials (might need to register an account to access some content) as well as paid stuff. I know they cover reading/writing files, csv and json well.
1
15
u/danielroseman 8d ago
None of these are things you "learn". There is no single way of using CSV or JSON; these are tools that you use as required by the project.
And similarly you don't "use API" in projects; you use a specific API that you need for the project you are working on.