Skip to main content

A local client for working with Excel files in Microsoft OneDrive

Project description

shipyard-excel

Overview

shipyard-excel is a Python package that provides a client for interacting with Excel files stored in Microsoft OneDrive. This package leverages the Microsoft Graph API to perform various operations on Excel spreadsheets, such as retrieving sheet IDs and fetching sheet data.

Features

  • Authentication using client credentials flow
  • Fetch Sheet Data
  • Convert Sheet Data to DataFrame

The ExcelClient inherits from the OneDriveClient, meaning that all the methods defined there (upload, download, move, remove) are also available in this package.

Installation

To install the package, run the following command:

python3 -m pip install shipyard-excel

Usage

Initialization

To use the ExcelClient, you need to initialize it with your client credentials and user email:

from shipyard_excel import ExcelClient

client_id = 'your_client_id'
client_secret = 'your_client_secret'
tenant_id = 'your_tenant_id'
user_email = 'your_user_email'

excel_client = ExcelClient(client_id, client_secret, tenant_id, user_email)

excel_client.connect()

Get Sheet Data as a DataFrame

# get the sheet ID, drive ID, and file ID
user_id = excel_client.get_user_id()
drive_id = excel_client.get_drive_id(user_id)
file_id = excel_client.get_file_id("<file_name.xlsx>", drive_id)
sheet_id = excel_client.get_sheet_id("<Sheet Name>", file_id, drive_id)

df = excel_client.get_sheet_data_as_df(file_id, sheet_id, drive_id)

print(df.head())

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

shipyard_excel-0.1.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

shipyard_excel-0.1.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file shipyard_excel-0.1.1.tar.gz.

File metadata

  • Download URL: shipyard_excel-0.1.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.18 Darwin/23.5.0

File hashes

Hashes for shipyard_excel-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8cfbded801cd5c31e69113d94d81abe81b35baf8147c769fa8f5fc778297f1de
MD5 0ee215311b16920805ed7af5092321a0
BLAKE2b-256 104efa15415a8018b6c68e1b8b2df313f6617a7f0766d0a61af30037d2f181a1

See more details on using hashes here.

File details

Details for the file shipyard_excel-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: shipyard_excel-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.18 Darwin/23.5.0

File hashes

Hashes for shipyard_excel-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9a81dc079ff617af9b1c62804a2bf6b319a6b28de9460bcddf52dec8ef69206
MD5 b5a5b6cd886347476555aa3bdb644960
BLAKE2b-256 829d9d153a33b5ef73eded346111c524de1db637a5d6a46b5c6b0656bf97c608

See more details on using hashes here.

Supported by

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