Comments (3)
Yes, PyDrive2 API is quite "specific". Sorry, about that it's a legacy that we are replacing gradually with fsspec
compatible implementation here.
I would give it a try, I think this spec should be enough to try along with the link above.
For the native PyDrive2 api, to make it work you need to create instance of the file
object to manipulate with it.
file_id = "id" # you need to know this ID, can be taken in UI, or using other PyDrive2 helpers, something like this:
file_to_copy = drive.CreateFile({"id": file_id})
directory_to_copy_to = drive.CreateFile({"id": directory_id}) # optional
file_to_copy.Copy(target_folder=directory_to_copy_to, new_title="if you need this")
from pydrive2.
May be tests in https://github.com/iterative/PyDrive2/pull/188/files , could also help you get a better idea on how this API works.
from pydrive2.
I see, I can use this cp(["source/file1", "source/file2", "source/subdir/subfile1"], "target/")
for copying multiple files to target folder. Just wondering (might be a little silly), what will be the file path here in reference to the drive?
Should it be like cp(["file1_id", "file2_id"], "target_folder_id")
?
from pydrive2.
Related Issues (20)
- How to distinguish between same-named files and directories in Google Drive
- How to distinguish between same-named files and directories in Google Drive HOT 1
- A simple way of initializing a pydrive.GoogleDrive object fails when pydrive is replaced by pydrive2 HOT 1
- Fail to authenticate with pydrive2 to google drive HOT 4
- Access blocked: This application request is invalid HOT 1
- Is there a Google Drive file sharing feature? HOT 3
- Unable to list files with service account auth for GDriveFilesystem HOT 3
- How do I write to specific tab? HOT 1
- fetch a specific folder id by folder name HOT 4
- Missing 1.17.1 release? HOT 1
- auth: LocalWebserverAuth: fail if in non-interactive mode
- ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2427) HOT 2
- Review and fix issues with find
- Create Succesfull Authentication using Google OAuth client ID for a remote server accessible via SSH in a local machine HOT 1
- AssertionError on using fsspec with service account HOT 1
- [Q]Set Disable Download HOT 1
- Would you be interested to add type hints?
- pyopenssl is a dependency, but it does not seem to be used
- httplib2 is a direct dependency but is not added as one
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 pydrive2.