Skip to main content

Package for OneDrive File Management

Project description

OneDrive Integration Package


onedriveintegrate is a Python package for OneDrive functionality, featuring methods for OneDrive file management.

List of relevant operations:

  • Authenticate users using Microsoft Graph API
  • Write files to a folder
  • Read files from the drive
  • List contents of a folder
  • Search for files based on text/id

Installation


Use a simple pip command to install onedriveintegrate:

pip install onedriveintegrate

Usage / Getting started


from onedriveintegrate.onedrive_api import OneDriveAPI
from onedriveintegrate.ms_graph import generate_access_token, GRAPH_API_ENDPOINT

# User's Client ID
client_ID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'

# Setup 
onedrive_query = OneDriveAPI(client_ID)
folder_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
file_path = 'root/base/relative/file'
file_id = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
output_file = 'XXXXX.json'
search_txt = 'XXXXX'

# 1) Upload file to specified folder
onedrive_query.write_file(folder_id, file_path)

# 2) Download file from specified id
onedrive_query.read_file(file_id)

# 3) List contents of folder, results stored in output_file
onedrive_query.list_folder(folder_id, output_file)

# 4) Search item based on search text/id, results storted in output_file
onedrive_query.search_text(search_txt, output_file)
onedrive_query.search_id(file_id OR folder_id, output_file)

Helpful Resources


Sources from Jie Jenn:

Microsoft Graph API:

PyPi:

Markdown:

Acknowledgements


This package makes use of Jie Jenn's ms_graph.py for the user authentication process.

License


MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onedriveintegrate-1.4.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file onedriveintegrate-1.4.tar.gz.

File metadata

  • Download URL: onedriveintegrate-1.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for onedriveintegrate-1.4.tar.gz
Algorithm Hash digest
SHA256 a4da541511b8b292e3db789259d1ab270126df2b7c25e7b9d6223b91ee9b83f8
MD5 40eaea4c20e9e2c33af6647136f12375
BLAKE2b-256 abfe26d575e7e760a736932f5e91112ba6f553e703b5cf979d86112d19bde62c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page