halbestunde-python-client
halbestunde-python-client is an unofficial and open source Python library for interacting with the Halbestunde API. It provides methods for authentication, managing OMR (Optical Music Recognition) uploads, and retrieving recognition results.
Features
- Authentication: Sign in, refresh tokens, forgot password, and find user by email.
- OMR: Get presigned upload URLs, recognize uploaded files, retrieve recognition results, update recognition results, and get scans history.
Installation
Prerequisites
- Python 3.9.x
- Poetry
Steps
-
Clone the repository:
git clone https://github.com/bravelab/halbestunde-python-client.git cd halbestunde-python-client
-
Install dependencies using Poetry:
poetry install
Usage
Initialize the Client
from halbestunde_client.halbestunde_client import HalbestundeClient
client = HalbestundeClient(
auth_base_url="https://omr.external.api.halbestunde.com/service-auth",
omr_base_url="https://omr.external.api.halbestunde.com/service-omr",
api_key="your_api_key_here" # Use your actual API key
)
Authentication
Sign In
response = client.sign_in(email="your_email@example.com", password="your_password")
print(response)
Refresh Token
response = client.refresh_token(refresh_token="your_refresh_token")
print(response)
Forgot Password
response = client.forgot_password(email="your_email@example.com")
print(response)
Forgot Password Confirm
response = client.forgot_password_confirm(email="your_email@example.com", password="new_password", code="confirmation_code")
print(response)
Find by Email
response = client.find_by_email(email="your_email@example.com")
print(response)
OMR (Optical Music Recognition)
Get Presigned Upload URL
response = client.get_presigned_upload_url(filename="image.jpg")
print(response)
Recognize Presigned Uploaded File
response = client.recognize_presigned_uploaded_file(filename="00281f59-66cc-4fb3-bd94-43bd83f9c3fa.jpg")
print(response)
Get Recognition Results
response = client.get_recognition_results(inference_id="b4637410-65bc-44e8-9841-ea292c874615")
print(response)
Update Recognition Results
response = client.update_recognition_results(filename="00281f59-66cc-4fb3-bd94-43bd83f9c3fa.pdf")
print(response)
Get Scans History List
response = client.get_scans_history_list()
print(response)
Running Tests
Tests are written using pytest. To run the tests, use the following command:
poetry run pytest
More Examples
You can run some examples using poetry. To run scripts, use the following command:
poetry run python examples/example_usage.py
Code quality
Format the code using black
poetry run black .
Auto-fix PEP 8 issues using autopep8
poetry run autopep8 --in-place --recursive .
Check for any remaining issues with flake8
poetry run flake8
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Make your changes
- Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature-branch) - Create a new Pull Request
Please ensure your code adheres to the project's coding standards and passes all tests.
License
This project is licensed under the MIT License.
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.
Website | LinkdedIn | Let's talk
Crafted by https://www.bravelab.io
Metadata
Release files for halbestunde-python-client 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| halbestunde_python_client-0.1.1.tar.gz | 3.8 kB | Without provenance | Details for halbestunde_python_client-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| halbestunde_python_client-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for halbestunde_python_client-0.1.1-py3-none-any.whl |
Total release size: 8.1 kB
Release files / halbestunde_python_client-0.1.1.tar.gz
| Download URL | halbestunde_python_client-0.1.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
515d8865d051c04cd0069b63ca5676c7cf509b43bd2251f0b7048efb47c1e153
|
|
BLAKE2b-256 checksum How to use checksums |
2cda42c9e14eb634faf406be954e1c4c7b2fd417a74d3cdadd34fb311784e025
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.9.18 Darwin/23.5.0
|
Release files / halbestunde_python_client-0.1.1-py3-none-any.whl
| Download URL | halbestunde_python_client-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
271bd379d8940ddb59255090c9b6c9a28c78c5277fd808c44abbac8692fc3c42
|
|
BLAKE2b-256 checksum How to use checksums |
6794a3324fec3897e6c7b4fa7bb5afa5a1da7d5ad2bf33603eb427b8cb5116ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.9.18 Darwin/23.5.0
|
Security for halbestunde-python-client 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.