Metadata-Version: 2.1
Name: encore_python
Version: 1.1.0
Summary: Python API wrapper for encore.us
Author-email: Josh Mcdaniel <80354972+joshrmcdaniel@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2024 Josh Mcdaniel
        
        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.
        
Project-URL: homepage, https://github.com/joshrmcdaniel/encore-python
Keywords: sng,.sng,clone hero,ch,file,sng-format,sng-parse
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: jsonobject
Requires-Dist: sng-parser ==1.1.0

# encore-python
Python API wrapper for encore.us

## Features

- **Music Search**: Perform searches by track name, album, artist, genre, and year with both basic and advanced filtering options.
- **Download Tracks**: Download music tracks directly using the song identifier or a `Song` object.
- **Rate Limit Handling**: Automatically handles API rate limits, providing feedback on the remaining number of queries and reset times.
- **Flexible Search Queries**: Supports both simple string queries and structured search objects (`BasicSearch` and `AdvancedSearch`).

## Instalation
###  From pip
``` shell
pip install encore-python
```

###  From repository
``` shell
git clone https://github.com/joshrmcdaniel/encore-python.git
cd encore-python
pip install -e .
```

## Usage

### Basic Search

To perform a basic search by track name, album, artist, genre, or year:

```python
from encore_python import EncoreAPI

api = EncoreAPI()

# Basic search by track name
response = api.search("Track Name")
```

### Advanced Search

For more complex queries involving multiple criteria:

```python
# Advanced search by artist with additional filters
response = api.search_by_artist("Artist Name", exact=True)
```
### Iterating search results
The ability to iterate through all results is avaiable with the `iter_results` arg

### Downloading Tracks
Downloading tracks is available. Available options include: sng file, convert from the sng format to the directory format, and returning a buffer. 


To download a track:

```python
# With the hash as a sng file
api.download("abcedf....")
# With the song json
search_res = api.search("Jeff")
song = search_res.data[0]
api.download(song)
```
This will download a track into the current working directory with the filename of the download hash, with `.sng`

Downloading a track and converting it

``` python
search_res = api.search("Jeff")
song = search_res.data[0]
api.download(song, as_sng=False)
```

See [sng-format-python](https://github.com/joshrmcdaniel/sng-format-python/blob/v1.1.0/README.md#usage) docs for other sng conversion args.

## Contributing

Contributions to the encore-python are welcome.

## License

encore-python is released under the MIT License. See the LICENSE file in the repository for more details.

