Skip to content

Commit c1d4e3b

Browse files
committed
Update README to be consistent with clients
1 parent b6b8246 commit c1d4e3b

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed

README.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@ A Python client for the [DNSimple API v2](https://developer.dnsimple.com/v2/).
44

55
[![CI](https://github.com/dnsimple/dnsimple-python/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/dnsimple/dnsimple-python/actions/workflows/ci.yml)
66

7-
## Documentation
8-
9-
- [dnsimple PyPI](https://pypi.org/project/dnsimple/)
10-
- [DNSimple API documentation](https://developer.dnsimple.com/)
11-
- [DNSimple API examples repository](https://github.com/dnsimple/dnsimple-api-examples)
12-
- [DNSimple support documentation](https://support.dnsimple.com/)
13-
147
## Requirements
158

169
- Python 3.12+ - Note later versions of Python may be supported, but we make no guarantees as they are not tracked in our CI.
10+
- An activated DNSimple account
1711

1812
## Installation
1913

@@ -47,32 +41,6 @@ data = response.data # extract the relevant data from
4741
account = client.identity.whoami().data.account # execute the call and get the data in one line
4842
```
4943

50-
### Sandbox Environment
51-
52-
We highly recommend testing against our [sandbox environment](https://developer.dnsimple.com/sandbox/) before using our
53-
production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the
54-
chance of your running up against rate limits.
55-
56-
The client supports both the production and sandbox environment. To switch to sandbox pass the sandbox API host using
57-
the `base_url` option when you construct the client:
58-
59-
```python
60-
from dnsimple import Client
61-
62-
client = Client(base_url='https://api.sandbox.dnsimple.com', access_token="a1b2c3")
63-
```
64-
65-
You can also set the sandbox environment like so:
66-
67-
```python
68-
from dnsimple import Client
69-
70-
client = Client(sandbox=True, access_token='a1b2c3')
71-
```
72-
73-
You will need to ensure that you are using an access token created in the sandbox environment.
74-
Production tokens will *not* work in the sandbox environment.
75-
7644
### Define an account ID
7745

7846
```python
@@ -124,7 +92,35 @@ domain_id = client.domains.list_domains(account_id).data[0].id
12492
domain = client.domains.get_domain(account_id, domain_id).data # The domain you are looking for
12593
```
12694

127-
## Setting a custom `User-Agent` header
95+
## Configuration
96+
97+
### Sandbox Environment
98+
99+
We highly recommend testing against our [sandbox environment](https://developer.dnsimple.com/sandbox/) before using our
100+
production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the
101+
chance of your running up against rate limits.
102+
103+
The client supports both the production and sandbox environment. To switch to sandbox pass the sandbox API host using
104+
the `base_url` option when you construct the client:
105+
106+
```python
107+
from dnsimple import Client
108+
109+
client = Client(base_url='https://api.sandbox.dnsimple.com', access_token="a1b2c3")
110+
```
111+
112+
You can also set the sandbox environment like so:
113+
114+
```python
115+
from dnsimple import Client
116+
117+
client = Client(sandbox=True, access_token='a1b2c3')
118+
```
119+
120+
You will need to ensure that you are using an access token created in the sandbox environment.
121+
Production tokens will *not* work in the sandbox environment.
122+
123+
### Setting a custom `User-Agent` header
128124

129125
You customize the `User-Agent` header for the calls made to the DNSimple API:
130126

@@ -137,6 +133,13 @@ client = Client(user_agent="my-app")
137133
The value you provide will be appended to the default `User-Agent` the client uses.
138134
For example, if you use `my-app`, the final header value will be `my-app dnsimple-python/0.1.0` (note that it will vary depending on the client version).
139135

136+
## Documentation
137+
138+
- [dnsimple PyPI](https://pypi.org/project/dnsimple/)
139+
- [DNSimple API documentation](https://developer.dnsimple.com/)
140+
- [DNSimple API examples repository](https://github.com/dnsimple/dnsimple-api-examples)
141+
- [DNSimple support documentation](https://support.dnsimple.com/)
142+
140143
## Contributing
141144

142145
Contributions are welcome! Please feel free to submit issues and pull requests. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

0 commit comments

Comments
 (0)