Metadata-Version: 2.1
Name: ftc_api
Version: 0.1.0
Summary: A python client to access the FIRST Tech Challenge API
Author-email: Ashwin Naren <arihant2math@gmail.com>
License: Copyright 2023 Ashwin Naren
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Keywords: ftc
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# FTC api
A python client library for accessing FTC Events API

[API docs here](https://ftc-events.firstinspires.org/api-docs/index.html)

Most of the code here is auto generated by [openapi-python-client](https://github.com/openapi-generators/openapi-python-client), but some of it has been modified for the convenience of the user.

## Usage
First, create a client:

```python
from ftc_api import Client

client = Client(token="Insert Token Here")
```

Alternatively, use your username and access key, and the token will be automatically generated:

```python
from ftc_api import Client

client = Client(username="test", authorization_key="****-****-****-****")
```

Now call your endpoint and use your models:

```python
from ftc_api.api.season_data import get_v2_0_season
import ftc_api

client = ftc_api.Client(username="test", authorization_key="****-****-****-****")
my_data = get_v2_0_season.sync(client=client, season=2022)
print(my_data.game_name) # POWERPLAY
# or if you need more info (e.g. status_code)
response = get_v2_0_season.sync_detailed(client=client, season=2022)
print(response.headers) # server headers
print(response.content) # raw json
```

Or do the same thing with an async version:

```python
from ftc_api.api.season_data import get_v2_0_season
import ftc_api

client = ftc_api.Client(username="test", authorization_key="****-****-****-****")
my_data = await get_v2_0_season.asyncio(client=client, season=2022)
print(my_data.game_name) # POWERPLAY
# or if you need more info (e.g. status_code)
response = await get_v2_0_season.asyncio(client=client, season=2022)
print(response.headers) # server headers
print(response.content) # raw json

```


## Things to know
1. Every path/method combo becomes a Python module with four functions:
    1. `sync`: Blocking request that returns parsed data (if successful) or `None`
    2. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
    3. `asyncio`: Like `sync` but async instead of blocking
    4. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking

2. All path/query params, and bodies become method arguments.
3. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
4. Any endpoint which did not have a tag will be in `ftc_events_api_client.api.default`
## Updates
FIRST releases major updates with new season-specific models every year, the project will be updated with these new models.
