5

I am writing a script that will be used by multiple users, and I am looking for a way to sync settings and other variables throughout them all. My first instinct fell upon using an online database, but looking through this site, and the wider web I couldn't find anything.

What I need is something that I can write to and read from using python script. This could be a database, but I also have multiple online hosting accounts (Mega, Dropbox, Skydrive, Google Drive) and if anybody knows any APIs I could use to read & write files to these services, that would do as well.

This question is sort-of what I was looking for, but it was closed as "not a real question" before a suitable answer. https://stackoverflow.com/questions/13149328/modify-online-file-with-python

To be clear, I am looking for a way to edit database entries in a database hosted online, using a script on a different PC - and a way to read them.

Also, if anybody knows of any free online-database hosting that I could access through Python, much appreciated - quite like you can get free web hosting or free file hosting.

UPDATE: Thanks to both who answered, but unfortunetly when trying MySQLDb, I found that it only supports python 2.x (sorry - I forgot to mention that I use 3). I did, however, find another option while trying this. MySQL have their own python connector to access MySQL databases through Python found here (http://dev.mysql.com/doc/refman/5.6/en/connector-python.html), and that works for both Python versions (1&2).

Community
  • 1
  • 1
Cailean Wilkinson
  • 1,420
  • 2
  • 19
  • 32
  • What type of database MySQL, etc? –  Apr 21 '13 at 21:01
  • Using a consumer data storage service (Dropbox, Skydrive, Google Drive, etc.) as a database for an application is probably a violation of their ToS, and not a very good idea for your app. However, if each user has their own data, and no data is shared between different users, then you can store some data in Dropbox or Google Drive *on the user's behalf*, with the *user's* account (that's why none of the data is shared). That's a valid use of their APIs. – Linuxios Apr 21 '13 at 21:05
  • @enginefree I would prefere MySQL, but I am open to suggestions, if people know ways to access other databases. – Cailean Wilkinson Apr 21 '13 at 21:21
  • @Linuxios if this is a script that won't be distributed, only used by me and a small group, all on my account on my behalf, would that still be likely to violate T&Cs? – Cailean Wilkinson Apr 21 '13 at 21:23
  • Probably, but I doubt anyone will chase you about it. – Linuxios Apr 21 '13 at 21:50
  • Thanks to both who answered. I'm not at my PC at the moment (browsing on an iPad), but I'll try both when I next get on it tomorrow at some point. – Cailean Wilkinson Apr 21 '13 at 21:58
  • [Solution](https://stackoverflow.com/a/75639931/6013016) – Scott Mar 05 '23 at 02:49

1 Answers1

2

RethinkDB is a newish database system that is very easy to use with Python, and comes with a Python API. You can do everything you'd need with a database through Python, and its a pretty easy system to get going quickly

James Cook
  • 106
  • 3
  • Since it appears you are looking maybe for a free host also, I should add that RethinkDB is just the database software. You can install it on your own machine or any host you have install access to. Its definitely the easiest choice for python friendly DB though. – James Cook Apr 22 '13 at 16:49
  • [Solution](https://stackoverflow.com/a/75639931/6013016) – Scott Mar 05 '23 at 02:49