Skip to main content

fs.onedrivefs

Implementation of pyfilesystem2 file system using OneDrive

image codecov PyPI version

Usage

fs.onedrivefs can create a requests_oauthlib.OAuth2Session for you. This way the OAuth2Session is going to refresh the tokens for you.

onedriveFS = OneDriveFS(
  clientId=<your client id>,
  clientSecret=<your client secret>,
  token=<token JSON saved by oauth2lib>,
  SaveToken=<function which saves a new token string after refresh>)

# onedriveFS is now a standard pyfilesystem2 file system

You can handle the tokens outside of the library by passing a niquests.Session. Here is an example of a custom session using MSAL Python

class MSALSession(OAuth2Session):
  def __init__(self, client: msal.ClientApplication):
    super().__init__()
    self.client = client

  def request(self, *args, **kwargs):
    account = self.client.get_accounts()[0]
    self.token = self.client.acquire_token_silent_with_error(
      scopes=["Files.ReadWrite"], account=account
    )

    return super().request(*args, **kwargs)

client = msal.ConfidentialClientApplication(
  client_id=<your client id>,
  client_credential=<your client secret>,
  authority=f"https://login.microsoftonline.com/<your tenant>",
  token_cache=<your token cache>,
)

# Authentication flow to populate the token cache
# YOUR AUTHENTICATION FLOW

session = MSALSession(client=client)
onedriveFS = OneDriveFS(session=session)

# onedriveFS is now a standard pyfilesystem2 file system

Register your app here to get a client ID and secret

Metadata

Release files for fs.onedrivefs 1.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fs.onedrivefs 1.2.7
File Size Uploaded
fs_onedrivefs-1.2.7.tar.gz 594.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fs.onedrivefs 1.2.7
File Interpreter ABI Platform
fs_onedrivefs-1.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 606.0 kB

Release files / fs_onedrivefs-1.2.7.tar.gz

Download URL fs_onedrivefs-1.2.7.tar.gz
Size 594.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2e7536b08c6cf698847cd78bd2fc3e4cba8237eec0da583481c3072c3c390a21
BLAKE2b-256 checksum
How to use checksums
20ffe25b9b84803eadc7a61f4c293ae229cae8b61c5722010734b2fa4c013c92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / fs_onedrivefs-1.2.7-py3-none-any.whl

Download URL fs_onedrivefs-1.2.7-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4cee86e5206ee3c7c899d571dd94f1d5a84330d11dbf21ed50c06ebc6cd9a423
BLAKE2b-256 checksum
How to use checksums
30cd0787b1fe1736e00e8f223f11c8c6743ca1fd3160ee846a060428b98c8996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.0

2 release files

This release

1.2.7 This release

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

1 release file

0.1.3

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page