The Oracle Cloud Infrastructure SDK for Python enables you to write code to manage Oracle Cloud Infrastructure resources.
This SDK and sample is dual-licensed under the Universal Permissive License 1.0 and the Apache License 2.0; third-party content is separately licensed as described in the code.
Cloud Shell: The SDK for Python is pre-configured with your credentials and ready to use immediately from within Cloud Shell. For more information on using the SDK for Python from within Cloud Shell, see SDK for Python Cloud Shell Quick Start.
Oracle Linux Cloud Developer image: The SDK for Python is pre-installed on the Oracle Linux Cloud Developer platform image. For more information, see Oracle Linux Cloud Developer.
Services Supported
Access Governance
Account Management
AI Anomaly Detection
AI Language
AI Speech
AI Vision
Analytics Cloud
Announcements
API Gateway
Application Dependency Management
Application Management
Application Performance Monitoring
Audit
Autonomous Recovery
Autoscaling (Compute)
Bastion
Big Data Service
Blockchain Platform
Budgets
Build
OCI Cache
Certificates
Cloud Bridge
Cloud Migrations
Compute Cloud@Customer
Compute Instance Agent (Oracle Cloud Agent)
Kubernetes Engine
Container Instances
Content Management
Core Services (Networking, Compute, Block Volume)
Cloud Guard
Cloud Migrations
Cluster Placement Groups
Connector Hub
Console Dashboard
Data Catalog
Data Flow
Data Integration
Data Labeling
Data Safe
Data Science
Data Transfer
Database
Database Management
Database Migration
Database Tools
Delegate Access Control
Demand Signal
DevOps
Digital Assistant
Digital Media
Disaster Recovery
DNS
Document Understanding
Email Delivery
Enterprise Manager Warehouse
Events
Exadata Fleet Update
File Storage
Fleet Application Management
Functions
Fusion Apps as a Service
Generative AI
Generative AI Agent
Generative AI Inference
Generic Artifacts
Globally Distributed Database
GoldenGate
Governance Rules
Health Checks
IAM
Identity Domains
Integration Cloud
Java Management
Java Management Service Downloads
Key Management (for the Vault service)
License Manager
Limits
Load Balancer
Logging
Logging Analytics
Logging Search
Logging Ingestion
Managed Access
Management Agent Cloud
Management Dashboard
Marketplace
Marketplace Private Offer
Monitoring
HeatWave
Network Firewall
Network Load Balancing
Network Monitoring
Networking Topology
NoSQL Database Cloud
Notifications
Object Storage
OCI Control Center
OCI Registry
OCI Secure Desktops
OneSubscription
Operations Insights
Operator Access Control
Optimizer
Organizations
OS Management
OS Management Hub
PostgreSQL
Process Automation
Publisher
Queue Service
Quotas
Resource Manager
Resource Scheduler
Roving Edge Infrastructure
Search
Secret Management (for the Vault service)
Secure Desktops
Security Attribute
Service Catalog
Service Mesh
Source Code Management
Stack Monitoring
Streaming
Support Management
Threat Intelligence
Usage
Visual Builder
VMWare Solution
Vulnerability Scanning
Web Application Acceleration and Security
Work Requests (Compute, Database)
Zero Trust Packet Routing
Python Support 🔗
Supported Python Versions and Operating Systems 🔗
This table lists the versions of Python supported by the OCI SDK for Python for each
operating system:
Operating System
Supported Python Versions for CLI
CentOS 7
3.6 to 3.9
CentOS 8
3.6 to 3.9
Oracle Autonomous Linux 7.9
3.6 to 3.9
Oracle Linux 7.8
3.6 to 3.9
Oracle Linux 7.9
3.6 to 3.9
Oracle Linux 8
3.6 to 3.11
Oracle Linux 9
3.7 to 3.11
Ubuntu 18.0.4
3.6 to 3.11
Ubuntu 20.0.4
3.6 to 3.11
Windows Desktop 10 & 11
3.6 to 3.11
Windows Server (2012/2016/2019)
3.6 to 3.11
Newer versions of Python may not be immediately supported. The OCI SDK for Python
might work on unlisted operating systems, but we do not test them for
compatibility.
If you're using Oracle Linux 7 or 8, you can use yum to install the OCI SDK for Python.
The following example shows how to use yum to install the OCI SDK for Python 3.6:
Copy
sudo yum install python36-oci-sdk
This example shows how to use yum to install the OCI SDK for Python 2.7:
Copy
sudo yum install python-oci-sdk
Client-Side Encryption 🔗
Client Side Encryption allows you to encrypt data on the client side before storing it
locally or using it with other Oracle Cloud Infrastructure services.
To use client-side encryption, you must create a master encryption key (MEK) using the
Key Management Service. This can be done using the CreateKey or ImportKey
operations.
The MEK is used to generate a Data Encryption Key (DEK) to encrypt each payload. A encrypted copy of this DEK (encrypted under the MEK) and other pieces of metadata are included in the encrypted payload returned by the SDKs so that they can be used for decryption.
Examples
The following code example shows how to encrypt a string: