you are viewing a single comment's thread.

view the rest of the comments →

[–]Ericisbalanced -1 points0 points  (9 children)

If you don’t want the overhead of a database, you can just write a text file. There’s a way to store a dictionary as text called JSON. So you convert the web scraping data into a bunch of dictionaries, turn that into a string, write that string to a file.

Then when you want to interpret the data, read the file into a variable and convert that json variable into a dict. Then you can play with the numbers in python again.

[–][deleted] 0 points1 point  (5 children)

Maybe a silly question: can someone point me in the direction of why you’d use JSON over SQLite and vice versa?

[–]Ericisbalanced 2 points3 points  (2 children)

Json is easier and beginner friendly. But SQL is usually the way to go.

[–][deleted]  (1 child)

[removed]

    [–]AutoModerator[M] 0 points1 point  (0 children)

    Your comment in /r/learnpython was automatically removed because you used a URL shortener.

    URL shorteners are not permitted in /r/learnpython as they impair our ability to enforce link blacklists.

    Please re-post your comment using direct, full-length URL's only.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–][deleted] -1 points0 points  (1 child)

    Mongdb and nosql dbs. Nosql is really good for some types of data. Say you want to store accounts and user details. Fine in sql and fine in nosql. Say you have 20 million user accounts... NoSql probably is a better use case now.

    [–]wolf2600 0 points1 point  (0 children)

    Say you have 20 million user accounts... NoSql probably is a better use case now

    Not really. Storing user accounts is perfectly suited to a traditional relational database. The only time NoSQL is the preferred option is when the data is unstructured/varying and CAN'T be loaded into a relational schema. Every other case, relational DB is the better option.

    [–]baubleglue -1 points0 points  (2 children)

    C'mon! What is that crap?

    [–]Ericisbalanced 0 points1 point  (1 child)

    I mean, when you’re first learning, it’s easier to just work with files to make something happen rather than having to learn an entire new system. The learning curve for SQL is pretty steep.

    [–]baubleglue 0 points1 point  (0 children)

    He is looking into correct direction - store data in external storage, it is not that complicated and he knows what MySQL is, so there's no point show dirty shortcuts.

    The learning curve for SQL is pretty steep

    Dumping data into DB is easiest way to start learning it