benborgers / opensheet

💾 An API to get a Google Sheet as JSON, no authentication required.
https://opensheet.elk.sh
MIT License
610 stars 117 forks source link

Access sheet names #25

Closed twMat closed 1 year ago

twMat commented 1 year ago

First, thanks for opensheet @benborgers !!!

It would be very useful if it is possible to access the tab/sheet names in a given Sheets file. According to this thread it should be possible like so:

https://sheets.googleapis.com/v4/spreadsheets/1AtYF5g2_A3AiAhejVj595bDLxO1zoGq7PNGjbdV9U8Q?fields=sheets(properties(title%2CsheetId))&key={your%20API%20key}

Do you think you could implement this feature?

Again, thank you!

benborgers commented 1 year ago

Thank you!

Unfortunately I’m trying to keep opensheet as minimal as possible to keep it maintainable and to handle the scale of requests that it receives — so I don’t think I’ll be able to implement that feature at the moment.

If you’d like to fork the project to add this feature and then host your own instance on Cloudflare Workers, I’d be happy to help walk you through that process! If it’s easier, feel free to shoot me an email — benborgers@hey.com.

twMat commented 1 year ago

@benborgers - thank you for your reply.

Hosting my own instance is way beyond my level of competence (for example I can't code other than in a very nichey high level application language called tiddlywiki). This is also why opensheets is a blessing.

But OK, I'll just hope for "access to sheet names" one day in the future.

Thank you.

benborgers commented 1 year ago

Fair! Out of curiosity, what’s your use-case for using opensheet? And how would you find the ability to get sheet names useful?

twMat commented 1 year ago

Sure! OK, this is a bit intricate but you asked for it ;-)

As noted, I'm a long time user of tiddlywiki. It is an open source information system (often for "notes" but can be anything) but it is extremely customizable because it is really just a single html document, that can be stored and used anywhere. As noted, I'm not a coder but I do "code" in wikitext, and I have built several plugins that I share with the TW community. One of my more ambitious plugin projects (a collab w someone who can code) is this one - the image there explains the idea; the plugin (specifically the "SheetsIN" plugin there) enabled importing Google sheets into tiddlywiki (i.e each row in a sheets table becomes a "note" in tiddlywiki). It stopped working after Google changed the API or whatever, mere months after we released the plugin ~2 years ago. I'm now remaking it and found opensheet that will enable anyone to easily create and share google sheets as JSON that can be imported into TW. And because the API key is otherwise sensitive, you service makes it possible for people to share their Google Sheets with others others. One feature in the plugin is, or at least was, that you could first import a list of the tabs (i.e sheets), which you thereafter select among and import from. One reason why this is important is because people otherwise have to share each individual tab or perhaps create individual spreadsheet files with just one tab per spreadsheet. For anyone importing from someone elses shared file, it also makes sense to see what that person is sharing (different tabs could have different types of content).

Personally, I work as an elementary school science teacher and use TW as my full blown notes system and opensheet will enable me to import data from various shared spreadsheets. The school spreadsheets are owned by various other people who arbitrarily add/remove/rename tabs so it would be desirable to not have to know tab names, or without having to know how many there are, because the only clue to what the tab content is about can be the very tabs names, e.g "grade 4", "grade 5" etc.

OK, sorry if it was long but I hope that clarifies it a bit.

(If you, incidentally, are curious about TW, you're more than welcome to ask me about it or on the forum. It is a very friendly and sharing community.)

benborgers commented 1 year ago

haha I appreciate the detailed response! Always super cool to see what people are doing with opensheet.

Unfortunately I’m trying to see how I can cut down costs of hosting the project at the moment, so most of my energy is headed there instead of expanding the surface area. This does sound like a super cool use case though! Maybe the next best thing would be to ask people to type in the name of the sheet, instead of having them pick from a list? It’s as good of an experience, unfortunately, but perhaps the next best thing.

Thank you again for sharing!

mderazon commented 5 months ago

@benborgers Didn't know when to post this, but very curious to hear what are your hosting costs now with Cloudflare, you mentioned 150M hits / month. Have you written about it somewhere ? Also, at this level, you probably have some costs using Google API as well ?