Changed API project name
This commit is contained in:
parent
18b5b998a8
commit
f661f86533
18
README.md
18
README.md
@ -5,7 +5,7 @@ A client library for accessing END PLAY Photos
|
|||||||
First, create a client:
|
First, create a client:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PhotosAPI_Client import Client
|
from photosapi_client import Client
|
||||||
|
|
||||||
client = Client(base_url="https://api.example.com")
|
client = Client(base_url="https://api.example.com")
|
||||||
```
|
```
|
||||||
@ -13,7 +13,7 @@ client = Client(base_url="https://api.example.com")
|
|||||||
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
|
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PhotosAPI_Client import AuthenticatedClient
|
from photosapi_client import AuthenticatedClient
|
||||||
|
|
||||||
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
|
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
|
||||||
```
|
```
|
||||||
@ -21,9 +21,9 @@ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSec
|
|||||||
Now call your endpoint and use your models:
|
Now call your endpoint and use your models:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PhotosAPI_Client.models import MyDataModel
|
from photosapi_client.models import MyDataModel
|
||||||
from PhotosAPI_Client.api.my_tag import get_my_data_model
|
from photosapi_client.api.my_tag import get_my_data_model
|
||||||
from PhotosAPI_Client.types import Response
|
from photosapi_client.types import Response
|
||||||
|
|
||||||
my_data: MyDataModel = get_my_data_model.sync(client=client)
|
my_data: MyDataModel = get_my_data_model.sync(client=client)
|
||||||
# or if you need more info (e.g. status_code)
|
# or if you need more info (e.g. status_code)
|
||||||
@ -33,9 +33,9 @@ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
|
|||||||
Or do the same thing with an async version:
|
Or do the same thing with an async version:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PhotosAPI_Client.models import MyDataModel
|
from photosapi_client.models import MyDataModel
|
||||||
from PhotosAPI_Client.api.my_tag import get_my_data_model
|
from photosapi_client.api.my_tag import get_my_data_model
|
||||||
from PhotosAPI_Client.types import Response
|
from photosapi_client.types import Response
|
||||||
|
|
||||||
my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
|
my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
|
||||||
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
|
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
|
||||||
@ -72,7 +72,7 @@ Things to know:
|
|||||||
|
|
||||||
1. All path/query params, and bodies become method arguments.
|
1. All path/query params, and bodies become method arguments.
|
||||||
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
||||||
1. Any endpoint which did not have a tag will be in `PhotosAPI_Client.api.default`
|
1. Any endpoint which did not have a tag will be in `photosapi_client.api.default`
|
||||||
|
|
||||||
## Building / publishing this Client
|
## Building / publishing this Client
|
||||||
This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
|
This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
|
||||||
|
2
setup.py
2
setup.py
@ -14,5 +14,5 @@ setup(
|
|||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
python_requires=">=3.7, <4",
|
python_requires=">=3.7, <4",
|
||||||
install_requires=["httpx >= 0.15.0, < 0.24.0", "attrs >= 21.3.0", "python-dateutil >= 2.8.0, < 3"],
|
install_requires=["httpx >= 0.15.0, < 0.24.0", "attrs >= 21.3.0", "python-dateutil >= 2.8.0, < 3"],
|
||||||
package_data={"PhotosAPI_Client": ["py.typed"]},
|
package_data={"photosapi_client": ["py.typed"]},
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user