Skip to content

Commit f04ab85

Browse files
committed
update readme, add new docs
1 parent 4f0fa63 commit f04ab85

File tree

4 files changed

+151
-120
lines changed

4 files changed

+151
-120
lines changed

CITATION.cff

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cff-version: 1.2.0
2+
author: Roboflow
3+
message: If you use this software, please cite using the citation below.
4+
title: roboflow-python
5+
version: 1.1.4
6+
date-released: 2023-08-23
7+
license: MIT
8+
repository-code: https://github.com/roboflow/roboflow-python
9+
keywords:
10+
- computer vision
11+
- roboflow

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
## Contributing
3+
4+
If you want to extend our Python library or if you find a bug, please open a PR!
5+
6+
Also be sure to test your code the `unittest` command at the `/root` level directory.
7+
8+
Run tests:
9+
10+
```bash
11+
python -m unittest
12+
```
13+
14+
When creating new functions, please follow the [Google style Python docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html). See example below:
15+
16+
```python
17+
def example_function(param1: int, param2: str) -> bool:
18+
"""Example function that does something.
19+
20+
Args:
21+
param1: The first parameter.
22+
param2: The second parameter.
23+
24+
Returns:
25+
The return value. True for success, False otherwise.
26+
27+
"""
28+
```
29+
30+
We provide a `Makefile` to format and ensure code quality. **Be sure to run them before creating a PR**.
31+
32+
```bash
33+
# format code with `black` and `isort`
34+
make style
35+
36+
# check code with flake8
37+
make check_code_quality
38+
```
39+
40+
**Note** These tests will be run automatically when you commit thanks to git hooks.

README.md

Lines changed: 98 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -3,100 +3,69 @@
33
---
44
![roboflow logo](https://media.roboflow.com/homepage/cv_pipeline_compact.png?updatedAt=1679939317160)
55

6+
[Roboflow](https://roboflow.com) 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.
67

7-
<div align="center">
8-
<a href="https://youtube.com/roboflow">
9-
<img
10-
src="https://media.roboflow.com/notebooks/template/icons/purple/youtube.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634652"
11-
width="3%"
12-
/>
13-
</a>
14-
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
15-
<a href="https://roboflow.com">
16-
<img
17-
src="https://media.roboflow.com/notebooks/template/icons/purple/roboflow-app.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949746649"
18-
width="3%"
19-
/>
20-
</a>
21-
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
22-
<a href="https://www.linkedin.com/company/roboflow-ai/">
23-
<img
24-
src="https://media.roboflow.com/notebooks/template/icons/purple/linkedin.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633691"
25-
width="3%"
26-
/>
27-
</a>
28-
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
29-
<a href="https://docs.roboflow.com">
30-
<img
31-
src="https://media.roboflow.com/notebooks/template/icons/purple/knowledge.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634511"
32-
width="3%"
33-
/>
34-
</a>
35-
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
36-
<a href="https://disuss.roboflow.com">
37-
<img
38-
src="https://media.roboflow.com/notebooks/template/icons/purple/forum.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633584"
39-
width="3%"
40-
/>
41-
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
42-
<a href="https://blog.roboflow.com">
43-
<img
44-
src="https://media.roboflow.com/notebooks/template/icons/purple/blog.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633605"
45-
width="3%"
46-
/>
47-
</a>
48-
</a>
49-
</div>
50-
51-
<br>
52-
53-
**Roboflow** streamlines your computer vision pipeline - upload data, label it, download datasets, train models, deploy models, and repeat.
54-
55-
The **Roboflow Python Package** is a python wrapper around the core Roboflow web application and REST API.
56-
57-
We also maintain an open source set of CV utililities and notebook tutorials in Python:
58-
59-
* :fire: https://github.com/roboflow/supervision :fire:
60-
* :fire: https://github.com/roboflow/notebooks :fire:
61-
62-
## Installation
63-
64-
To install this package, please use `Python 3.6` or higher.
65-
66-
Install from PyPi (Recommended):
8+
With this Python package, you can:
9+
10+
1. Create and manage projects;
11+
2. Upload images, annotations, and datasets to manage in Roboflow;
12+
3. Start training vision models on Robfolow;
13+
4. Run inference on models hosted on Roboflow, or Roboflow models self-hosted via [Roboflow Inference](https://github.com/roboflow/inference), and more.
14+
15+
## 💻 Installation
16+
17+
You will need to have `Python 3.6` or higher set up to use the Roboflow Python package.
18+
19+
Run the following command to install the Roboflow Python package:
6720

6821
```bash
6922
pip install roboflow
7023
```
7124

72-
Install from Source:
25+
<details>
26+
<summary>Install from source</summary>
7327

74-
```bash
75-
git clone https://github.com/roboflow-ai/roboflow-python.git
76-
cd roboflow-python
77-
python3 -m venv env
78-
source env/bin/activate
79-
pip3 install -r requirements.txt
80-
```
28+
You can also install the Roboflow Python package from source using the following commands:
8129

82-
## Authentication
30+
```bash
31+
git clone https://github.com/roboflow-ai/roboflow-python.git
32+
cd roboflow-python
33+
python3 -m venv env
34+
source env/bin/activate
35+
pip3 install -r requirements.txt
36+
```
37+
</details>
38+
39+
## 🚀 Getting Started
40+
41+
To use the Roboflow Python package, you first need to authenticate with your Roboflow account. You can do this by running the following command:
8342

8443
```python
8544
import roboflow
8645
roboflow.login()
8746
```
8847

89-
## Quickstart
48+
<details>
49+
<summary>Authenticate with an API key</summary>
50+
51+
You can also authenticate with an API key by using the following code:
52+
53+
```python
54+
import roboflow
55+
56+
rf = roboflow.Roboflow(api_key="")
57+
```
58+
59+
[Learn how to retrieve your Roboflow API key](https://docs.roboflow.com/api-reference/authentication#retrieve-an-api-key).
60+
61+
</details>
9062

9163
### Datasets
9264

9365
Download any of over 200,000 public computer vision datasets from [Roboflow Universe](universe.roboflow.com). Label and download your own datasets on app.roboflow.com.
9466

9567
```python
96-
import roboflow
9768
dataset = roboflow.download_dataset(dataset_url="universe.roboflow.com/...", model_format="yolov8")
98-
#ex. dataset = roboflow.download_dataset(dataset_url="https://universe.roboflow.com/joseph-nelson/bccd/dataset/1", model_format="yolov8")
99-
print(dataset.location)
10069
```
10170

10271
### Models
@@ -114,13 +83,17 @@ pred.plot()
11483

11584
## Library Structure
11685

117-
The Roboflow python library is structured by the core Roboflow application objects.
86+
The Roboflow Python library is structured by the core Roboflow application objects.
11887

11988
Workspace (workspace.py) --> Project (project.py) --> Version (version.py)
12089

12190
```python
122-
from roboflow import Roboflow
123-
rf = Roboflow()
91+
import roboflow
92+
93+
roboflow.login()
94+
95+
rf = roboflow.Roboflow()
96+
12497
workspace = rf.workspace("WORKSPACE_URL")
12598
project = workspace.project("PROJECT_URL")
12699
version = project.version("VERSION_NUMBER")
@@ -134,42 +107,52 @@ Within the project object, you can retrieve metadata about the project, list ver
134107

135108
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.
136109

137-
## Contributing
138-
139-
If you want to extend our Python library or if you find a bug, please open a PR!
140-
141-
Also be sure to test your code the `unittest` command at the `/root` level directory.
142-
143-
Run tests:
144-
145-
```bash
146-
python -m unittest
147-
```
148-
149-
When creating new functions, please follow the [Google style Python docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html). See example below:
150-
151-
```python
152-
def example_function(param1: int, param2: str) -> bool:
153-
"""Example function that does something.
154-
155-
Args:
156-
param1: The first parameter.
157-
param2: The second parameter.
158-
159-
Returns:
160-
The return value. True for success, False otherwise.
161-
162-
"""
163-
```
164-
165-
We provide a `Makefile` to format and ensure code quality. **Be sure to run them before creating a PR**.
166-
167-
```bash
168-
# format code with `black` and `isort`
169-
make style
170-
171-
# check code with flake8
172-
make check_code_quality
173-
```
174-
175-
**Note** These tests will be run automatically when you commit thanks to git hooks.
110+
## 🏆 Contributing
111+
112+
We would love your input on how we can improve the Roboflow Python package! Please see our [contributing guide](https://github.com/roboflow/roboflow-python) to get started. Thank you 🙏 to all our contributors!
113+
114+
<br>
115+
116+
<div align="center">
117+
<a href="https://youtube.com/roboflow">
118+
<img
119+
src="https://media.roboflow.com/notebooks/template/icons/purple/youtube.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634652"
120+
width="3%"
121+
/>
122+
</a>
123+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
124+
<a href="https://roboflow.com">
125+
<img
126+
src="https://media.roboflow.com/notebooks/template/icons/purple/roboflow-app.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949746649"
127+
width="3%"
128+
/>
129+
</a>
130+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
131+
<a href="https://www.linkedin.com/company/roboflow-ai/">
132+
<img
133+
src="https://media.roboflow.com/notebooks/template/icons/purple/linkedin.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633691"
134+
width="3%"
135+
/>
136+
</a>
137+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
138+
<a href="https://docs.roboflow.com">
139+
<img
140+
src="https://media.roboflow.com/notebooks/template/icons/purple/knowledge.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949634511"
141+
width="3%"
142+
/>
143+
</a>
144+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
145+
<a href="https://disuss.roboflow.com">
146+
<img
147+
src="https://media.roboflow.com/notebooks/template/icons/purple/forum.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633584"
148+
width="3%"
149+
/>
150+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%"/>
151+
<a href="https://blog.roboflow.com">
152+
<img
153+
src="https://media.roboflow.com/notebooks/template/icons/purple/blog.png?ik-sdk-version=javascript-1.4.3&updatedAt=1672949633605"
154+
width="3%"
155+
/>
156+
</a>
157+
</a>
158+
</div>

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,21 @@
44

55
with open("./roboflow/__init__.py", "r") as f:
66
content = f.read()
7-
# from https://www.py4u.net/discuss/139845
87
version = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', content).group(1)
98

109

1110
with open("README.md", "r") as fh:
1211
long_description = fh.read()
1312

14-
# we are using the packages in `requirements.txt` for now,
15-
# not 100% ideal but will do
1613
with open("requirements.txt", "r") as fh:
1714
install_requires = fh.read().split('\n')
1815

1916
setuptools.setup(
2017
name="roboflow",
2118
version=version,
2219
author="Roboflow",
23-
author_email="jacob@roboflow.com",
24-
description="python client for the Roboflow application",
20+
author_email="support@roboflow.com",
21+
description="Official Python package for working with the Roboflow API",
2522
long_description=long_description,
2623
long_description_content_type="text/markdown",
2724
url="https://github.com/roboflow-ai/roboflow-python",

0 commit comments

Comments
 (0)