Automating & delivering reports
Publishing & sharing files
S3, SharePoint, Google Drive, network shares, Slack and Teams.
Start with the full guides
The long-form treatment of publishing & sharing files, with the reasoning the shorter pages assume.
Step-by-step how-tos
One task each, with code you can copy, run and adapt.
- How-toName, Version and Archive Generated Excel ReportsStop overwriting report_final_v2.xlsx: a sortable naming scheme for generated Excel reports, a content fingerprint that ignores the timestamps Excel files carry so unchanged reruns are skipped, numbered versions with a manifest, a retention rule that archives old periods and keeps final versions, and the same ideas on Amazon S3 with object versioning.
- How-toPost an Excel Report to a Slack Channel with PythonDeliver a workbook to Slack: bot token and scopes, the file upload API, a summary message with the numbers, threading, retries and keeping the token out of the code.
- How-toPost an Excel Report to Microsoft Teams with PythonPost an Adaptive Card carrying the report's headline figures and a link to the workbook — with outcome colouring, failure cards from the exception handler, and Retry-After handling.
- How-toSave Excel Reports to Google Drive with PythonPublish a generated .xlsx to Google Drive from a scheduled job — service-account auth, folder targeting, resumable uploads, updating in place, and shared drive gotchas.
- How-toUpload an Excel Report over SFTP with PythonDeliver Excel reports to a partner's SFTP server with paramiko — key-based login, host key checking that actually protects you, uploading from memory, writing under a temporary name and renaming so the partner never picks up half a file, creating dated folders, verifying the upload and handling the rename and permission errors SFTP servers return.
- How-toUpload an Excel Report to Amazon S3 with boto3Publish a generated .xlsx to S3 from Python: upload straight from memory, set the right content type, make the write atomic, verify it, and share it with a presigned URL.
- How-toUpload an Excel Report to Azure Blob Storage with PythonPublish generated Excel reports to Azure Blob Storage with the azure-storage-blob SDK — sign in without keys in the code, name blobs by period, set the content type and download file name, refuse to overwrite a published report, record a checksum in metadata, verify the upload and share it with a read-only link that expires.
- How-toUpload an Excel Report to Dropbox with PythonPublish a generated workbook to a Dropbox folder from a scheduled job: a scoped app and a long-lived refresh token instead of expiring access tokens, uploads that overwrite last week's file, chunked upload sessions for large files, a shared link that is reused rather than duplicated, and the errors worth handling.
- How-toUpload an Excel Report to Google Cloud StoragePublish generated workbooks to a Cloud Storage bucket from Python: authentication without key files, dated object names, the correct content type and metadata, uploads that refuse to overwrite, checksummed resumable uploads for large files, time-limited download links, retention rules, and local testing against an emulator.
- How-toUpload an Excel Report to SharePoint with PythonPublish a generated .xlsx to SharePoint or OneDrive from Python using Microsoft Graph — app-only tokens, resolving the drive, simple and chunked uploads, and sharing links.
- How-toWrite Excel Files to a Network Share from PythonPublish reports to an SMB or mounted network share safely — atomic write-then-rename, handling a file open in Excel, UNC paths, permissions, and retention of old reports.
- How-toRead an Excel File from SharePoint or OneDrive into pandasDownload a workbook from a SharePoint library or a user's OneDrive with Microsoft Graph and read it straight into pandas from memory — resolving sites and drives, skipping unchanged files, and handling whole folders.
- How-toShare an Excel File in OneDrive with a Link Using GraphShare an Excel workbook stored in OneDrive or SharePoint from Python with Microsoft Graph: create view or edit links scoped to your organisation or to named people, set an expiry date, invite specific recipients with or without an email, list who has access, and remove links that are no longer needed.
- How-toEmail a Download Link Instead of an Excel AttachmentSend large or sensitive Excel reports as an expiring download link instead of an attachment: decide when a link is better, upload the workbook to private S3 storage, create a presigned URL that downloads with the right file name and stops working after a set time, write an email that states the expiry, and check the link before sending.
- How-toSend an Excel Report with Amazon SESEmail a generated workbook through Amazon Simple Email Service from Python: build the MIME message with an HTML summary and the .xlsx attached, send it with boto3's SES v2 client, handle unverified senders, the sandbox and throttling, stay under the size limit, and test the whole flow locally with moto — no AWS account or real email needed.
- How-toGenerate an HTML Report from Excel Data with Jinja2Build a complete, self-contained HTML report from an Excel workbook with pandas and Jinja2 templates: shape the data in Python and keep the layout in a template, autoescape cell text, format numbers with custom filters, loop over sections, draw bar charts with plain HTML and CSS, share a base layout through template inheritance, fail fast on missing values, and test the output.
- How-toRead an Excel File Directly from Amazon S3 with pandasLoad a workbook from S3 into a DataFrame without a temporary file: BytesIO reads, paginated prefix scans, readable error translation, and a Parquet cache for repeat runs.
- How-toRun a Python Excel Report in AWS LambdaBuild an Excel report in an AWS Lambda function and save it to S3 on a schedule — a handler that works in memory, a package that fits Lambda's size limits, memory and timeout settings that suit pandas, an EventBridge Scheduler rule in local time, retries that do not produce duplicate reports, and tests that run without an AWS account.
- How-toRun an Excel Report in Azure FunctionsSchedule a Python Excel report as an Azure Function: a timer trigger with a six-field NCRONTAB schedule, the workbook built in memory and written to Blob Storage through an output binding, a retry policy, time zones and execution time limits, local testing of the handler and its bindings, and deployment with Core Tools.
- How-toRun an Excel Report on Google Cloud Run JobsPackage a Python Excel report as a container and run it on a schedule with Cloud Run jobs and Cloud Scheduler: a slim image, a script that exits with a meaningful status, parallel tasks that split work by CLOUD_RUN_TASK_INDEX, retries and timeouts, a service account instead of keys, and a local test with Docker before anything is deployed.
- How-toConvert an Excel Sheet to a Markdown Table with PythonTurn a worksheet into a Markdown table for a README, a wiki page, a pull request or a chat message. Use DataFrame.to_markdown, then fix what it gets wrong — unescaped pipes, line breaks inside cells, "nan" for blanks and raw float formatting — and convert every sheet of a workbook into one document.
Compare the options
Which tool or approach to pick, and why.
Follow it through a track
Prefer an ordered route? These tracks cover publishing & sharing files along the way, in the order that builds on itself.
Related topics
Subjects that keep turning up on the same pages as this one, most overlap first.
Publishing & sharing files is part of Automating & delivering reports.