Skip to content

Commit

Permalink
chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
dguyen committed Feb 3, 2025
1 parent d9facb7 commit 8b180a9
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 40 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/sdk_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ permissions:
statuses: write
id-token: write
"on":
push:
branches:
- main
paths:
- .speakeasy/gen.lock
# push:
# branches:
# - main
# paths:
# - .speakeasy/gen.lock
workflow_dispatch: {}
jobs:
publish:
Expand Down
7 changes: 4 additions & 3 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ management:
docVersion: 0.0.0
speakeasyVersion: 1.481.1
generationVersion: 2.500.5
releaseVersion: 0.0.2
configChecksum: 0d454ea52b6c9682854374830aa48bb8
releaseVersion: 0.0.3
configChecksum: b3a1dd1e168b3d503d7ac5f3ce87b887
repoURL: https://github.com/documenso/sdk-python.git
installationURL: https://github.com/documenso/sdk-python.git
published: true
features:
python:
additionalDependencies: 1.0.0
Expand Down Expand Up @@ -1660,7 +1661,7 @@ examples:
application/json: {"documentId": 8574.78}
responses:
"200":
application/json: {"visibility": "MANAGER_AND_ABOVE", "status": "PENDING", "source": "TEMPLATE_DIRECT_LINK", "id": 627690, "externalId": "<id>", "userId": 4888.52, "authOptions": {"globalAccessAuth": "ACCOUNT", "globalActionAuth": "TWO_FACTOR_AUTH"}, "formValues": {"key": true, "key1": 6276.9, "key2": false}, "title": "<value>", "documentDataId": "<id>", "createdAt": "1734110098143", "updatedAt": "1737326276875", "completedAt": "<value>", "deletedAt": "<value>", "teamId": 311507, "templateId": 249440}
application/json: {"visibility": "MANAGER_AND_ABOVE", "status": "PENDING", "source": "TEMPLATE_DIRECT_LINK", "id": 627690, "externalId": "<id>", "userId": 4888.52, "authOptions": {"globalAccessAuth": "ACCOUNT", "globalActionAuth": "TWO_FACTOR_AUTH"}, "formValues": {"key": true, "key1": 6276.9, "key2": 5971.29}, "title": "<value>", "documentDataId": "<id>", "createdAt": "1734110098143", "updatedAt": "1737326276875", "completedAt": "<value>", "deletedAt": "<value>", "teamId": 311507, "templateId": 249440}
"400":
application/json: {"message": "Invalid input data", "code": "BAD_REQUEST", "issues": []}
"500":
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
python:
version: 0.0.2
version: 0.0.3
additionalDependencies:
dev: {}
main: {}
Expand Down
6 changes: 4 additions & 2 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ sources:
sourceBlobDigest: sha256:1660a3a61f026b73adb9b2fdddc49fcbf66b8534c3394b38a434cf857333a785
tags:
- latest
- speakeasy-sdk-regen-1738368732
targets:
documenso:
source: documenso-OAS
sourceNamespace: documenso-v-2-beta-api
sourceRevisionDigest: sha256:167083b8ead58f1af1e1e4d0ac8e36779a26c8d14d03982a3379af79c7a1910b
sourceBlobDigest: sha256:1660a3a61f026b73adb9b2fdddc49fcbf66b8534c3394b38a434cf857333a785
codeSamplesNamespace: documenso-oas-python-code-samples
codeSamplesRevisionDigest: sha256:ded89ad8f552a5e7308c646fb076b023dfa0dcd929dedcf9a6a9f1cb711a8cea
codeSamplesRevisionDigest: sha256:10641132a0afadd696699f72701a0b6ce2c0e656d8926bad9a6021043fda5e04
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand All @@ -28,6 +27,9 @@ workflow:
documenso:
target: python
source: documenso-OAS
publish:
pypi:
token: $pypi_token
codeSamples:
registry:
location: registry.speakeasyapi.dev/documenso-inc/api/documenso-oas-python-code-samples
Expand Down
138 changes: 112 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,40 @@

A SDK for seamless integration with Documenso v2 API.

The full Documenso API can be viewed here (**todo**), which includes examples.
The full Documenso API can be viewed [here](https://openapi.documenso.com/), which includes examples.

## ⚠️ Warning

Documenso v2 API and SDKs are currently in beta. There may be to breaking changes.

To keep updated, please follow the discussions here:

- [Feedback](https://github.com/documenso/documenso/discussions/1611)
- [Breaking change alerts](https://github.com/documenso/documenso/discussions/1612)
<!-- No Summary [summary] -->

## Table of Contents

<!-- $toc-max-depth=2 -->
* [Overview](#documenso-python-sdk)
* [SDK Installation](#sdk-installation)
* [IDE Support](#ide-support)
* [Authentication](#authentication)
* [Document creation example](#document-creation-example)
* [Available Resources and Operations](#available-resources-and-operations)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Debugging](#debugging)
* [Development](#development)
* [Maturity](#maturity)
* [Contributions](#contributions)

- [Overview](#documenso-python-sdk)
- [SDK Installation](#sdk-installation)
- [IDE Support](#ide-support)
- [Authentication](#authentication)
- [Document creation example](#document-creation-example)
- [Available Resources and Operations](#available-resources-and-operations)
- [Retries](#retries)
- [Error Handling](#error-handling)
- [Debugging](#debugging)
- [Development](#development)
- [Maturity](#maturity)
- [Contributions](#contributions)

<!-- No Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
## SDK Installation

> [!TIP]
> To finish publishing your SDK to PyPI you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).

> [!NOTE]
> **Python version upgrade policy**
>
Expand All @@ -60,15 +59,15 @@ The SDK can be installed with either *pip* or *poetry* package managers.
*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.

```bash
pip install git+https://github.com/documenso/sdk-python.git
pip install documenso_sdk
```

### Poetry

*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.

```bash
poetry add git+https://github.com/documenso/sdk-python.git
poetry add documenso_sdk
```

### Shell and script usage with `uv`
Expand Down Expand Up @@ -115,8 +114,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u

## Authentication

To use the SDK, you will need a Documenso API key which can be created [here](https://docs.documenso.com/developers/public-api/authentication#creating-an-api-key
).
To use the SDK, you will need a Documenso API key which can be created [here](https://docs.documenso.com/developers/public-api/authentication#creating-an-api-key).

```python
import documenso_sdk
Expand All @@ -127,6 +125,7 @@ with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
```

<!-- No Authentication [security] -->

## Document creation example
Expand All @@ -136,15 +135,102 @@ Currently creating a document involves two steps:
1. Create the document
2. Upload the PDF

This is a temporary measure, in the near future prior to the full release we will merge these two tasks into one request.
This is a temporary measure, in the near future prior to the full release we will merge these two tasks into one request.

Here is a full example of the document creation process which you can copy and run.

Note that the function is temporarily called `createV0`, which will be replaced by `create` once we resolve the 2 step workaround.
Note that the function is temporarily called `create_v0`, which will be replaced by `create` once we resolve the 2 step workaround.

```python
# Todo
from documenso_sdk import Documenso
import os
import requests

def upload_file_to_presigned_url(file_path: str, upload_url: str):
"""Upload a file to a pre-signed URL."""
with open(file_path, 'rb') as file:
file_content = file.read()

response = requests.put(
upload_url,
data=file_content,
headers={"Content-Type": "application/octet-stream"}
)

if not response.ok:
raise Exception(f"Upload failed with status: {response.status_code}")

async def main():
with Documenso(
# api_key=os.getenv("DOCUMENSO_API_KEY", ""),
api_key="api_d61fxqsynan9ftcb",
server_url="https://stg-app.documenso.com/api/v2-beta",
) as documenso:

# Create document with recipients and fields
create_document_response = documenso.documents.create_v0(
title="Document title",
recipients=[
{
"email": "example@documenso.com",
"name": "Example Doe",
"role": "SIGNER",
"fields": [
{
"type": "SIGNATURE",
"pageNumber": 1,
"pageX": 10,
"pageY": 10,
"width": 10,
"height": 10
},
{
"type": "INITIALS",
"pageNumber": 1,
"pageX": 20,
"pageY": 20,
"width": 10,
"height": 10
}
]
},
{
"email": "admin@documenso.com",
"name": "Admin Doe",
"role": "APPROVER",
"fields": [
{
"type": "SIGNATURE",
"pageNumber": 1,
"pageX": 10,
"pageY": 50,
"width": 10,
"height": 10
}
]
}
],
meta={
"timezone": "Australia/Melbourne",
"dateFormat": "MM/dd/yyyy hh:mm a",
"language": "de",
"subject": "Email subject",
"message": "Email message",
"emailSettings": {
"recipientRemoved": False
}
}
)

# Upload the PDF file
upload_file_to_presigned_url("./demo.pdf", create_document_response.upload_url)


if __name__ == "__main__":
import asyncio
asyncio.run(main())
```

<!-- No SDK Example Usage [usage] -->

<!-- Start Available Resources and Operations [operations] -->
Expand Down Expand Up @@ -376,7 +462,7 @@ looking for the latest version.

## Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=documenso-sdk&utm_campaign=python)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "documenso_sdk"
version = "0.0.2"
version = "0.0.3"
description = "Python Client SDK Generated by Speakeasy."
authors = [{ name = "Speakeasy" },]
readme = "README-PYPI.md"
Expand Down
4 changes: 2 additions & 2 deletions src/documenso_sdk/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import importlib.metadata

__title__: str = "documenso_sdk"
__version__: str = "0.0.2"
__version__: str = "0.0.3"
__openapi_doc_version__: str = "0.0.0"
__gen_version__: str = "2.500.5"
__user_agent__: str = "speakeasy-sdk/python 0.0.2 2.500.5 0.0.0 documenso_sdk"
__user_agent__: str = "speakeasy-sdk/python 0.0.3 2.500.5 0.0.0 documenso_sdk"

try:
if __package__ is not None:
Expand Down

0 comments on commit 8b180a9

Please sign in to comment.