Skip to main content

Roboflow Python Package

Roboflow provides everything you need to build and deploy computer vision models. roboflow-python is the official Roboflow Python package. roboflow-python enables you to interact with models, datasets, and projects hosted on Roboflow.

With this Python package, you can:

  1. Create and manage projects;
  2. Upload images, annotations, and datasets to manage in Roboflow;
  3. Start training vision models on Roboflow;
  4. Run inference on models hosted on Roboflow, or Roboflow models self-hosted via Roboflow Inference, and more.

The Python package is documented on the official Roboflow documentation site. If you are developing a feature for this Python package, or need a full Python library reference, refer to the package developer documentation.

💻 Installation

You will need to have Python 3.8 or higher set up to use the Roboflow Python package.

Run the following command to install the Roboflow Python package:

pip install roboflow

For desktop features, use:

pip install "roboflow[desktop]"

To decode HEIC/HEIF images locally (for example model.predict("photo.heic")), use:

pip install "roboflow[heic]"

This installs pillow-heif, whose binary wheels are GPL-2.0 licensed because they bundle the x265 encoder. Uploading HEIC images works without it, since the server decodes them.

Lightweight install (roboflow-slim)

If you only need vision events, workspace management, and the CLI (no image processing, inference, or training), install the lightweight package:

pip install roboflow-slim

This skips heavy dependencies like OpenCV, NumPy, Matplotlib, and Pillow, reducing install size from ~400MB to ~50MB. Useful for embedded devices, CI pipelines, and serverless environments.

Both packages share the same codebase and version. pip install roboflow includes everything.

Install from source

You can also install the Roboflow Python package from source using the following commands:

git clone https://github.com/roboflow-ai/roboflow-python.git
cd roboflow-python
python3 -m venv env
source env/bin/activate
pip install .
Command line tool

By installing roboflow python package you can use some of its functionality in the command line (without having to write python code). See CLI-COMMANDS.md

🚀 Getting Started

To use the Roboflow Python package, you first need to authenticate with your Roboflow account. You can do this by running the following command:

import roboflow
roboflow.login()
Authenticate with an API key

You can also authenticate with an API key by using the following code:

import roboflow

rf = roboflow.Roboflow(api_key="")

Learn how to retrieve your Roboflow API key.

Quickstart

Below are some common methods used with the Roboflow Python package, presented concisely for reference. For a full library reference, refer to the Roboflow API reference documentation.

import roboflow

# Pass API key or use roboflow.login()
rf = roboflow.Roboflow(api_key="MY_API_KEY")

workspace = rf.workspace()

# creating object detection model that will detect flowers
project = workspace.create_project(
    project_name="Flower detector",
    project_type="object-detection", # Or "classification", "instance-segmentation", "semantic-segmentation"
    project_license="MIT", # "private" for private projects, only available for paid customers
    annotation="flowers" # If you plan to annotate lillys, sunflowers, etc.
)

# upload a dataset
workspace.upload_dataset(
    dataset_path="./dataset/",
    num_workers=10,
    dataset_format="yolov8", # supports yolov8, yolov5, and Pascal VOC
    project_license="MIT",
    project_type="object-detection"
)

version = project.version("VERSION_NUMBER")

# upload model weights - yolov10
version.deploy(model_type="yolov10", model_path=f{HOME}/runs/detect/train/, filename="weights.pt")

# run inference (a version may own several trained models; models() returns all of them)
model = version.models()[0]

img_url = "https://media.roboflow.com/quickstart/aerial_drone.jpeg"

predictions = model.predict(img_url, hosted=True).json()

print(predictions)

Search and Export

Search for images across your workspace and export matching results as a ready-to-use dataset:

workspace = rf.workspace()

# Export images matching a search query
workspace.search_export(
    query="class:person",       # search query (e.g. "tag:review", "class:dog", "*")
    format="coco",              # annotation format: coco, yolov8, yolov5, voc, etc.
    dataset="my-project",       # optional: limit to a specific project
    location="./my-export",     # optional: output directory
)

Or from the CLI:

roboflow search-export "class:person" -f coco -d my-project -l ./my-export

Library Structure

The Roboflow Python library is structured using the same Workspace, Project, and Version ontology that you will see in the Roboflow application.

import roboflow

roboflow.login()

rf = roboflow.Roboflow()

workspace = rf.workspace("WORKSPACE_URL")
project = workspace.project("PROJECT_URL")
version = project.version("VERSION_NUMBER")

The workspace, project, and version parameters are the same as those you will find in the URL addresses at app.roboflow.com and universe.roboflow.com.

Within the workspace object you can perform actions like making a new project, listing your projects, or performing active learning where you are using predictions from one project's model to upload images to a new project.

Within the project object, you can retrieve metadata about the project, list versions, generate a new dataset version with preprocessing and augmentation settings, train a model in your project, and upload images and annotations to your project.

Within the version object, you can download the dataset version in any model format, train the version on Roboflow, and deploy your own external model to Roboflow.

🏆 Contributing

We would love your input on how we can improve the Roboflow Python package! Please see our contributing guide to get started. Thank you 🙏 to all our contributors!


Release files for roboflow 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roboflow 1.5.0
File Size Uploaded
roboflow-1.5.0.tar.gz 292.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for roboflow 1.5.0
File Interpreter ABI Platform
roboflow-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 615.2 kB

Release files / roboflow-1.5.0.tar.gz

Download URL roboflow-1.5.0.tar.gz
Size 292.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0c28d53863c14735cae29860ee5cbfbc97540c2a896f061ffc004611efa4e649
BLAKE2b-256 checksum
How to use checksums
6bb284b7ae216d0bbe4c0ceea18d51f88f16fa3d7257d675b0dd41f4985915b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / roboflow-1.5.0-py3-none-any.whl

Download URL roboflow-1.5.0-py3-none-any.whl
Size 322.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ab65d21ba731ec325a27f2b9f568e5c7f0f2eb339d24783ed1d838aa8895c28
BLAKE2b-256 checksum
How to use checksums
8edce14c34d1994d4fd11a94dc68e6ba4f75867fa45f8bd44fa90d85d18ee2bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.9

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.15

2 release files

1.2.14

2 release files

1.2.13

2 release files

1.2.12

2 release files

1.2.11

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.67

2 release files

1.1.65

2 release files

1.1.64

2 release files

1.1.63

2 release files

1.1.62

2 release files

1.1.61

2 release files

1.1.58

2 release files

1.1.57

2 release files

1.1.56

2 release files

1.1.55

2 release files

1.1.54

2 release files

1.1.53

2 release files

1.1.51

2 release files

1.1.50

2 release files

1.1.48

2 release files

1.1.45

2 release files

1.1.44

2 release files

1.1.43

2 release files

1.1.42

2 release files

1.1.41

2 release files

1.1.40

2 release files

1.1.39

2 release files

1.1.38

2 release files

1.1.37

2 release files

1.1.36

2 release files

1.1.35

2 release files

1.1.33

2 release files

1.1.32

2 release files

1.1.30

2 release files

1.1.29

2 release files

1.1.28

2 release files

1.1.27

2 release files

1.1.26

2 release files

1.1.25

2 release files

1.1.24

2 release files

1.1.21

2 release files

1.1.20

2 release files

1.1.18

2 release files

1.1.17

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.34

2 release files

0.2.32

2 release files

0.2.31

2 release files

0.2.30

2 release files

0.2.29

2 release files

0.2.28

2 release files

0.2.27

2 release files

0.2.26

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page