I've been attempting for a while now to get pydrive to accept my google doc files now. I've tried to find ways to convert .gdoc's to .docx's so I can use the python-docx package to read them, since all the packages I have found have been really confusing to try and learn to use.
Basically want I'm attempting to do is to read a table from a google doc and use the data in that table to create a dictionary with things such as {'xsubject': {'Monday': 'Assignment...}...}. If there is a package that can just read google docs tables, I guess that would be useful. Any help would be appreciated.
Also, since I am working in colab the google docs api quickstart does not seem to work for me. It attempts to open a localhost page and it doesn't show anything nor does it attempt to load.
Related
My Problem
I want to be able to migrate my Google Docs to a regular website while maintaining the links I had created between my Google Docs. Frequently I link one Google Doc to another Google Doc. As a result, I have created something that is similar to a wiki. For example let’s suppose I had created two Google Docs: Google Doc #1 and Google Doc #2.
Subsequently let’s suppose I had created a link (a hyperlink) in Google Doc #1 to Google Doc #2. Of course that's an extremely simple example. Let’s make it more complex. Imagine I had created a couple of thousand Google Docs with many links (hyperlinks) between them.
Of course backing up those Google Docs would be trivial either by using Google Takeout or rsync. However, what would happen if I wanted to move those Google Docs to a regular website? Then the myriad hyperlinks I had created would fail to point to the documents on my regular website.
That is, on my regular website, if I were to click on the link on the page which contained the contents which had been contained in Google Doc #1 (https://my_regular_website.com/google_doc_001) then instead of opening a link on my regular website to the page which contained the contents which had been contained in Google Doc #2 (https://my_regular_website.com/google_doc_002) , the link would point to the original Google Doc #2 (https://drive.google.com/drive/folders/google_doc_002)
My Technical Question
I read that, “You can use the 'contentRestrictions.readOnly' field on a `file' resource to lock a file and prevent modifications to the title, uploading a new revision, and addition of comments.” Source: Protect file content from modification
However, I would like to prevent modifications to the title file yet allow the contents of the file to be edited. For example, I might name a file something like, “1cn2OX4U67mY925GzG80hRBYjpqq2conSi9xgYikgwIM” which is the unique portion of a Google Docs URL.
That way, on my regular website, by using a simple regex, I could “relink” documents that pointed to https://docs.google.com/document/d/1cn2OX4U67mY925GzG80hRBYjpqq2conSi9xgYikgwIM
Final Thoughts
I like using Google Docs as, dare I say it, a word processor. Sometimes I use Google Docs to write essays. Sometimes I use Google Docs to create documentation. Sometimes I use Google Docs to collaborate with others (instead of emailing). Furthermore, I often use Google Docs’ outline format, styles, and voice typing.
Sure, I suppose I could use an actual wiki. But although I’ve tried many different wikis over the years, I never enjoyed using them. I found them to be clunky and overly simplistic. Furthermore, I didn’t enjoy installing them and needing to back them up. At this point In time, I don't want to have to install and maintain any software on a VPS (virtual private server).
I checked the documentation you are referring to and what you are trying to achieve is not possible, making a document read only will prevent a new revision of the file to be created.
For instance that won't allow you to change comments, content and title. At this time it is not possible to prevent some modifications, just all or none.
Regards.
i want to make a Wikipedia fandom command for my bot which searches articles from a specific Wikipedia fandom page but don't know how can I get any information about how I can do that? searching on YouTube or Google didn't help and didn't get any results
I've seen a couple places on their forums saying they have an outdated API of which I could not find any docs on, so with some more digging into that you might be able to use that with axios or any other HTTP request module. Or you have the option of looking at how they structure their data on webpages and write a small webscraper script depending on exactly what information you want to extract.
An alternative would be to supply the user with a link to the page using an Embed, either way hope this helps.
Edit:
Someone in the comments says there is an API so check that out first
I looked thru the internet and didn't found a solution how to make this:
I want to make google extension which will use Google API or something to connect the extension to Google drive and create/update files there( i will need mostly plain text documents to store there arrays). i will need it only for personal use, so any hacks are also acceptable.
Have anyone done anything like this before? i just need the starting point.
I have made an example that is available on Github. It is available here. It transforms the some emails from GMails into PDFs stored in Drive.
You can reuse it, you simply need to copy the Drive part and not the GMail API part. The steps you'll need to follow are :
Use the Chrome identity API to retrieve an access token for the Drive API
Use the Drive API javascript client to upload your text files. The tricky part is to upload it properly, use the examples on the github project to see what the request should look like.
I'm looking for good resources to refer to, when configuring geokettle. The docs folder in the installation does not contain a user guide. I have googled for tutorials to no avail. Searching community.pentaho.com does not seem to yield any useful results. The samples folder in the installation contains some examples but I haven't quite found what I am looking for:
For example, pulling data from a database and have it show on a map.
If on the other hand, it is better to use a separate geospatial analysis tool with the community edition of pentaho and integrate to the BI Server, your suggestions are also welcome.
Any form of reference will be accepted.
Rumbi
I dont know for sure but have you tried the forum?
http://www.spatialytics.com/forum/
Also ask them on twitter perhaps: #FORUM_GeoBI
These days I keep most of my development notes and documentations in Google Docs. There are time that I'd like to download everything. How is this possible on a Mac and Linux computers, without doing each one individually? Google used to have the ability to download all spreadsheets. However, I can no longer find this functionality.
I would like to have the documents in Open Office or HTML format. Thanks.
If you install google gears into your browser: http://gears.google.com/
You can use the built-in offline functionality inside of google docs
If you really want to roll up your sleeves, use the gdata API
http://code.google.com/p/gdatacopier/
I looked into Joe's answer. gdatacopier is a useful tool to bulk download documents. Here's one example that I use to download all my spreadsheets from a named folder.
gdoc-cp.py -e csv -g spreadsheets -o /tmp -u me#gmail.com -p password -f "MyFolder"
There are several examples in the documentation. One limitation is that it does not seem to work for hosted domains. All email addresses must be foo#gmail.com.
Bulk uploads seem quite doable too. Getting this example to work was straight forward.
http://www.webmonkey.com/tutorial/Create_Automated_Backups_in_Google_Docs_Using_the_GData_API
GDocBackup http://gs.fhtino.it/gdocbackup
C#, Open Source, runs on Win + Net and Linux + Mono (not tested on Mac + Mono, sorry).
You can do this easily with the Google Drive API. I have a blog post featuring a short Python script that exports a Google Sheet as CSV. You can take that example, and make these changes to make it work for you:
Source MIMEtype goes from Sheets to Docs -- for all G Suite/Google Apps (import) MIMEtypes, see this page
Destination MIMEtype changes from CSV to whatever you want that's supported (Open Office & HTML included) -- for all export MIMEtypes, see this page
If you prefer to use something other than Python, use that example as pseudocode, then create your solution in any language supported by the Google APIs Client Libraries. Sample code in other languages can also be found on this page.
Once you're done, stick it in some cron job to run it regularly without you having to think about it -- you may have to add timestamping to the exported filenames to prevent overwrites. Hope this helps!