Jump to content

Python API Client


kingy444

Recommended Posts

kingy444

I have followed the instructions layed out here: https://dev.emby.media/home/sdk/apiclients/Python/README.html

I have also tried the pre-packed pip version: https://pypi.org/project/embyclient/

 

I cant seem to get either of these to work.

while i know embyclient is not supported here, i suspect given the automated nature the issue lays in the parent sdk library

from embyclient.EmbyClient.Python.activity_log_service_api import ActivityLogServiceApi
ModuleNotFoundError: No module named 'embyclient.EmbyClient'

 

I actually cant even get the SDK version to import because of the hyphen in its name

Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import embyclient-python
  File "<stdin>", line 1
    import embyclient-python

 

During packaging there were a couple of deprecated warnings but it seemed to complete and generate the folders fine

PS C:\Users\king\Downloads\Emby.SDK-master\SampleCode\RestApi\Clients\Python> python setup.py install --user
running install
C:\Users\king\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
C:\Users\king\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating embyclient_python.egg-info

 

I was wondering if the pre-packaged perhaps was not working because of the below (Essentially EmbyClient.Python can resolve to two different paths)

The embyclient (again by 3rd party) does not even have the EmbyClient folder. I dont think something is working as it should.

image.png.c4fc2aa2466785838cc313b01f5c5c42.pngimage.png.91f16ee19eed7219ab711ca854207850.pngimage.png.4dabca1f83995ebf6237a8da3faa5d43.png

Link to comment
Share on other sites

@kingy444Thanks for reporting. I'm not using Python frequently. Do you think that renaming embyclient-python to embyclient would fix all issues?

Link to comment
Share on other sites

kingy444

I just renamed all references to embyclient-python to embyclient_python and rebuilt - all seems to work fine. Cant see any reason embyclient would not work directly as well - not sure if using that name would conflict with pypi of the same name https://pypi.org/project/embyclient/

Ultimately it would be good if the emby teams own version was built and deployed to pypi in this manor (someone has setup an automated build and deploy job to do so from your current repo: https://github.com/nwithan8/embyclient_python/actions)

Link to comment
Share on other sites

nwithan8

Hello there, I'm the owner of that third-party repo and the `embyclient` package on PyPi. My setup was simply supposed to be a stopgap since I noticed that the API libraries weren't published to the traditional package managers (PyPi, NPM, NuGet, etc.). I'd be happy to work with the Emby team and hand over the `embyclient` name on PyPi to the official libraries.

Link to comment
Share on other sites

Hi,

thanks to both of you for getting back!

The simple reason why those libs aren't published to any package repos is that I didn't want to publish any non-working nonsense, which never makes a good appearance.
So I've just been waiting for any feedback from people using (or trying to use) it, in order to discuss the details of the client generation.

I have made a test generation by using emby_client for the package name and emby-client for the project name. I also removed the EmbyClient.Python parameter which seems to be for creating into a sub-namespace, which isn't actually needed, so the folder structure is much simplifiied now.

Can (two) you check out this package and see whether it's working and reasonably named now?

Publish.zip

 

Link to comment
Share on other sites

5 hours ago, kingy444 said:

Tested and all seems to be working for me

Excellent, thanks!

Link to comment
Share on other sites

  • 2 months later...
Beannsss
On 6/6/2024 at 11:56 AM, nwithan8 said:

Hello there, I'm the owner of that third-party repo and the `embyclient` package on PyPi. My setup was simply supposed to be a stopgap since I noticed that the API libraries weren't published to the traditional package managers (PyPi, NPM, NuGet, etc.). I'd be happy to work with the Emby team and hand over the `embyclient` name on PyPi to the official libraries.


This would be great, I maintain an anilist scrobbling script and I (incorrectly) have the client api just shoved into my repo. Would be great to get an official pip install from emby.

I might try using your pip install in the meantime.

Edited by Beannsss
Link to comment
Share on other sites

On 6/6/2024 at 5:56 PM, nwithan8 said:

Hello there, I'm the owner of that third-party repo and the `embyclient` package on PyPi. My setup was simply supposed to be a stopgap since I noticed that the API libraries weren't published to the traditional package managers (PyPi, NPM, NuGet, etc.). I'd be happy to work with the Emby team and hand over the `embyclient` name on PyPi to the official libraries.

@nwithan8 - would you be available next week for doing the handover?

Link to comment
Share on other sites

nwithan8
11 hours ago, softworkz said:

@nwithan8 - would you be available next week for doing the handover?

Yes, let's connect.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...