Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
"liblabVersion": "1.1.40",
"date": "2024-03-08T16:12:00.742Z",
"config": {
"authentication": {
"access": {
"prefix": "Bearer"
}
},
"deliveryType": "zip",
"languages": [
"python"
],
"inputFileName": "/tmp/resources/spec/open-api-spec.json",
"environmentVariables": [],
"fileOutput": "/tmp",
"tempDir": "/tmp/liblab-codegen-1.1.40-wCBJBm",
"inferServiceNames": false,
"httpLibrary": {
"name": "axios",
"packages": {
"axios": "^1.0.0"
},
"languages": [
"javascript",
"typescript"
]
},
"auth": [
"bearer"
],
"privateRepo": false,
"githubRef": "",
"baseUrl": "http://localhost:8080",
"sdkName": "Llamastore",
"sdkVersion": "0.0.3",
"retry": {
"enabled": true,
"maxAttempts": 3,
"retryDelay": 150
},
"customQueries": {
"paths": [],
"rawQueries": [],
"queriesData": []
},
"generateEnv": true,
"license": {
"type": "MIT",
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"alwaysInitializeOptionals": true,
"pypiPackageName": "LlamaStore",
"environments": [],
"reservedKeywords": {},
"deliveryMethods": [],
"bundle": false,
"exportClassDefault": false,
"responseHeaders": false,
"renameIllegalModelProperties": false,
"devContainer": true,
"strictVersion": false,
"authors": [],
"classifiers": [],
"projectUrls": {},
"homepage": "",
"enforceRequestValidation": false,
"denoteCommon": false,
"includeOptionalSnippetParameters": true,
"hooks": {
"enabled": true,
"sourceDir": "/tmp/resources/hooks"
},
"spec": {
"type": "openapi",
"version": "3.1"
},
"usesFormData": false
},
"files": [
".devcontainer/devcontainer.json",
".env.example",
".gitignore",
"LICENSE",
"README.md",
"examples/.env.example",
"examples/README.md",
"examples/install.cmd",
"examples/install.sh",
"examples/install_py3.sh",
"examples/sample.py",
"install.cmd",
"install.sh",
"pyproject.toml",
"requirements.txt",
"src/llamastore/README.md",
"src/llamastore/__init__.py",
"src/llamastore/hooks/__init__.py",
"src/llamastore/hooks/hook.py",
"src/llamastore/models/ApiToken.py",
"src/llamastore/models/CreateApiTokenRequest.py",
"src/llamastore/models/CreateLlamaRequest.py",
"src/llamastore/models/GetLlamasResponse.py",
"src/llamastore/models/Llama.py",
"src/llamastore/models/LlamaColor.py",
"src/llamastore/models/LlamaId.py",
"src/llamastore/models/README.md",
"src/llamastore/models/RegisterUserRequest.py",
"src/llamastore/models/UpdateLlamaRequest.py",
"src/llamastore/models/User.py",
"src/llamastore/models/__init__.py",
"src/llamastore/models/base.py",
"src/llamastore/net/__init__.py",
"src/llamastore/net/environment.py",
"src/llamastore/net/http_client.py",
"src/llamastore/net/http_content_types.py",
"src/llamastore/net/query_serializer.py",
"src/llamastore/net/utils.py",
"src/llamastore/sdk.py",
"src/llamastore/services/README.md",
"src/llamastore/services/__init__.py",
"src/llamastore/services/base.py",
"src/llamastore/services/llama.py",
"src/llamastore/services/llama_picture.py",
"src/llamastore/services/token.py",
"src/llamastore/services/user.py",
"src/llamastore/setup.py",
"test/__init__.py",
"test/models/__init__.py",
"test/models/test_api_token.py",
"test/models/test_base.py",
"test/models/test_create_api_token_request.py",
"test/models/test_create_llama_request.py",
"test/models/test_llama.py",
"test/models/test_llama_id.py",
"test/models/test_register_user_request.py",
"test/models/test_update_llama_request.py",
"test/models/test_user.py",
"test/services/__init__.py",
"test/services/test_base.py",
"test/services/test_llama.py",
"test/services/test_llama_picture.py",
"test/services/test_token.py",
"test/services/test_user.py"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023
Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Llamastore Python SDK 0.0.1
# Llamastore Python SDK 0.0.3
A Python SDK for Llamastore.

The llama store API! Get details on all your favorite llamas. ## To use this API - You will need to register a user, once done you can request an API token. - You can then use your API token to get details about the llamas. ## User registration To register a user, send a POST request to `/user` with the following body: ```json { email : <your email> , password : <your password> } ``` This API has a maximum of 1000 current users. Once this is exceeded, older users will be deleted. If your user is deleted, you will need to register again. ## Get an API token To get an API token, send a POST request to `/token` with the following body: ```json { email : <your email> , password : <your password> } ``` This will return a token that you can use to authenticate with the API: ```json { access_token : <your new token> , token_type : bearer } ``` ## Use the API token To use the API token, add it to the `Authorization` header of your request: ``` Authorization: Bearer <your token> ```

- API version: 0.0.1
- SDK version: 0.0.1
- API version: 0.0.3
- SDK version: 0.0.3

## Table of Contents
- [Requirements](#requirements)
Expand Down Expand Up @@ -58,7 +58,7 @@ sdk.llama.set_access_token('YOUR_BEARER_TOKEN')

## API Endpoint Services

All URIs are relative to http://localhost:8000.
All URIs are relative to http://localhost:8080.

Click the service name for a full list of the service methods.

Expand Down Expand Up @@ -204,7 +204,7 @@ from pprint import pprint
from llamastore import Llamastore
sdk = Llamastore()
sdk.set_access_token(getenv("LLAMASTORE_ACCESS_TOKEN"))
results = sdk.llama_picture.get_llama_picture_by_llama_id(llama_id = 2)
results = sdk.llama_picture.get_llama_picture_by_llama_id(llama_id = 1)

pprint(vars(results))

Expand Down Expand Up @@ -262,7 +262,7 @@ sdk.set_access_token(getenv("LLAMASTORE_ACCESS_TOKEN"))
request_body = {}
results = sdk.llama_picture.update_llama_picture(
request_input = request_body,
llama_id = 1
llama_id = 2
)

pprint(vars(results))
Expand All @@ -278,7 +278,7 @@ Create Llama
**Parameters**
| Name | Type| Required | Description |
| :-------- | :----------| :----------| :----------|
| request_input | [LlamaCreate](/src/llamastore/models/README.md#llamacreate) | Required | Request body. |
| request_input | [CreateLlamaRequest](/src/llamastore/models/README.md#createllamarequest) | Required | Request body. |

**Return Type**

Expand Down Expand Up @@ -377,7 +377,7 @@ from pprint import pprint
from llamastore import Llamastore
sdk = Llamastore()
sdk.set_access_token(getenv("LLAMASTORE_ACCESS_TOKEN"))
results = sdk.llama.delete_llama(llama_id = 1)
results = sdk.llama.delete_llama(llama_id = 2)

pprint(vars(results))

Expand All @@ -392,7 +392,7 @@ Update Llama
| Name | Type| Required | Description |
| :-------- | :----------| :----------| :----------|
| llama_id | int | Required | The llama's ID |
| request_input | [LlamaCreate](/src/llamastore/models/README.md#llamacreate) | Required | Request body. |
| request_input | [UpdateLlamaRequest](/src/llamastore/models/README.md#updatellamarequest) | Required | Request body. |

**Return Type**

Expand All @@ -413,7 +413,7 @@ request_body = {
}
results = sdk.llama.update_llama(
request_input = request_body,
llama_id = 2
llama_id = 1
)

pprint(vars(results))
Expand All @@ -429,7 +429,7 @@ Create Api Token
**Parameters**
| Name | Type| Required | Description |
| :-------- | :----------| :----------| :----------|
| request_input | [ApiTokenRequest](/src/llamastore/models/README.md#apitokenrequest) | Required | Request body. |
| request_input | [CreateApiTokenRequest](/src/llamastore/models/README.md#createapitokenrequest) | Required | Request body. |

**Return Type**

Expand Down Expand Up @@ -474,7 +474,7 @@ from pprint import pprint
from llamastore import Llamastore
sdk = Llamastore()
sdk.set_access_token(getenv("LLAMASTORE_ACCESS_TOKEN"))
results = sdk.user.get_user_by_email(email = 'tIAimCb@N.sUaR].pV')
results = sdk.user.get_user_by_email(email = '%7@sUUWSPLX.G,K)Q}7:4')

pprint(vars(results))

Expand All @@ -488,7 +488,7 @@ Register User
**Parameters**
| Name | Type| Required | Description |
| :-------- | :----------| :----------| :----------|
| request_input | [UserRegistration](/src/llamastore/models/README.md#userregistration) | Required | Request body. |
| request_input | [RegisterUserRequest](/src/llamastore/models/README.md#registeruserrequest) | Required | Request body. |

**Return Type**

Expand Down
1 change: 1 addition & 0 deletions examples/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LLAMASTORE_BEARER_TOKEN=
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A basic example of how to use the llamastore package.

If `llamastore` is published to pypi:
```sh
pip install llamastore==0.0.1
pip install llamastore==0.0.3
```

In the event `llamastore` is not published to pypi, you can install it locally by running the following command in the example folder:
Expand Down
5 changes: 5 additions & 0 deletions examples/install.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python -m venv .venv
call .venv\Scripts\activate
pip install build
python -m build --outdir dist ..\
pip install dist\llamastore-0.0.3-py3-none-any.whl --force-reinstall
2 changes: 1 addition & 1 deletion examples/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python -m venv .venv
source .venv/bin/activate
pip install build
python -m build --outdir dist ../
pip install dist/llamastore-0.0.1-py3-none-any.whl
pip install dist/llamastore-0.0.3-py3-none-any.whl --force-reinstall
2 changes: 1 addition & 1 deletion examples/install_py3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ python3 -m venv .venv
source .venv/bin/activate
pip3 install build
python3 -m build --outdir dist ../
pip3 install dist/llamastore-0.0.1-py3-none-any.whl
pip3 install dist/llamastore-0.0.3-py3-none-any.whl --force-reinstall
3 changes: 3 additions & 0 deletions install.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pip install -r requirements.txt
pip install -e src\llamastore\
python -m unittest discover -p "test*.py"
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ build-backend = "setuptools.build_meta"

[project]
name = "llamastore"
version = "0.0.1"
version = "0.0.3"
license = { text = "MIT" }
description = """The llama store API! Get details on all your favorite llamas. ## To use this API - You will need to register a user, once done you can request an API token. - You can then use your API token to get details about the llamas. ## User registration To register a user, send a POST request to `/user` with the following body: ```json { email : <your email> , password : <your password> } ``` This API has a maximum of 1000 current users. Once this is exceeded, older users will be deleted. If your user is deleted, you will need to register again. ## Get an API token To get an API token, send a POST request to `/token` with the following body: ```json { email : <your email> , password : <your password> } ``` This will return a token that you can use to authenticate with the API: ```json { access_token : <your new token> , token_type : bearer } ``` ## Use the API token To use the API token, add it to the `Authorization` header of your request: ``` Authorization: Bearer <your token> ``` """
readme = "README.md"
requires-python = ">=3.7"
dependencies = [
"requests",
"http-exceptions",
"http-exceptions"
]

[project.optional-dependencies]
test = [
"pytest",
"responses"
]

Loading