Skip to main content

Openfiles Python SDK

A Python SDK for interacting with the Openfiles API.

Installation

pip install openfiles

Usage

from openfiles import OpenfilesClient

# Method 1: Initialize the client with your API token
client = OpenfilesClient(api_token="your_api_token")

# Method 2: Initialize using OPENFILES_API_TOKEN environment variable
# export OPENFILES_API_TOKEN="your_api_token"
client = OpenfilesClient()

# Upload a file
response = client.upload_file(
    file_path="test/file.txt", description="My file description"
)
file_bag_id = response.bag_id
print(f"File uploaded with bag_id: {file_bag_id}")

# Get user information
user_info = client.get_user_info()
print(f"Space left: {user_info.space_left} / {user_info.capacity}")

# List user files
files = client.get_user_files_list()
for file in files:
    print(f"File: {file.filename}, Size: {file.size}, Bag ID: {file.bag_id}")

# Download a file
client.download_file(bag_id=file_bag_id, destination="test/file_copy.txt")

# Delete a file
client.delete_file(bag_id=file_bag_id)

Features

  • Upload files
  • Download files
  • Delete files
  • Get user information
  • List user files

License

MIT License

Metadata

Release files for openfiles 1.1.1

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

Source distribution (sdist)

Source distribution for openfiles 1.1.1
File Size Uploaded
openfiles-1.1.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openfiles 1.1.1
File Interpreter ABI Platform
openfiles-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / openfiles-1.1.1.tar.gz

Download URL openfiles-1.1.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b3971b35a4ecb9c162db5f192cfdc57c475c396c6f05e0048a354ce1f6c466f5
BLAKE2b-256 checksum
How to use checksums
089ad1bc49252e8f12d1f5d38479c7445865d963e881b25f9a6a4040e7b29911
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / openfiles-1.1.1-py3-none-any.whl

Download URL openfiles-1.1.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b03ce5c04a5c6435193346edab16a5ee9347d85fec46d7314c2fdfd471f3f455
BLAKE2b-256 checksum
How to use checksums
3ba9aff83d2e251b64ca516bac8142bf663e9fa30eead2b0dfad518a81d84eb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

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