Comments (9)
My case is similar to @simonm3 - I have a credentials for a service account that has permission on a GCP folder. The folder would have to be referenced by a file id but it isn't clear to me how this would be done using either fs.opendir()
or a path.
from fs.googledrivefs.
Going by the code in your other issue, I think that the format of your URI is wrong - the "?access_token=..." part has to be at the end, after the subdirectory part.
from fs.googledrivefs.
Is GCP is a different service? This project supports "Google Drive". There's another pyfilesystem plugin called fs-gcsfs which supports "Google Cloud Storage"
from fs.googledrivefs.
@rkhwaja you may be right about the format. however this still only opens the root folder. code below lists the root folder contents.
gd = fs.open_fs(f"googledrive://eedata/{creds.gdrive()}")
gd.listdir("/")
from fs.googledrivefs.
It works if I add an extra slash fs.open_fs(f"googledrive:///eedata/{creds.gdrive()}")
However the pyfilesystem url does not have a slash at the start of a folder in the examples https://docs.pyfilesystem.org/en/latest/openers.html
from fs.googledrivefs.
Also the format shown in documentation is creds@resource.
Ideally the creds should be in similar format regardless of file system used. So for google drive API they should appear before the resource and googledrivefs should convert that into whatever format google uses.
from fs.googledrivefs.
My mistake - I should have written Google Drive folder (it's the service account that is part of the Google Clouds Platform). My use case is supported by the native Drive API - it's a method for a user to grant an application permission to work on a sub-set of the user's files.
from fs.googledrivefs.
My case is similar to @simonm3 - I have a credentials for a service account that has permission on a GCP folder. The folder would have to be referenced by a file id but it isn't clear to me how this would be done using either
fs.opendir()
or a path.
My case is similar to @simonm3 - I have a credentials for a service account that has permission on a GCP folder. The folder would have to be referenced by a file id but it isn't clear to me how this would be done using either
fs.opendir()
or a path.
Since this project is a plugin for pyfilesystem2, it only uses "paths", although I suppose that the definition of that is somewhat up to the individual plugins - I'm not sure how far you can push that. We can add custom methods that do something specific with the filesystem (e.g. add_parent, remove_parent) but that aren't relevant to filesystems in general.
from fs.googledrivefs.
Thanks for your response @rkhwaja. I have made a fork and implemented support for a sub-tree specified by an ID. I have also used it in an example project with an explanatory readme. I've had second thoughts about the approach in the fork and think maybe the root directory could better be specified by a parameter (say root_dir_id
) passed to the GoogleDriveFSOpener
. If you like this idea, I'm happy to re-work and create a CR.
from fs.googledrivefs.
Related Issues (20)
- fails copying a file
- Add md5 checksum to metadata HOT 1
- Caching implementation for files HOT 4
- Account for removal of multiple parent feature HOT 2
- makedirs fails on root HOT 1
- Add webhook support HOT 1
- Add "link" namespace to getinfo HOT 1
- Support writing the created time using setinfo HOT 1
- Add a proper changelog HOT 2
- Allow using the native search
- Add proper documentation HOT 1
- Implement copydir/makedirs using batch requests for more speed
- "New Folder" Subfolder on copy_fs HOT 5
- googledrivefs.makedirs() fails intermittently HOT 4
- Google Drive sharing/security changes needed before before Sep 13, 2021? HOT 1
- Shared Drive support HOT 5
- Issue downloading Google-native files HOT 2
- Remove httplib2 dependency
- Support 3.11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fs.googledrivefs.