Skip to content

Commit

Permalink
Merge pull request #5 from SeisSerenata/main
Browse files Browse the repository at this point in the history
feat: update aisec api to 0.1.0
  • Loading branch information
SeisSerenata authored Jun 30, 2024
2 parents 4840e9b + 19244f7 commit 8519d12
Show file tree
Hide file tree
Showing 36 changed files with 1,848 additions and 409 deletions.
53 changes: 43 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,73 @@ Please reach out at [email protected] for an API key.
```python
import os
import sec_agent_sdk
from sec_agent_sdk import FormType, FilingTable
from sec_agent_sdk import ApiClient, DefaultApi, FilingTable, FormType
from sec_agent_sdk.rest import ApiException
from pprint import pprint

configuration = sec_agent_sdk.Configuration()

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
configuration.api_key["APIKeyHeader"] = "YOUR-API-KEY"

# Enter a context with an instance of the API client
with sec_agent_sdk.ApiClient(configuration) as api_client:
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sec_agent_sdk.DefaultApi(api_client)
form_type = FormType.EIGHT_K # FormType | 10-K | 10-Q | 8-K | 6-K
company = 'AA' # ticker
table = FilingTable.BALANCE_SHEET # FilingTable | 'cash-flow-statement' | 'income-statement' | 'balance-sheet' | 'business-segments-and-kpis'
date_filed = '2024-04-17' # optional str (date string in YYYY-mm-dd) or None(the latest filing will be retrieved)
api_instance = DefaultApi(api_client)
form_type = FormType.EIGHT_K # FormType | 10-K | 10-Q | 8-K | 6-K
company = "AAPL" # ticker
table = (
FilingTable.BALANCE_SHEET
) # FilingTable | 'cash-flow-statement' | 'income-statement' | 'balance-sheet'
# date_filed = '2024-04-17' # optional str (date string in YYYY-mm-dd) or None(the latest filing will be retrieved)

try:
# Search sec filing
api_response = api_instance.search_sec_filing(form_type, company, table, date_filed)
api_response = api_instance.search_sec_filing_get(form_type, company, table)
print("The response of DefaultApi->search_sec_filing:\n")
pprint(api_response)

# Search sec filing v2
api_response = api_instance.search_sec_filing_v2_get(form_type, company, table)
print("The response of DefaultApi->search_sec_filing_v2:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->search_sec_filing: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *https://c11yrich0c.execute-api.us-west-2.amazonaws.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**health_check_health_get**](docs/DefaultApi.md#health_check_health_get) | **GET** /health | Health Check
*DefaultApi* | [**search_filing_v1_sec_filing_get**](docs/DefaultApi.md#search_filing_v1_sec_filing_get) | **GET** /v1/sec-filing | Search Filing
*DefaultApi* | [**search_filing_v2_v1_sec_filing_v2_get**](docs/DefaultApi.md#search_filing_v2_v1_sec_filing_v2_get) | **GET** /v1/sec-filing-v2 | Search Filing V2


## Documentation For Models

- [CreateFiling](docs/CreateFiling.md)
- [Filing](docs/Filing.md)
- [FilingTable](docs/FilingTable.md)
- [FilingV2](docs/FilingV2.md)
- [FormType](docs/FormType.md)
- [HTTPValidationError](docs/HTTPValidationError.md)
- [LocationInner](docs/LocationInner.md)
- [PatchFiling](docs/PatchFiling.md)
- [ValidationError](docs/ValidationError.md)
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization

Endpoints do not require authorization.


## Author




36 changes: 36 additions & 0 deletions docs/CreateFiling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# CreateFiling


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**company** | **str** | |
**cik** | **str** | | [optional] [default to '']
**quarter** | **str** | | [optional] [default to '']
**date_filed** | **str** | |
**url** | **str** | | [optional] [default to '']
**form_type** | **str** | |
**table** | [**FilingTable**](FilingTable.md) | |
**parsed** | **str** | |

## Example

```python
from sec_agent_sdk.models.create_filing import CreateFiling

# TODO update the JSON string below
json = "{}"
# create an instance of CreateFiling from a JSON string
create_filing_instance = CreateFiling.from_json(json)
# print the JSON string representation of the object
print(CreateFiling.to_json())

# convert the object into a dict
create_filing_dict = create_filing_instance.to_dict()
# create an instance of CreateFiling from a dict
create_filing_from_dict = CreateFiling.from_dict(create_filing_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


167 changes: 152 additions & 15 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,81 @@ All URIs are relative to *https://c11yrich0c.execute-api.us-west-2.amazonaws.com

Method | HTTP request | Description
------------- | ------------- | -------------
[**search_sec_filing**](DefaultApi.md#search_sec_filing) | **GET** /v1/sec-filing | Search sec filing
[**health_check_health_get**](DefaultApi.md#health_check_health_get) | **GET** /health | Health Check
[**search_filing_v1_sec_filing_get**](DefaultApi.md#search_filing_v1_sec_filing_get) | **GET** /v1/sec-filing | Search Filing
[**search_filing_v2_v1_sec_filing_v2_get**](DefaultApi.md#search_filing_v2_v1_sec_filing_v2_get) | **GET** /v1/sec-filing-v2 | Search Filing V2


# **search_sec_filing**
> Filing search_sec_filing(form_type, company, date_filed, table)
# **health_check_health_get**
> str health_check_health_get()
Search sec filing
Health Check

Search sec filing
### Example


```python
import sec_agent_sdk
from sec_agent_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://c11yrich0c.execute-api.us-west-2.amazonaws.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sec_agent_sdk.Configuration(
host = "https://c11yrich0c.execute-api.us-west-2.amazonaws.com"
)


# Enter a context with an instance of the API client
with sec_agent_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sec_agent_sdk.DefaultApi(api_client)

try:
# Health Check
api_response = api_instance.health_check_health_get()
print("The response of DefaultApi->health_check_health_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DefaultApi->health_check_health_get: %s\n" % e)
```



### Parameters

This endpoint does not need any parameter.

### Return type

**str**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **search_filing_v1_sec_filing_get**
> Filing search_filing_v1_sec_filing_get(form_type, company, table, date_filed=date_filed)
Search Filing

Search sec filings

### Example

* Api Key Authentication (APIKeyHeader):

```python
import sec_agent_sdk
Expand Down Expand Up @@ -49,16 +111,16 @@ with sec_agent_sdk.ApiClient(configuration) as api_client:
api_instance = sec_agent_sdk.DefaultApi(api_client)
form_type = sec_agent_sdk.FormType() # FormType |
company = 'company_example' # str |
date_filed = 'date_filed_example' # str |
table = sec_agent_sdk.FilingTable() # FilingTable |
date_filed = 'date_filed_example' # str | (optional)

try:
# Search sec filing
api_response = api_instance.search_sec_filing(form_type, company, date_filed, table)
print("The response of DefaultApi->search_sec_filing:\n")
# Search Filing
api_response = api_instance.search_filing_v1_sec_filing_get(form_type, company, table, date_filed=date_filed)
print("The response of DefaultApi->search_filing_v1_sec_filing_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DefaultApi->search_sec_filing: %s\n" % e)
print("Exception when calling DefaultApi->search_filing_v1_sec_filing_get: %s\n" % e)
```


Expand All @@ -70,16 +132,93 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**form_type** | [**FormType**](.md)| |
**company** | **str**| |
**date_filed** | **str**| |
**table** | [**FilingTable**](.md)| |
**date_filed** | **str**| | [optional]

### Return type

[**Filing**](Filing.md)

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader)
No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response | - |
**422** | Validation Error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **search_filing_v2_v1_sec_filing_v2_get**
> FilingV2 search_filing_v2_v1_sec_filing_v2_get(form_type, company, table, date_filed=date_filed)
Search Filing V2

Search sec filings

### Example


```python
import sec_agent_sdk
from sec_agent_sdk.models.filing_table import FilingTable
from sec_agent_sdk.models.filing_v2 import FilingV2
from sec_agent_sdk.models.form_type import FormType
from sec_agent_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://c11yrich0c.execute-api.us-west-2.amazonaws.com
# See configuration.py for a list of all supported configuration parameters.
configuration = sec_agent_sdk.Configuration(
host = "https://c11yrich0c.execute-api.us-west-2.amazonaws.com"
)


# Enter a context with an instance of the API client
with sec_agent_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sec_agent_sdk.DefaultApi(api_client)
form_type = sec_agent_sdk.FormType() # FormType |
company = 'company_example' # str |
table = sec_agent_sdk.FilingTable() # FilingTable |
date_filed = 'date_filed_example' # str | (optional)

try:
# Search Filing V2
api_response = api_instance.search_filing_v2_v1_sec_filing_v2_get(form_type, company, table, date_filed=date_filed)
print("The response of DefaultApi->search_filing_v2_v1_sec_filing_v2_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DefaultApi->search_filing_v2_v1_sec_filing_v2_get: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**form_type** | [**FormType**](.md)| |
**company** | **str**| |
**table** | [**FilingTable**](.md)| |
**date_filed** | **str**| | [optional]

### Return type

[**FilingV2**](FilingV2.md)

### Authorization

No authorization required

### HTTP request headers

Expand All @@ -91,8 +230,6 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response | - |
**403** | Forbidden | - |
**404** | Not found | - |
**422** | Validation Error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
Expand Down
41 changes: 41 additions & 0 deletions docs/FilingV2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# FilingV2

FilingV2(*, company: str, cik: str, quarter: str, form_type: str, date_filed: datetime.date, url: str, table: str, parsed: str | None, accession_number: str, html_s3_url: str | None, image_s3_url: str | None, id: int = None)

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**company** | **str** | |
**cik** | **str** | |
**quarter** | **str** | |
**form_type** | **str** | |
**date_filed** | **date** | |
**url** | **str** | |
**table** | **str** | |
**parsed** | **str** | |
**accession_number** | **str** | |
**html_s3_url** | **str** | |
**image_s3_url** | **str** | |
**id** | **int** | | [optional]

## Example

```python
from sec_agent_sdk.models.filing_v2 import FilingV2

# TODO update the JSON string below
json = "{}"
# create an instance of FilingV2 from a JSON string
filing_v2_instance = FilingV2.from_json(json)
# print the JSON string representation of the object
print(FilingV2.to_json())

# convert the object into a dict
filing_v2_dict = filing_v2_instance.to_dict()
# create an instance of FilingV2 from a dict
filing_v2_from_dict = FilingV2.from_dict(filing_v2_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading

0 comments on commit 8519d12

Please sign in to comment.