Metadata-Version: 2.1
Name: api-client-generator
Version: 0.1.0
Summary: Automatically generate Python API clients from OpenAPI specifications
Author-email: Brij Kishore Pandey <brij.pydata@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Brij kishore Pandey
        
        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.
        
Project-URL: Homepage, https://github.com/yourusername/api-client-generator
Project-URL: Bug Tracker, https://github.com/yourusername/api-client-generator/issues
Keywords: api,client,generator,openapi,swagger
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.26.0
Requires-Dist: aiohttp<4.0.0,>=3.7.4
Requires-Dist: jinja2>=3.0.1
Requires-Dist: pyyaml>=6.0
Requires-Dist: jsonschema>=4.4.0

# API Client Generator

Automatically generate Python API clients from OpenAPI 3.1.0 specifications.

## Author
Brij Kishore Pandey
Linkedin - https://www.linkedin.com/in/brijpandeyji/
GitHub: honestsoul

## Features and Capabilities

- Parses OpenAPI 3.1.0 specifications
- Generates Python client code with type hints
- Supports various authentication methods (API Key, OAuth2, OpenID Connect)
- Implements rate limiting to respect API constraints
- Provides asynchronous support for efficient concurrent requests
- Includes mock response generation for testing
- Offers a simple caching mechanism to optimize API requests
- Supports JSON Schema Draft 2020-12 for improved data validation

## Supported HTTP Methods

Our API Client Generator supports the following HTTP methods:

1. GET
2. POST
3. PUT
4. DELETE
5. PATCH
6. OPTIONS
7. HEAD
8. TRACE

## Supported Authentication Methods

We currently support the following authentication methods:

1. API Key (in header or query parameter)
2. OAuth 2.0 (Client Credentials flow)
3. OpenID Connect (Client Credentials flow with JWT validation)

## Installation

You can install the API Client Generator using pip:

```bash
pip install api-client-generator
```

## Quick Start

Here's a quick example of how to use the API Client Generator:

```python
from api_client_generator import OpenAPI310Parser, ClientGenerator, AuthHandler

# Parse the OpenAPI 3.1.0 spec
parser = OpenAPI310Parser('https://api.example.com/openapi.json')
parsed_spec = parser.parse()

# Generate the client
generator = ClientGenerator(parsed_spec)
generator.write_client('generated_client')

# Set up authentication
auth_handler = AuthHandler(parsed_spec['security_schemes'])
auth_handler.setup_auth('oauth2', client_id='your-client-id', client_secret='your-client-secret')

# Use the generated client
from generated_client.client import ExampleAPIClient

client = ExampleAPIClient('https://api.example.com', auth_handler)
response = client.get_user(user_id=123)
print(response)
```

## Limitations

1. OpenAPI Support:
   - Primarily supports OpenAPI 3.1.0 specifications
   - May have limited backwards compatibility with OpenAPI 3.0.x and Swagger 2.0

2. Authentication:
   - Supports API Key, OAuth2, and OpenID Connect
   - Complex authentication flows may require additional implementation

3. Rate Limiting:
   - Implements a simple rate limiting mechanism
   - May not cover all complex rate limiting scenarios

4. Asynchronous Support:
   - Basic async support provided
   - May not cover all edge cases in asynchronous operations

5. Generated Code:
   - Generated code may require manual tweaking for complex APIs
   - Does not generate comprehensive documentation for the generated client

6. Testing:
   - Provides basic mock response generation
   - Does not generate comprehensive test suites

7. Caching:
   - Implements a simple in-memory caching mechanism
   - Does not support distributed caching or persistence

8. Error Handling:
   - Basic error handling is implemented
   - May not cover all possible API-specific error scenarios

9. Customization:
   - Limited options for customizing the generated client code
   - May require manual intervention for highly specific requirements

10. API Types:
    - Primarily designed for RESTful APIs
    - Does not support GraphQL or other API paradigms

11. Language Support:
    - Generates Python code only
    - Does not support other programming languages

12. Dependencies:
    - Relies on external libraries (see requirements.txt)
    - May need updates as dependencies evolve

## Future Plans

We are committed to improving and expanding the API Client Generator. Here are some of our plans for future development:

1. Enhanced OAuth 2.0 support:
   - Add support for Authorization Code flow
   - Implement Refresh Token handling

2. Expanded OpenID Connect capabilities:
   - Support for additional flows (e.g., Authorization Code flow with PKCE)
   - Enhanced ID token validation and claims verification

3. Additional authentication methods:
   - Basic Authentication
   - Digest Authentication
   - JWT Authentication

4. Improved code generation:
   - More customization options for generated code
   - Support for generating async clients using `asyncio` and `aiohttp`

5. Extended OpenAPI support:
   - Full support for all OpenAPI 3.1.0 features
   - Backwards compatibility with OpenAPI 3.0.x and Swagger 2.0

6. Enhanced testing capabilities:
   - Generate more comprehensive test suites for the API clients
   - Improved mock server functionality

7. Documentation improvements:
   - Automatic generation of client library documentation
   - Interactive API playground generation

8. Performance optimizations:
   - Improved caching mechanisms
   - Connection pooling and request batching

9. Support for additional API paradigms:
   - GraphQL support
   - gRPC support

10. Multi-language support:
    - Extend code generation to other popular languages (e.g., JavaScript, Java, Go)
   

## Compatibility

This package is compatible with Python 3.9 and 3.10. 

**Note:** There are currently known issues with Python 3.11 due to compatibility problems with some dependencies. We are working on resolving these issues and hope to support Python 3.11 in a future release.

[Rest of your README content]

We welcome contributions and suggestions for additional features or improvements!

## Documentation

For more detailed information about the API Client Generator, please refer to our [documentation](link-to-your-documentation).

## Contributing

We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

If you encounter any problems or have any questions, please open an issue on our [GitHub issue tracker](https://github.com/yourusername/api-client-generator/issues).
