Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sdk/python/

1. **Clone the repository:**
```bash
git clone https://github.com/TeoSlayer/pilotprotocol.git
git clone https://github.com/pilot-protocol/pilotprotocol.git
cd pilotprotocol/sdk/python
```

Expand Down
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,23 @@ pilotctl daemon start --hostname my-agent
Then, from your code:

```python
from pilotprotocol import Driver

with Driver() as d:
info = d.info()
print(f"address={info['address']}")

d.set_hostname("my-python-agent")
from pilotprotocol import Driver, PilotError

peer = d.resolve_hostname("other-agent")
with d.dial(f"{peer['address']}:1000") as conn:
conn.write(b"hello")
print(conn.read(4096))
try:
with Driver() as d:
info = d.info()
print(f"address={info['address']}")

d.set_hostname("my-python-agent")

peer = d.resolve_hostname("other-agent")
with d.dial(f"{peer['address']}:1000") as conn:
conn.write(b"hello")
print(conn.read(4096))
except (PilotError, FileNotFoundError) as e:
# Raised when libpilot isn't installed or no daemon is running.
# Start one with: pilotctl daemon start --hostname my-agent
print(f"pilot daemon unavailable: {e}")
```

## API overview
Expand All @@ -65,7 +70,7 @@ from pilotprotocol import Driver, PilotError
try:
with Driver() as d:
d.resolve_hostname("unknown")
except PilotError as e:
except (PilotError, FileNotFoundError) as e:
print(f"error: {e}")
```

Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pip install build twine

### 1. Clone the repository
```bash
git clone https://github.com/TeoSlayer/pilotprotocol.git
git clone https://github.com/pilot-protocol/pilotprotocol.git
cd pilotprotocol/sdk/python
```

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ pilot-updater = "pilotprotocol.cli:run_updater"
[project.urls]
Homepage = "https://pilotprotocol.network"
Documentation = "https://pilotprotocol.network/docs/"
Repository = "https://github.com/TeoSlayer/pilotprotocol"
"Bug Tracker" = "https://github.com/TeoSlayer/pilotprotocol/issues"
Changelog = "https://github.com/TeoSlayer/pilotprotocol/blob/main/sdk/python/CHANGELOG.md"
Repository = "https://github.com/pilot-protocol/pilotprotocol"
"Bug Tracker" = "https://github.com/pilot-protocol/pilotprotocol/issues"
Changelog = "https://github.com/pilot-protocol/pilotprotocol/blob/main/sdk/python/CHANGELOG.md"

[project.optional-dependencies]
dev = [
Expand Down
Loading