Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: add missing python examples on guides (#28750)

Guilherme Souza9cf5f9168c7d
diff --git a/apps/docs/content/guides/auth/auth-anonymous.mdx b/apps/docs/content/guides/auth/auth-anonymous.mdx
index d30dc84378b..52fec2932f4 100644
--- a/apps/docs/content/guides/auth/auth-anonymous.mdx
+++ b/apps/docs/content/guides/auth/auth-anonymous.mdx
@@ -80,6 +80,15 @@ Call the [`signInAnonymously()`](/docs/reference/kotlin/auth-signinanonymously)
supabase.auth.signInAnonymously()
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+Call the [`sign_in_anonymously()`](/docs/reference/python/auth-signinanonymously) method:
+
+```python
+response = supabase.auth.sign_in_anonymously()
+```
+
</TabPanel>
</Tabs>
@@ -141,6 +150,25 @@ supabase.auth.modifyUser {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+You can use the [`update_user()`](/docs/reference/python/auth-updateuser) method to link an email or phone identity to the anonymous user. To add a password for the anonymous user, the user's email or phone number needs to be verified first.
+
+```python
+response = supabase.auth.update_user({
+ 'email': '[email protected]',
+})
+
+# verify the user's email by clicking on the email change link
+# or entering the 6-digit OTP sent to the email address
+
+# once the user has been verified, update the password
+response = supabase.auth.update_user({
+ 'password': 'password',
+})
+```
+
</TabPanel>
</Tabs>
@@ -188,6 +216,15 @@ You can use the [`linkIdentity()`](/docs/reference/kotlin/auth-linkidentity) met
supabase.auth.linkIdentity(Google)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+You can use the [`link_identity()`](/docs/reference/python/auth-linkidentity) method to link an oauth identity to the anonymous user.
+
+```python
+response = supabase.auth.link_identity({'provider': 'google'})
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/auth/auth-email-passwordless.mdx b/apps/docs/content/guides/auth/auth-email-passwordless.mdx
index fb7872c6026..9c91c7c481a 100644
--- a/apps/docs/content/guides/auth/auth-email-passwordless.mdx
+++ b/apps/docs/content/guides/auth/auth-email-passwordless.mdx
@@ -108,6 +108,20 @@ suspend fun signInWithEmail() {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.auth.sign_in_with_otp({
+ 'email': '[email protected]',
+ 'options': {
+ # set this to false if you do not want the user to be automatically signed up
+ 'should_create_user': False,
+ 'email_redirect_to': 'https://example.com/welcome',
+ },
+})
+```
+
</TabPanel>
</Tabs>
@@ -206,6 +220,19 @@ suspend fun signInWithEmailOtp() {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.auth.sign_in_with_otp({
+ 'email': '[email protected]',
+ 'options': {
+ # set this to false if you do not want the user to be automatically signed up
+ 'should_create_user': False,
+ },
+})
+```
+
</TabPanel>
</Tabs>
@@ -265,6 +292,17 @@ try await supabase.auth.verifyOTP(
supabase.auth.verifyEmailOtp(type = OtpType.Email.EMAIL, email = "email", token = "151345")
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.auth.verify_otp({
+ 'email': email,
+ 'token': '123456',
+ 'type': 'email',
+})
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/auth/auth-identity-linking.mdx b/apps/docs/content/guides/auth/auth-identity-linking.mdx
index 0904a8cd8c3..ef12b12a45b 100644
--- a/apps/docs/content/guides/auth/auth-identity-linking.mdx
+++ b/apps/docs/content/guides/auth/auth-identity-linking.mdx
@@ -64,6 +64,15 @@ Supabase Auth allows a user to initiate identity linking with a different email
supabase.auth.linkIdentity(Google)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+Supabase Auth allows a user to initiate identity linking with a different email address when they are logged in. To link an OAuth identity to the user, call [`link_identity()`](/docs/reference/python/auth-linkidentity):
+
+```python
+response = supabase.auth.link_identity({'provider': 'google'})
+```
+
</TabPanel>
</Tabs>
@@ -144,5 +153,22 @@ val googleIdentity = identities.first { it.provider == "google" }
supabase.auth.unlinkIdentity(googleIdentity.identityId!!)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+You can use [`get_user_identities()`](/docs/reference/python/auth-getuseridentities) to fetch all the identities linked to a user. Then, call [`unlink_identity()`](/docs/reference/python/auth-unlinkidentity) to unlink the identity. The user needs to be logged in and have at least 2 linked identities in order to unlink an existing identity.
+
+```python
+# retrieve all identities linked to a user
+response = supabase.auth.get_user_identities()
+
+# find the google identity linked to the user
+google_identity = next((identity for identity in response.identities if identity.provider == 'google'), None)
+
+# unlink the google identity from the user
+if google_identity:
+ response = supabase.auth.unlink_identity(google_identity.identity_id)
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/auth/passwords.mdx b/apps/docs/content/guides/auth/passwords.mdx
index 56b1a86a367..c671ac333dc 100644
--- a/apps/docs/content/guides/auth/passwords.mdx
+++ b/apps/docs/content/guides/auth/passwords.mdx
@@ -112,6 +112,25 @@ suspend fun signUpNewUser() {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+To sign up the user, call [signUp()](/docs/reference/python/auth-signup) with their email address and password.
+
+You can optionally specify a URL to redirect to after the user clicks the confirmation link. This URL must be configured as a [Redirect URL](/docs/guides/auth/redirect-urls), which you can do in the [dashboard](/dashboard/project/_/auth/url-configuration) for hosted projects, or in the [configuration file](/docs/guides/cli/config#auth.additional_redirect_urls) for self-hosted projects.
+
+If you don't specify a redirect URL, the user is automatically redirected to your site URL. This defaults to `localhost:3000`, but you can also configure this.
+
+```python
+data = await supabase.auth.sign_up({
+ 'email': '[email protected]',
+ 'password': 'example-password',
+ 'options': {
+ 'email_redirect_to': 'https://example.com/welcome',
+ },
+})
+```
+
</TabPanel>
</Tabs>
@@ -411,6 +430,18 @@ suspend fun signUpNewUser() {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+To sign up the user, call [signUp()](/docs/reference/python/auth-signup) with their email address and password:
+
+```python
+data = supabase.auth.sign_up({
+ 'email': '[email protected]',
+ 'password': 'example-password',
+})
+```
+
</TabPanel>
</Tabs>
@@ -479,6 +510,18 @@ suspend fun signInWithEmail() {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+When your user signs in, call [sign_in_with_password()](/docs/reference/python/auth-signinwithpassword) with their email address and password:
+
+```python
+data = client.auth.sign_in_with_password({
+ 'email': '[email protected]',
+ 'password': 'example-password',
+})
+```
+
</TabPanel>
</Tabs>
@@ -535,6 +578,16 @@ supabase.gotrue.sendRecoveryEmail(
If you are on one of the Kotlin targets that have built-in support for redirect URL handling, such as Android, see [OAuth and OTP link verification](https://supabase.com/docs/reference/kotlin/initializing).
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+client.auth.reset_password_email(
+ {'redirect_to':'http://example.com/account/update-password'}
+)
+```
+
</TabPanel>
</Tabs>
@@ -812,6 +865,13 @@ supabase.gotrue.sendRecoveryEmail(
)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+supabase.auth.reset_password_email('[email protected]')
+```
+
</TabPanel>
</Tabs>
@@ -850,6 +910,13 @@ supabase.auth.updateUser {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+supabase.auth.update_user({'password': 'new_password'})
+```
+
</TabPanel>
</Tabs>
@@ -936,6 +1003,16 @@ supabase.auth.signUpWith(Phone) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+supabase.auth.sign_up({
+ 'phone': "+13334445555",
+ 'password': "some-password"
+})
+```
+
</TabPanel>
<TabPanel id="http" label="HTTP">
@@ -1002,6 +1079,19 @@ supabase.auth.verifyPhoneOtp(
)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verify_otp`:
+
+```python
+supabase.auth.verify_otp({
+ 'phone': "+13334445555",
+ 'token': "123456",
+ 'type': "sms"
+})
+```
+
</TabPanel>
<TabPanel id="http" label="HTTP">
@@ -1059,6 +1149,16 @@ supabase.auth.signInWith(Phone) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+supabase.auth.sign_in_with_password({
+ 'phone': "+13334445555"
+ 'password': "some-password"
+})
+```
+
</TabPanel>
<TabPanel id="http" label="HTTP">
diff --git a/apps/docs/content/guides/auth/phone-login.mdx b/apps/docs/content/guides/auth/phone-login.mdx
index 9705d50b1b8..91abe67e89a 100644
--- a/apps/docs/content/guides/auth/phone-login.mdx
+++ b/apps/docs/content/guides/auth/phone-login.mdx
@@ -64,6 +64,15 @@ supabase.auth.signInWith(OTP) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.auth.sign_in_with_otp({
+ 'phone': '+13334445555',
+})
+```
+
</TabPanel>
<TabPanel id="http" label="HTTP">
@@ -133,6 +142,19 @@ supabase.auth.verifyPhoneOtp(
)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verify_otp`:
+
+```python
+response = supabase.auth.verify_otp({
+ 'phone': '13334445555',
+ 'token': '123456',
+ 'type': 'sms',
+})
+```
+
</TabPanel>
<TabPanel id="http" label="HTTP">
@@ -193,6 +215,15 @@ try await supabase.auth.updateUser(
)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.auth.update_user({
+ 'phone': '123456789',
+})
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/auth/signout.mdx b/apps/docs/content/guides/auth/signout.mdx
index e277575dd38..6c7f4e51bf2 100644
--- a/apps/docs/content/guides/auth/signout.mdx
+++ b/apps/docs/content/guides/auth/signout.mdx
@@ -47,6 +47,13 @@ suspend fun logout() {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+supabase.auth.sign_out()
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/database/arrays.mdx b/apps/docs/content/guides/database/arrays.mdx
index 84a410d0770..a3b87c9248d 100644
--- a/apps/docs/content/guides/database/arrays.mdx
+++ b/apps/docs/content/guides/database/arrays.mdx
@@ -96,6 +96,23 @@ try await supabase
.execute()
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+Insert a record from the Python client:
+
+```python
+supabase.from_('arraytest').insert(
+ [
+ {
+ id: 2,
+ textarray: ["one", "two", "three", "four"]
+ }
+ ]
+)
+.execute()
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/database/full-text-search.mdx b/apps/docs/content/guides/database/full-text-search.mdx
index 381b75370b3..0975aa2fe04 100644
--- a/apps/docs/content/guides/database/full-text-search.mdx
+++ b/apps/docs/content/guides/database/full-text-search.mdx
@@ -159,6 +159,13 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.from_('books').select().eq('title', 'Harry').execute()
+```
+
</TabPanel>
</Tabs>
@@ -284,6 +291,14 @@ val data = supabase.from("books").select {
```
</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.from_('books').select().text_search('description', "'big'").execute()
+```
+
+</TabPanel>
+
<TabPanel id="data" label="Data">
{/* <!-- vale off --> */}
@@ -389,6 +404,19 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```sql
+create function title_description(books) returns text as $$
+ select $1.title || ' ' || $1.description;
+$$ language sql immutable;
+```
+
+```python
+data = supabase.from_('books').select().text_search('title_description', "little").execute()
+```
+
</TabPanel>
<TabPanel id="data" label="Data">
@@ -469,6 +497,13 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.from_('books').select().text_search('description', "'little' & 'big'").execute()
+```
+
</TabPanel>
<TabPanel id="data" label="Data">
@@ -548,6 +583,13 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = client.from_('books').select().text_search('description', "'little' | 'big'").execute()
+```
+
</TabPanel>
<TabPanel id="data" label="Data">
@@ -635,6 +677,13 @@ val rpcParams = mapOf("prefix" to "Lit")
val result = supabase.postgrest.rpc("search_books_by_title_prefix", rpcParams)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = client.rpc('search_books_by_title_prefix', { 'prefix': 'Lit' }).execute()
+```
+
</TabPanel>
</Tabs>
@@ -761,6 +810,13 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = client.from_('books').select().text_search('fts', "'little' & 'big'").execute()
+```
+
</TabPanel>
<TabPanel id="data" label="Data">
@@ -845,6 +901,13 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = client.from_('books').select().text_search('description', "'big' <-> 'dreams'").execute()
+```
+
</TabPanel>
</Tabs>
@@ -910,6 +973,13 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = client.from_('books').select().text_search('description', "'year' <2> 'school'").execute()
+```
+
</TabPanel>
</Tabs>
@@ -978,6 +1048,13 @@ val data = supabase.from("books").select {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = client.from_('books').select().text_search('description', "'big' & !'little'").execute()
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/database/functions.mdx b/apps/docs/content/guides/database/functions.mdx
index 9e1404342e0..8bf1bddc162 100644
--- a/apps/docs/content/guides/database/functions.mdx
+++ b/apps/docs/content/guides/database/functions.mdx
@@ -112,6 +112,15 @@ val data = supabase.postgrest.rpc("hello_world")
Reference: [rpc()](../../reference/kotlin/rpc)
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.rpc('hello_world').execute()
+```
+
+Reference: [rpc()](../../reference/python/rpc)
+
</TabPanel>
</Tabs>
@@ -243,6 +252,13 @@ val data = supabase.postgrest.rpc("get_planets") {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.rpc('get_planets').eq('id', 1).execute()
+```
+
</TabPanel>
</Tabs>
@@ -336,6 +352,13 @@ val data = supabase.postgrest.rpc(
)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.rpc('add_planet', params={'name': 'Jakku'}).execute()
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/database/joins-and-nesting.mdx b/apps/docs/content/guides/database/joins-and-nesting.mdx
index df1c2af1c1b..9bbcf2da02d 100644
--- a/apps/docs/content/guides/database/joins-and-nesting.mdx
+++ b/apps/docs/content/guides/database/joins-and-nesting.mdx
@@ -164,6 +164,13 @@ let countries: [Country] = try await supabase
val data = supabase.from("countries").select(Columns.raw("id, name, cities(id, name)"))
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.from_('countries').select('id, name, cities(id, name)').execute()
+```
+
</TabPanel>
<TabPanel id="graphql" label="GraphQL">
@@ -283,6 +290,20 @@ let teams [Team] = try await supabase
val data = supabase.from("teams").select(Columns.raw("id, team_name, users(id, name)"));
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.from_('teams').select('id, team_name, users(id, name)').execute()
+```
+
+</TabPanel>
+<TabPanel id="graphql" label="GraphQL">
+
+````javascript
+const Query = `
+ query {
+
</TabPanel>
<TabPanel id="graphql" label="GraphQL">
@@ -293,9 +314,9 @@ const Query = `
edges {
node {
id
- team_name
+ team_name
users {
- id,
+ id,
name
}
}
@@ -303,7 +324,7 @@ const Query = `
}
}
`
-```
+````
</TabPanel>
<TabPanel id="url" label="URL">
@@ -464,6 +485,25 @@ scans:scan_id_end (
'''));
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.from_('shifts').select("""
+ *,
+ scans:scan_id_start (
+ id,
+ user_id,
+ badge_scan_time
+ ),
+ scans:scan_id_end (
+ id,
+ user_id,
+ badge_scan_time
+ )
+""").execute()
+```
+
</TabPanel>
<TabPanel id="graphql" label="GraphQL">
diff --git a/apps/docs/content/guides/database/json.mdx b/apps/docs/content/guides/database/json.mdx
index 8a301fd24c1..a1195bfe912 100644
--- a/apps/docs/content/guides/database/json.mdx
+++ b/apps/docs/content/guides/database/json.mdx
@@ -325,6 +325,60 @@ val data = supabase.from("books").insert(listOf(
))
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+supabase.from_('books').insert([
+ {
+ 'title': 'The Poky Little Puppy',
+ 'author': 'Janette Sebring Lowrey',
+ 'metadata': {
+ 'description': 'Puppy is slower than other, bigger animals.',
+ 'price': 5.95,
+ 'ages': [3, 6],
+ },
+ },
+ {
+ 'title': 'The Tale of Peter Rabbit',
+ 'author': 'Beatrix Potter',
+ 'metadata': {
+ 'description': 'Rabbit eats some vegetables.',
+ 'price': 4.49,
+ 'ages': [2, 5],
+ },
+ },
+ {
+ 'title': 'Tootle',
+ 'author': 'Gertrude Crampton',
+ 'metadata': {
+ 'description': 'Little toy train has big dreams.',
+ 'price': 3.99,
+ 'ages': [2, 5],
+ },
+ },
+ {
+ 'title': 'Green Eggs and Ham',
+ 'author': 'Dr. Seuss',
+ 'metadata': {
+ 'description':
+ 'Sam has changing food preferences and eats unusually colored food.',
+ 'price': 7.49,
+ 'ages': [4, 8],
+ },
+ },
+ {
+ 'title': 'Harry Potter and the Goblet of Fire',
+ 'author': 'J.K. Rowling',
+ 'metadata': {
+ 'description': 'Fourth year of school starts, big drama ensues.',
+ 'price': 24.95,
+ 'ages': [10, 99],
+ },
+ },
+]).execute()
+```
+
</TabPanel>
</Tabs>
@@ -397,6 +451,20 @@ val data = supabase.from("books").select(Columns.raw("""
""".trimIndent()))
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+data = supabase.from_('books').select("""
+ title,
+ description: metadata->description,
+ price: metadata->price,
+ low_age: metadata->ages->0,
+ high_age: metadata->ages->1
+"""
+).execute()
+```
+
</TabPanel>
<TabPanel id="result" label="Result">
diff --git a/apps/docs/content/guides/database/tables.mdx b/apps/docs/content/guides/database/tables.mdx
index 09a58b09b75..a3ab7f77e76 100644
--- a/apps/docs/content/guides/database/tables.mdx
+++ b/apps/docs/content/guides/database/tables.mdx
@@ -251,6 +251,22 @@ try await supabase.from("movies")
.execute()
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+client.from_("movies").insert([
+ {
+ "name": "The Empire Strikes Back",
+ "description": "After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker begins Jedi training with Yoda."
+ },
+ {
+ "name": "Return of the Jedi",
+ "description": "After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star."
+ }
+]).execute()
+```
+
</TabPanel>
<TabPanel id="kotlin" label="Kotlin">
diff --git a/apps/docs/content/guides/storage/buckets/creating-buckets.mdx b/apps/docs/content/guides/storage/buckets/creating-buckets.mdx
index b7684933de7..b441adc2a91 100644
--- a/apps/docs/content/guides/storage/buckets/creating-buckets.mdx
+++ b/apps/docs/content/guides/storage/buckets/creating-buckets.mdx
@@ -62,6 +62,30 @@ void main() async {
[Reference.](https://pub.dev/documentation/storage_client/latest/storage_client/SupabaseStorageClient/createBucket.html)
+</TabPanel>
+<TabPanel id="swift" label="Swift">
+
+```swift
+try await supabase.storage.createBucket(
+ "avatars",
+ options: BucketOptions(public: true)
+)
+```
+
+[Reference.](/docs/reference/swift/storage-createbucket)
+
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+supabase.storage.create_bucket(
+ 'avatars',
+ options={"public": True}
+)
+```
+
+[Reference.](/docs/reference/python/storage-createbucket)
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/storage/quickstart.mdx b/apps/docs/content/guides/storage/quickstart.mdx
index 233d05e5738..534d6be7b5a 100644
--- a/apps/docs/content/guides/storage/quickstart.mdx
+++ b/apps/docs/content/guides/storage/quickstart.mdx
@@ -87,6 +87,24 @@ void main() async {
[Reference.](https://pub.dev/documentation/storage_client/latest/storage_client/SupabaseStorageClient/createBucket.html)
+</TabPanel>
+<TabPanel id="swift" label="Swift">
+
+```swift
+try await supabase.storage.createBucket("avatars")
+```
+
+[Reference.](/docs/reference/swift/storage-createbucket)
+
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.create_bucket('avatars')
+```
+
+[Reference.](/docs/reference/python/storage-createbucket)
+
</TabPanel>
</Tabs>
@@ -187,6 +205,24 @@ void main() async {
[Reference.](/docs/reference/dart/storage-from-download)
+</TabPanel>
+<TabPanel id="swift" label="Swift">
+
+```swift
+let response = try await supabase.storage.from("avatars").download(path: "public/avatar1.png")
+```
+
+[Reference.](/docs/reference/python/storage-from-download)
+
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('avatars').download('public/avatar1.png')
+```
+
+[Reference.](/docs/reference/python/storage-from-download)
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/storage/serving/image-transformations.mdx b/apps/docs/content/guides/storage/serving/image-transformations.mdx
index cf445bf65bb..813da507a7b 100644
--- a/apps/docs/content/guides/storage/serving/image-transformations.mdx
+++ b/apps/docs/content/guides/storage/serving/image-transformations.mdx
@@ -70,6 +70,21 @@ val url = supabase.storage.from("bucket").publicRenderUrl("image.jpg") {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+url = supabase.storage.from_('avatars').get_public_url(
+ 'image.jpg',
+ {
+ 'transform': {
+ 'width': 500,
+ 'height': 500,
+ },
+ }
+)
+```
+
</TabPanel>
</Tabs>
@@ -206,6 +221,19 @@ supabase.storage.from("bucket").downloadAuthenticatedTo("image.jpg", file) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('bucket').download(
+ 'image.jpg',
+ {
+ 'width': 800,
+ 'height': 300,
+ },
+)
+```
+
</TabPanel>
</Tabs>
@@ -290,6 +318,22 @@ supabase.storage.from("bucket").downloadAuthenticatedTo("image.jpg", file) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('bucket').download(
+ 'image.jpeg',
+ {
+ 'transform': {
+ 'width': 200,
+ 'height': 200,
+ 'format': 'origin',
+ },
+ }
+)
+```
+
</TabPanel>
</Tabs>
@@ -395,6 +439,20 @@ supabase.storage["bucket"].downloadAuthenticatedTo("image.jpg", file) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('bucket').download(
+ 'image.jpg',
+ {
+ 'transform': {
+ 'quality': 50,
+ },
+ }
+)
+```
+
</TabPanel>
</Tabs>
@@ -481,6 +539,22 @@ supabase.storage.from("bucket").downloadAuthenticatedTo("image.jpg", file) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('bucket').download(
+ 'image.jpg',
+ {
+ 'transform': {
+ 'width': 800,
+ 'height': 300,
+ 'resize': 'contain', # 'cover' | 'fill'
+ }
+ }
+)
+```
+
</TabPanel>
</Tabs>
diff --git a/apps/docs/content/guides/storage/uploads/standard-uploads.mdx b/apps/docs/content/guides/storage/uploads/standard-uploads.mdx
index dde2143ae9a..9d383cb1e9f 100644
--- a/apps/docs/content/guides/storage/uploads/standard-uploads.mdx
+++ b/apps/docs/content/guides/storage/uploads/standard-uploads.mdx
@@ -84,6 +84,13 @@ suspend fun uploadFile(file: File) {
}
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('bucket_name').upload('file_path', file)
+```
+
</TabPanel>
</Tabs>
@@ -140,6 +147,15 @@ try await supabase.storage.from("bucket_name")
)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('bucket_name').upload('file_path', file, {
+ 'upsert': 'true',
+})
+```
+
</TabPanel>
</Tabs>
@@ -198,6 +214,15 @@ try await supabase.storage.from("bucket_name")
)
```
+</TabPanel>
+<TabPanel id="python" label="Python">
+
+```python
+response = supabase.storage.from_('bucket_name').upload('file_path', file, {
+ 'content-type': 'image/jpeg',
+})
+```
+
</TabPanel>
</Tabs>