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 and interacting Microsoft OneDrive API.

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.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: onedriveintegrate-1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 632eedf55a64dfaf7e1f7e80ee456c0ba724520ea6c7ba67416ad6b695ac94cb
MD5 d2419b3fc3c4a60f129442c934c51277
BLAKE2b-256 85dfb38071105312272993d040eaddaa824f11ff1b8c2df1a6c7801985b05067

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