Code Monkey home page Code Monkey logo

Comments (9)

shcheklein avatar shcheklein commented on May 25, 2024

@Cing2

How is it going with this project?

it is actively maintained, at least as long as `iterative/dvc is alive and maintained.

However I could not find how to get certain fields of a file, like id, name, parents. etc

I assume you already found the file listing API - https://pythonhosted.org/PyDrive/filelist.html#file-listing-made-easy right? Then it already has a small example how to get title and id (and the same way you can access other file attributes). Am I missing something in your question?

from pydrive2.

Cing2 avatar Cing2 commented on May 25, 2024

Yes, I can see how get the attributes after the download. But how do you select to only download the attributes you need. Which will reduce data and time needed.
https://developers.google.com/drive/api/v3/reference/files/list
in the docs you can have an parameter 'fields', to select the attributes you need.

from pydrive2.

shcheklein avatar shcheklein commented on May 25, 2024

Have you tried to pass param={"fields": ...} to the list call? .. I think it should support it as well.

from pydrive2.

Cing2 avatar Cing2 commented on May 25, 2024

Yes I did but got an ApiRequestError.
This is what I tried:

file_list = drive.ListFile({'fields': 'id, name',
                            'q': "'root' in parents and trashed=false"}).GetList()

from pydrive2.

shcheklein avatar shcheklein commented on May 25, 2024

Try this: 'fields': 'items(id,title)' - check the API docs for the exact syntax on how to specify the list of fields you'd like to get.

from pydrive2.

Cing2 avatar Cing2 commented on May 25, 2024

Thank you, I see now that you are still using the v2 version. Although this is not clear on the home page.

from pydrive2.

shcheklein avatar shcheklein commented on May 25, 2024

Yes, but I think the syntax for fields is the same across v2 and v3 - check these examples https://developers.google.com/drive/api/v3/fields-parameter

from pydrive2.

Cing2 avatar Cing2 commented on May 25, 2024

Ah oke, I was looking at this one: https://developers.google.com/drive/api/v3/search-files

from pydrive2.

shcheklein avatar shcheklein commented on May 25, 2024

@Cing2 sure. I keep it open with the documentation label. Hopefully we'll get a contribution to improve it and put some examples.

from pydrive2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.