Skip to main content

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

pip install encore-python

From repository

git clone https://github.com/joshrmcdaniel/encore-python.git
cd encore-python
pip install -e .

Usage

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

from encore_python import EncoreAPI

api = EncoreAPI()

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

For more complex queries involving multiple criteria:

# 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:

# 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

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

See sng-format-python 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.

Metadata

Release files for encore-python 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for encore-python 1.1.0
File Interpreter ABI Platform Actions
encore_python-1.1.0-py3-none-any.whl Python 3 none any Details for encore_python-1.1.0-py3-none-any.whl

Release files / encore_python-1.1.0-py3-none-any.whl

Download URL encore_python-1.1.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfc48f402e116d16a2da2b26cd3ad8c2d1b6ce390f1a4cc33d195ec192f55ae6
BLAKE2b-256 checksum
How to use checksums
b122a0486bb28aa846388ee7cd88a871701979c1a1c1c0429d943f7b122f4d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.6 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.64.1 urllib3/1.26.16 CPython/3.10.12

Security for encore-python 1.1.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page