Compare commits

...

3 Commits

Author SHA1 Message Date
Profitroll c88eab236b Bump to version 0.1.1 2023-03-22 22:04:56 +01:00
Profitroll f661f86533 Changed API project name 2023-03-22 22:04:25 +01:00
Profitroll 18b5b998a8 Updated ignore 2023-03-22 19:43:23 +01:00
55 changed files with 12 additions and 11 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@ dmypy.json
/coverage.xml
/.coverage
.vscode

View File

@ -5,7 +5,7 @@ A client library for accessing END PLAY Photos
First, create a client:
```python
from PhotosAPI_Client import Client
from photosapi_client import Client
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:
```python
from PhotosAPI_Client import AuthenticatedClient
from photosapi_client import AuthenticatedClient
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:
```python
from PhotosAPI_Client.models import MyDataModel
from PhotosAPI_Client.api.my_tag import get_my_data_model
from PhotosAPI_Client.types import Response
from photosapi_client.models import MyDataModel
from photosapi_client.api.my_tag import get_my_data_model
from photosapi_client.types import Response
my_data: MyDataModel = get_my_data_model.sync(client=client)
# 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:
```python
from PhotosAPI_Client.models import MyDataModel
from PhotosAPI_Client.api.my_tag import get_my_data_model
from PhotosAPI_Client.types import Response
from photosapi_client.models import MyDataModel
from photosapi_client.api.my_tag import get_my_data_model
from photosapi_client.types import Response
my_data: MyDataModel = await get_my_data_model.asyncio(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. 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
This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:

View File

@ -7,12 +7,12 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
setup(
name="PhotosAPI_Client",
version="0.1",
version="0.1.1",
description="A client library for accessing END PLAY Photos",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
python_requires=">=3.7, <4",
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"]},
)