Name | halbestunde-python-client JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | Unofficial and open source Python library for interacting with the Halbestunde API |
upload_time | 2024-07-31 23:31:25 |
maintainer | None |
docs_url | None |
author | Mariusz Smenżyk |
requires_python | <4.0,>=3.9 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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](https://python-poetry.org/)
### Steps
1. Clone the repository:
```bash
git clone https://github.com/bravelab/halbestunde-python-client.git
cd halbestunde-python-client
```
2. Install dependencies using Poetry:
```bash
poetry install
```
## Usage
### Initialize the Client
```python
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
```python
response = client.sign_in(email="your_email@example.com", password="your_password")
print(response)
```
#### Refresh Token
```python
response = client.refresh_token(refresh_token="your_refresh_token")
print(response)
```
#### Forgot Password
```python
response = client.forgot_password(email="your_email@example.com")
print(response)
```
#### Forgot Password Confirm
```python
response = client.forgot_password_confirm(email="your_email@example.com", password="new_password", code="confirmation_code")
print(response)
```
#### Find by Email
```python
response = client.find_by_email(email="your_email@example.com")
print(response)
```
### OMR (Optical Music Recognition)
#### Get Presigned Upload URL
```python
response = client.get_presigned_upload_url(filename="image.jpg")
print(response)
```
#### Recognize Presigned Uploaded File
```python
response = client.recognize_presigned_uploaded_file(filename="00281f59-66cc-4fb3-bd94-43bd83f9c3fa.jpg")
print(response)
```
#### Get Recognition Results
```python
response = client.get_recognition_results(inference_id="b4637410-65bc-44e8-9841-ea292c874615")
print(response)
```
#### Update Recognition Results
```python
response = client.update_recognition_results(filename="00281f59-66cc-4fb3-bd94-43bd83f9c3fa.pdf")
print(response)
```
#### Get Scans History List
```python
response = client.get_scans_history_list()
print(response)
```
## Running Tests
Tests are written using `pytest`. To run the tests, use the following command:
```bash
poetry run pytest
```
## More Examples
You can run some examples using `poetry`. To run scripts, use the following command:
```bash
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.
<div align="center">
Bravelab. Digital Commerce Solution For The Music Industry<br>
<a href="https://www.bravelab.io/">Website</a>
<span> | </span>
<a href="https://linkedin.com/company/bravelab.io">LinkdedIn</a><span> | </span>
<a href="mailto:office@bravelab.io">Let's talk</a><br>
Crafted by https://www.bravelab.io
</div>
Raw data
{
"_id": null,
"home_page": null,
"name": "halbestunde-python-client",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Mariusz Smen\u017cyk",
"author_email": "mariusz.smenzyk@bravelab.io",
"download_url": "https://files.pythonhosted.org/packages/2c/da/42c9e14eb634faf406be954e1c4c7b2fd417a74d3cdadd34fb311784e025/halbestunde_python_client-0.1.1.tar.gz",
"platform": null,
"description": "\n# halbestunde-python-client\n\n`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.\n\n## Features\n\n- **Authentication**: Sign in, refresh tokens, forgot password, and find user by email.\n- **OMR**: Get presigned upload URLs, recognize uploaded files, retrieve recognition results, update recognition results, and get scans history.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.9.x\n- [Poetry](https://python-poetry.org/)\n\n### Steps\n\n1. Clone the repository:\n ```bash\n git clone https://github.com/bravelab/halbestunde-python-client.git\n cd halbestunde-python-client\n ```\n\n2. Install dependencies using Poetry:\n ```bash\n poetry install\n ```\n\n## Usage\n\n### Initialize the Client\n\n```python\nfrom halbestunde_client.halbestunde_client import HalbestundeClient\n\nclient = HalbestundeClient(\n auth_base_url=\"https://omr.external.api.halbestunde.com/service-auth\",\n omr_base_url=\"https://omr.external.api.halbestunde.com/service-omr\",\n api_key=\"your_api_key_here\" # Use your actual API key\n)\n```\n\n### Authentication\n\n#### Sign In\n\n```python\nresponse = client.sign_in(email=\"your_email@example.com\", password=\"your_password\")\nprint(response)\n```\n\n#### Refresh Token\n\n```python\nresponse = client.refresh_token(refresh_token=\"your_refresh_token\")\nprint(response)\n```\n\n#### Forgot Password\n\n```python\nresponse = client.forgot_password(email=\"your_email@example.com\")\nprint(response)\n```\n\n#### Forgot Password Confirm\n\n```python\nresponse = client.forgot_password_confirm(email=\"your_email@example.com\", password=\"new_password\", code=\"confirmation_code\")\nprint(response)\n```\n\n#### Find by Email\n\n```python\nresponse = client.find_by_email(email=\"your_email@example.com\")\nprint(response)\n```\n\n### OMR (Optical Music Recognition)\n\n#### Get Presigned Upload URL\n\n```python\nresponse = client.get_presigned_upload_url(filename=\"image.jpg\")\nprint(response)\n```\n\n#### Recognize Presigned Uploaded File\n\n```python\nresponse = client.recognize_presigned_uploaded_file(filename=\"00281f59-66cc-4fb3-bd94-43bd83f9c3fa.jpg\")\nprint(response)\n```\n\n#### Get Recognition Results\n\n```python\nresponse = client.get_recognition_results(inference_id=\"b4637410-65bc-44e8-9841-ea292c874615\")\nprint(response)\n```\n\n#### Update Recognition Results\n\n```python\nresponse = client.update_recognition_results(filename=\"00281f59-66cc-4fb3-bd94-43bd83f9c3fa.pdf\")\nprint(response)\n```\n\n#### Get Scans History List\n\n```python\nresponse = client.get_scans_history_list()\nprint(response)\n```\n\n## Running Tests\n\nTests are written using `pytest`. To run the tests, use the following command:\n\n```bash\npoetry run pytest\n```\n\n## More Examples\n\nYou can run some examples using `poetry`. To run scripts, use the following command:\n\n```bash\npoetry run python examples/example_usage.py\n```\n\n## Code quality\n### Format the code using black\npoetry run black .\n\n### Auto-fix PEP 8 issues using autopep8\npoetry run autopep8 --in-place --recursive .\n\n### Check for any remaining issues with flake8\npoetry run flake8\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature-branch`)\n3. Make your changes\n4. Commit your changes (`git commit -m 'Add some feature'`)\n5. Push to the branch (`git push origin feature-branch`)\n6. Create a new Pull Request\n\nPlease ensure your code adheres to the project's coding standards and passes all tests.\n\n## License\n\nThis project is licensed under the MIT License.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n<div align=\"center\">\n Bravelab. Digital Commerce Solution For The Music Industry<br>\n <a href=\"https://www.bravelab.io/\">Website</a>\n <span> | </span>\n <a href=\"https://linkedin.com/company/bravelab.io\">LinkdedIn</a><span> | </span>\n <a href=\"mailto:office@bravelab.io\">Let's talk</a><br>\n Crafted by https://www.bravelab.io\n</div>\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Unofficial and open source Python library for interacting with the Halbestunde API",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6794a3324fec3897e6c7b4fa7bb5afa5a1da7d5ad2bf33603eb427b8cb5116ec",
"md5": "545c66adc1ed9a53390a9fbc70673403",
"sha256": "271bd379d8940ddb59255090c9b6c9a28c78c5277fd808c44abbac8692fc3c42"
},
"downloads": -1,
"filename": "halbestunde_python_client-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "545c66adc1ed9a53390a9fbc70673403",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 4269,
"upload_time": "2024-07-31T23:31:23",
"upload_time_iso_8601": "2024-07-31T23:31:23.869950Z",
"url": "https://files.pythonhosted.org/packages/67/94/a3324fec3897e6c7b4fa7bb5afa5a1da7d5ad2bf33603eb427b8cb5116ec/halbestunde_python_client-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2cda42c9e14eb634faf406be954e1c4c7b2fd417a74d3cdadd34fb311784e025",
"md5": "d788dd47af88f88250d6c2ec8f8fdd9a",
"sha256": "515d8865d051c04cd0069b63ca5676c7cf509b43bd2251f0b7048efb47c1e153"
},
"downloads": -1,
"filename": "halbestunde_python_client-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "d788dd47af88f88250d6c2ec8f8fdd9a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 3785,
"upload_time": "2024-07-31T23:31:25",
"upload_time_iso_8601": "2024-07-31T23:31:25.600762Z",
"url": "https://files.pythonhosted.org/packages/2c/da/42c9e14eb634faf406be954e1c4c7b2fd417a74d3cdadd34fb311784e025/halbestunde_python_client-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-31 23:31:25",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "halbestunde-python-client"
}