---
updatedAt: 2025-09-24T21:32:15.000Z
agentTools:
  projectIndex: https://developers.transifex.com/llms.txt
---

# Create, update and delete a resource in Python

```python Python
# Use the Transifex Python SDK from PyPI:
# https://pypi.org/project/transifex-python
#
# Install the SDK using pip:
# pip install transifex-python

from transifex.api import transifex_api

# API token authentication
transifex_api.setup(auth="<YOUR-API-TOKEN>")

# Get the organization and project models
organization = transifex_api.Organization.get(slug="<YOUR-ORG-SLUG>")
project = organization.fetch('projects').get(slug="<YOUR-PROJECT-SLUG>")

# Create a new resource
i18n_format = transifex_api.i18n_formats.get(
    organization=organization,
    name="KEYVALUEJSON")

resource = transifex_api.Resource.create(
    name="<NEW-RESOURCE-NAME>",
    slug="<NEW-RESOURCE-SLUG>",
    i18n_format=i18n_format,
    project=project,
)

# Upload content
content = '{ "key": "value" }'
transifex_api.ResourceStringsAsyncUpload.upload(
  resource=resource, content=content
)

# Delete resource
resource.delete()


```

# Install the SDK

<!-- python@1-5 -->

Install the Transifex Python SDK from [PyPI](https://pypi.org/project/transifex-python/), using the following command in the terminal:
```
pip install transifex-python
```

# Setup authentication

<!-- python@7-10 -->

Create an API token from your [user settings page](https://www.transifex.com/user/settings/api/) in Transifex and initialize the SDK.

# Retrieve the project

<!-- python@12-14 -->

Use the SDK to get the organization and project model you want to manage.

# Create a new resource

<!-- python@16-26 -->

Add a new resource to the project by selecting an i18n file format and setting the resource name and slug.

# Add some content

<!-- python@28-32 -->

Upload some content to the resource. The content must be compatible with the selected i18n format. This is usually read by a file. 

> On this example, we have chosen the KEYVALUEJSON format.

# Delete a resource

<!-- python@35 -->

Delete the resource by using the `delete()` method on a resource model.