Skip to main content

Unofficial and open source Python library for interacting with the Halbestunde API

Project description

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

Steps

  1. Clone the repository:

    git clone https://github.com/bravelab/halbestunde-python-client.git
    cd halbestunde-python-client
    
  2. 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:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature-branch)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add some feature')
  5. Push to the branch (git push origin feature-branch)
  6. 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.

Bravelab. Digital Commerce Solution For The Music Industry
Website | LinkdedIn | Let's talk
Crafted by https://www.bravelab.io

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

halbestunde_python_client-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

halbestunde_python_client-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file halbestunde_python_client-0.1.1.tar.gz.

File metadata

  • Download URL: halbestunde_python_client-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.18 Darwin/23.5.0

File hashes

Hashes for halbestunde_python_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 515d8865d051c04cd0069b63ca5676c7cf509b43bd2251f0b7048efb47c1e153
MD5 d788dd47af88f88250d6c2ec8f8fdd9a
BLAKE2b-256 2cda42c9e14eb634faf406be954e1c4c7b2fd417a74d3cdadd34fb311784e025

See more details on using hashes here.

File details

Details for the file halbestunde_python_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for halbestunde_python_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 271bd379d8940ddb59255090c9b6c9a28c78c5277fd808c44abbac8692fc3c42
MD5 545c66adc1ed9a53390a9fbc70673403
BLAKE2b-256 6794a3324fec3897e6c7b4fa7bb5afa5a1da7d5ad2bf33603eb427b8cb5116ec

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