fs.onedrivefs
Implementation of pyfilesystem2 file system using OneDrive
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 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fs_onedrivefs-2.0.0.tar.gz | 594.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fs_onedrivefs-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 606.2 kB
Release files / fs_onedrivefs-2.0.0.tar.gz
| Download URL | fs_onedrivefs-2.0.0.tar.gz |
|---|---|
| Size | 594.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b2bc5b4bc34233cca347429ceedffd4d51241da2950b048b176c87a97ceae1a
|
|
BLAKE2b-256 checksum How to use checksums |
add7c830d3654e35fda4413eca0fb181f102b123ccb87e9374d5aa56abfbc08a
|
| 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 17, 2026.
Transparency logRelease files / fs_onedrivefs-2.0.0-py3-none-any.whl
| Download URL | fs_onedrivefs-2.0.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86d2a76315430a998548e791f62a7c86a3037c5f7289d26ea7407b307dd5969b
|
|
BLAKE2b-256 checksum How to use checksums |
bb7f06b092a77d5924548d36810daf6c835878d2cf75ccc13c7db6fbe9068de1
|
| 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 17, 2026.
Transparency log