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.
- 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.
- Python 3.9.x
- Poetry
-
Clone the repository:
git clone https://github.com/musictechlab/mtl-halbestunde-python-client.git cd halbestunde-python-client -
Install dependencies using Poetry:
poetry install
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
)response = client.sign_in(email="your_email@example.com", password="your_password")
print(response)response = client.refresh_token(refresh_token="your_refresh_token")
print(response)response = client.forgot_password(email="your_email@example.com")
print(response)response = client.forgot_password_confirm(email="your_email@example.com", password="new_password", code="confirmation_code")
print(response)response = client.find_by_email(email="your_email@example.com")
print(response)response = client.get_presigned_upload_url(filename="image.jpg")
print(response)response = client.recognize_presigned_uploaded_file(filename="00281f59-66cc-4fb3-bd94-43bd83f9c3fa.jpg")
print(response)response = client.get_recognition_results(inference_id="b4637410-65bc-44e8-9841-ea292c874615")
print(response)response = client.update_recognition_results(filename="00281f59-66cc-4fb3-bd94-43bd83f9c3fa.pdf")
print(response)response = client.get_scans_history_list()
print(response)Tests are written using pytest. To run the tests, use the following command:
poetry run pytestYou can run some examples using poetry. To run scripts, use the following command:
poetry run python examples/example_usage.pypoetry run black .
poetry run autopep8 --in-place --recursive .
poetry run flake8
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.
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 musictechlab.io