This client was generated via the OpenAPI schema and is experimental, unsupported, and may not work at all!
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Python >= 3.6
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/nftstorage/python-client.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/nftstorage/python-client.git
)
Then import the package:
import nft_storage
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import nft_storage
Please follow the installation procedure and then run the following:
import time
import nft_storage
from pprint import pprint
from nft_storage.api import nft_storage_api
from nft_storage.model.check_response import CheckResponse
from nft_storage.model.delete_response import DeleteResponse
from nft_storage.model.error_response import ErrorResponse
from nft_storage.model.forbidden_error_response import ForbiddenErrorResponse
from nft_storage.model.get_response import GetResponse
from nft_storage.model.list_response import ListResponse
from nft_storage.model.unauthorized_error_response import UnauthorizedErrorResponse
from nft_storage.model.upload_response import UploadResponse
# Defining the host is optional and defaults to https://api.nft.storage
# See configuration.py for a list of all supported configuration parameters.
configuration = nft_storage.Configuration(
host = "https://api.nft.storage"
)
# Enter a context with an instance of the API client
with nft_storage.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = nft_storage_api.NFTStorageAPI(api_client)
cid = "bafkreidivzimqfqtoqxkrpge6bjyhlvxqs3rhe73owtmdulaxr5do5in7u" # str | CID for the NFT
try:
# Check if a CID of an NFT is being stored by nft.storage.
api_response = api_instance.check(cid)
pprint(api_response)
except nft_storage.ApiException as e:
print("Exception when calling NFTStorageAPI->check: %s\n" % e)
All URIs are relative to https://api.nft.storage
Class | Method | HTTP request | Description |
---|---|---|---|
NFTStorageAPI | check | GET /check/{cid} | Check if a CID of an NFT is being stored by nft.storage. |
NFTStorageAPI | delete | DELETE /{cid} | Stop storing the content with the passed CID |
NFTStorageAPI | list | GET / | List all stored files |
NFTStorageAPI | status | GET /{cid} | Get information for the stored file CID |
NFTStorageAPI | store | POST /upload | Store a file |
- CheckResponse
- CheckResponseValue
- Deal
- DeleteResponse
- ErrorResponse
- ErrorResponseError
- Files
- ForbiddenErrorResponse
- ForbiddenErrorResponseError
- GetResponse
- Links
- LinksFile
- ListResponse
- NFT
- Pin
- PinStatus
- UnauthorizedErrorResponse
- UnauthorizedErrorResponseError
- UploadResponse
- Type: Bearer authentication (JWT)
If the OpenAPI document is large, imports in nft_storage.apis and nft_storage.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
Solution 1: Use specific imports for apis and models like:
from nft_storage.api.default_api import DefaultApi
from nft_storage.model.pet import Pet
Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import nft_storage
from nft_storage.apis import *
from nft_storage.models import *