Install & Compatibility
Where this runs
tested against v1.6.388 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 25MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.8s · import 0.000s · 25MB
23MB installed
● package 23MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
files_sdk
✓ import files_sdk
✗ import files_com
AccountLineItem
✓ from files_sdk import AccountLineItem
✗ from files_com import AccountLineItem
Action
✓ from files_sdk import Action
✗ from files_com import Action
This quickstart demonstrates how to configure the Files.com Python client using environment variables for API key and base URL, then perform basic operations like listing users and creating/deleting a folder. It includes basic error handling for common API exceptions.
import files_com
import os
# Configure API Key and Base URL (highly recommended to use environment variables)
files_com.api_key = os.environ.get('FILESCOM_API_KEY', '') # Replace '' with your actual API key for local testing
files_com.base_url = os.environ.get('FILESCOM_BASE_URL', 'https://app.files.com') # Replace with your custom domain if applicable
if not files_com.api_key:
print("Error: FILESCOM_API_KEY environment variable not set or API key not provided.")
exit(1)
try:
# Example: List users
print("Listing users...")
users = files_com.User.list(per_page=10) # Fetch up to 10 users
if users:
for user in users:
print(f" User ID: {user.id}, Username: {user.username}, Email: {user.email}")
else:
print(" No users found.")
# Example: Create a new folder (adjust name as needed)
print("\nCreating a new folder...")
try:
new_folder = files_com.Folder.create(path='/my_test_folder', name='MyNewFolder123')
print(f" Folder '{new_folder.path}' created successfully (ID: {new_folder.id}).")
# Example: Delete the created folder
print(f"\nDeleting folder '{new_folder.path}'...")
files_com.Folder.delete(path=new_folder.path)
print(f" Folder '{new_folder.path}' deleted successfully.")
except files_com.exceptions.ApiError as e:
print(f" Failed to create/delete folder: {e.message}")
except files_com.exceptions.UnauthorizedException as e:
print(f"Authentication failed: {e.message}. Check your API key and base URL.")
except files_com.exceptions.NotFoundException as e:
print(f"Resource not found: {e.message}. Check paths and IDs.")
except files_com.exceptions.ApiError as e:
print(f"An API error occurred: {e.message}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Debug
Known issues
gotchaThe `files_com.api_key` and `files_com.base_url` are configured globally at the module level. This global state can lead to issues in multi-threaded applications, complex testing scenarios, or when managing multiple Files.com accounts/environments within a single process.fixFor isolated configurations, ensure that `files_com.api_key` and `files_com.base_url` are set immediately before each specific API call context where different credentials or endpoints are needed, or manage separate processes. The SDK does not currently provide an instance-based API client for full context isolation.
affects: All versions
gotchaMany API list methods (e.g., `User.list()`, `File.list_for()`) return paginated results by default. Not explicitly handling pagination will result in only the first page of data being returned, leading to incomplete datasets.fixTo retrieve all records, you must manually iterate through pages using the `cursor` and `per_page` parameters. The `cursor` for the next page is typically the `id` of the last item received in the current page. See the 'Problems' section for a code example.
affects: All versions using the Files.com API's pagination model
Upgrade
Version history
1.6.388latest on PyPI · released Jun 12, 2026
Audit
Dependencies
No dependency data recorded yet.