Skip to main content

No project description provided

Project description

Openapi SDK for Python

Openapi® client for Python

The perfect starting point to integrate Openapi® within your Python project

Build PyPI Version Python Versions License Downloads
Linux Foundation Member

Overview

A minimal and agnostic Python SDK for Openapi, inspired by a clean client implementation. This SDK provides only the core HTTP primitives needed to interact with any Openapi service.

Pre-requisites

Before using the Openapi Python Client, you will need an account at Openapi and an API key to the sandbox and/or production environment

Features

  • Agnostic Design: No API-specific classes, works with any OpenAPI service
  • Minimal Dependencies: Only requires Python 3.8+ and requests
  • OAuth Support: Built-in OAuth client for token management
  • HTTP Primitives: GET, POST, PUT, DELETE, PATCH methods
  • Clean Interface: Similar to the Rust SDK design

What you can do

With the Openapi Python Client, you can easily interact with a variety of services in the Openapi Marketplace. For example, you can:

  • 📩 Send SMS messages with delivery reports and custom sender IDs
  • 💸 Process bills and payments in real time via API
  • 🧾 Send electronic invoices securely to the Italian Revenue Agency
  • 📄 Generate PDFs from HTML content, including JavaScript rendering
  • ✉️ Manage certified emails and legal communications via Italian Legalmail

For a complete list of all available services, check out the Openapi Marketplace 🌐

OpenApi IT Python Client

This client is used to interact with the API found at openapi.it

Pre-requisites

Before using the OpenApi IT Python Client, you will need an account at openapi.it and an API key to the sandbox and/or production environment

Installation

You can install the OpenApi IT Python Client with the following command using go get:

pip install openapi-python-sdk

Usage

from openapi_python_sdk.client import Client, OauthClient

# Initialize the oauth client on the sandbox environment
oauth_client = OauthClient(
    username="<your_username>", apikey="<your_apikey>", test=True
)

# Create a token for a list of scopes
resp = oauth_client.create_token(
    scopes=[
        "GET:test.imprese.openapi.it/advance",
        "POST:test.postontarget.com/fields/country",
    ],
    ttl=3600,
)
token = resp["token"]

# Initialize the client
client = Client(token=token)

# Make a request with params
resp = client.request(
    method="GET",
    url="https://test.imprese.openapi.it/advance",
    params={"denominazione": "altravia", "provincia": "RM", "codice_ateco": "6201"},
)

# Make a request with a payload
resp = client.request(
    method="POST",
    url="https://test.postontarget.com/fields/country",
    payload={"limit": 0, "query": { "country_code": "IT"}}
)

# Delete the token
resp = oauth_client.delete_token(id=token)

Contributing

Contributions are always welcome! Whether you want to report bugs, suggest new features, improve documentation, or contribute code, your help is appreciated.

See docs/contributing.md for detailed instructions on how to get started. Please make sure to follow this project's docs/code-of-conduct.md to help maintain a welcoming and collaborative environment.

Authors

Meet the project authors:

Partners

Meet our partners using Openapi or contributing to this SDK:

Our Commitments

We believe in open source and we act on that belief. We became Silver Members of the Linux Foundation because we wanted to formally support the ecosystem we build on every day. Open standards, open collaboration, and open governance are part of how we work and how we think about software.

License

This project is licensed under the MIT License.

The MIT License is a permissive open-source license that allows you to freely use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the original copyright notice and this permission notice are included in all copies or substantial portions of the software.

In short, you are free to use this SDK in your personal, academic, or commercial projects, with minimal restrictions. The project is provided "as-is", without any warranty of any kind, either expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.

For more details, see the full license text at the MIT License page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openapi_python_sdk-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openapi_python_sdk-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file openapi_python_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: openapi_python_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.8.0-106-generic

File hashes

Hashes for openapi_python_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c5238cf5194e5b67506a16e08948a3736fbb715a02c2560d98be49507154e6d
MD5 ff5d4c0809b4afa2c9cf931d2ec2c898
BLAKE2b-256 1728fd0647ba4dc25a75160f00ff5e98db88f76fab8d8b6d6a298605484032bf

See more details on using hashes here.

File details

Details for the file openapi_python_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: openapi_python_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.8.0-106-generic

File hashes

Hashes for openapi_python_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0560c0c65eb3c2c9e85eed395559cd70396e90c4a935fa61dd2ca143ace5b452
MD5 fded22a7da6ef2736854b3d1a70e9abc
BLAKE2b-256 6c18c0507d6f79d44fd971d9a144e9f10825540d25a0532cd7110efbbb7f617b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page