# contexte: load an LLM dataset, prompt or context in one line of Python
type: article | language: en | date: 2026-09-29 | author: Tony, creator of Contexte Tech | tags: Python, PyPI, LLM, fine-tuning, prompts
url: https://contextetech.com/en/articles/contexte-python
description: The contexte Python package fetches any Contexte Tech resource in one line: a dataset ready for training, a prompt to fill, a few-shot context ready for a chat API. No dependencies, MIT licensed.
other languages:
fr: https://contextetech.com/articles/contexte-python
es: https://contextetech.com/es/articles/contexte-python
de: https://contextetech.com/de/articles/contexte-python
it: https://contextetech.com/it/articles/contexte-python
nl: https://contextetech.com/nl/articles/contexte-python
pt: https://contextetech.com/pt/articles/contexte-python
sv: https://contextetech.com/sv/articles/contexte-python
pl: https://contextetech.com/pl/articles/contexte-python
all articles: https://contextetech.com/en/articles
---
Until now, using a Contexte Tech resource in a program always meant the same steps: open the page, download the file, put it in the project, write a few lines to read it. And start again every time the resource was updated.
Not anymore: the **`contexte`** package is out on [PyPI](https://pypi.org/project/contexte/).
```bash
pip install contexte
```
## One resource, one line
Each resource is loaded by its name, as shown at the top of its page (`author/name`):
```python
import contexte
ds = contexte.load("contextetech/anonymisation-rgpd-fr")
print(len(ds), ds[0])
```
What you get depends on the kind of resource:
- **a dataset** comes as ready-to-use rows (20 examples here) that you iterate like a list;
- **a prompt** fills itself and tells you which variables are missing:
```python
p = contexte.load("contextetech/fiche-produit-ecommerce")
print(p.variables) # ['produit', 'caracteristiques', 'public']
text = p.fill(produit="Headphones", caracteristiques="Bluetooth, 30 h battery", public="students")
```
- **a few-shot context** gives you the system prompt and messages ready for the chat API of your choice (Claude, Mistral…):
```python
c = contexte.load("contextetech/anonymisation-rgpd")
system = c.system_prompt()
messages = c.messages("Hello, I'm Jean Martin, reachable at 06 11 22 33 44.")
```
## Short codes and the command line
Every resource has a short code: the end of its URL. For `…/fiche-produit-ecommerce-jr6t0n`, it's `jr6t0n`. That's enough to load it:
```python
p = contexte.load("jr6t0n")
```
And if you'd rather not write Python, the package also installs a command:
```bash
contexte get jr6t0n # → fiche-produit-ecommerce.json
contexte get contextetech/anonymisation-rgpd-fr -o data/
contexte search rgpd --kind dataset
```
Each download reminds you of the resource's license, so you know right away what you're allowed to do with it.
## How much will it cost?
Before plugging a context into a model, it's worth knowing the price:
```python
contexte.cost("contextetech/anonymisation-rgpd")
```
You get the estimated cost in euros, per call and per 1,000 calls, on the main API models. For an open model resource, it's the rental price of a suitable GPU, with the best current offer. The same figures appear in the **Cost** tab of each resource.
## Light and open
- **No dependencies**: only the Python standard library, installs in a second;
- **Read-only, no account**: the package calls Contexte Tech's [public API](/api/docs);
- **MIT license**: free to use, including in a commercial product.
Every resource in the catalogue now shows, in its **Usage** tab, the `pip install contexte` command and the two or three lines to use it. Just copy.contexte: load an LLM dataset, prompt or context in one line of Python
Tony, creator of Contexte Tech · September 29, 2026
Until now, using a Contexte Tech resource in a program always meant the same steps: open the page, download the file, put it in the project, write a few lines to read it. And start again every time the resource was updated.
Not anymore: the contexte package is out on PyPI.
pip install contexte
One resource, one line
Each resource is loaded by its name, as shown at the top of its page (author/name):
import contexte
ds = contexte.load("contextetech/anonymisation-rgpd-fr")
print(len(ds), ds[0])
What you get depends on the kind of resource:
- a dataset comes as ready-to-use rows (20 examples here) that you iterate like a list;
- a prompt fills itself and tells you which variables are missing:
p = contexte.load("contextetech/fiche-produit-ecommerce")
print(p.variables) # ['produit', 'caracteristiques', 'public']
text = p.fill(produit="Headphones", caracteristiques="Bluetooth, 30 h battery", public="students")
- a few-shot context gives you the system prompt and messages ready for the chat API of your choice (Claude, Mistral…):
c = contexte.load("contextetech/anonymisation-rgpd")
system = c.system_prompt()
messages = c.messages("Hello, I'm Jean Martin, reachable at 06 11 22 33 44.")
Short codes and the command line
Every resource has a short code: the end of its URL. For …/fiche-produit-ecommerce-jr6t0n, it’s jr6t0n. That’s enough to load it:
p = contexte.load("jr6t0n")
And if you’d rather not write Python, the package also installs a command:
contexte get jr6t0n # → fiche-produit-ecommerce.json
contexte get contextetech/anonymisation-rgpd-fr -o data/
contexte search rgpd --kind dataset
Each download reminds you of the resource’s license, so you know right away what you’re allowed to do with it.
How much will it cost?
Before plugging a context into a model, it’s worth knowing the price:
contexte.cost("contextetech/anonymisation-rgpd")
You get the estimated cost in euros, per call and per 1,000 calls, on the main API models. For an open model resource, it’s the rental price of a suitable GPU, with the best current offer. The same figures appear in the Cost tab of each resource.
Light and open
- No dependencies: only the Python standard library, installs in a second;
- Read-only, no account: the package calls Contexte Tech’s public API;
- MIT license: free to use, including in a commercial product.
Every resource in the catalogue now shows, in its Usage tab, the pip install contexte command and the two or three lines to use it. Just copy.