Try 30 days of free premium.

I created a basic Python interface for the API

srob650 wrote 8 years ago: 1

pytvmaze

GitHub

PyPi

I will try to keep it updated if/when I notice API changes. Aside from providing functions for all of the endpoints, I've created Show and Episode classes. With this you can easily and pythonically get show data, a list of all episodes and their data, or get a specific episode and its data given the season and episode number. Hope this helps some people!

srob650 wrote 8 years ago: 1

Update: Now available via pip! Simply use: pip install pytvmaze


Jan wrote 8 years ago: 1

Hi srob650,

Great job, thanks for your help expanding the availability of the API
You should follow your own thread here to make sure you get notified when users have questions.

I look forward seeing the projects that make use of this.

cheers,

Jan

srob650 wrote 8 years ago: 1

Jan wrote:
Hi srob650,
Great job, thanks for your help expanding the availability of the API
You should follow your own thread here to make sure you get notified when users have questions.
I look forward seeing the projects that make use of this.

cheers,
Jan

Thanks Jan! I am following this thread indeed. PyPI reports that it has been dowloaded 168 times already, so looks like projects will be underway!

srob650 wrote 8 years ago: 1

UPDATE: Added the new episode_by_number and episodes_by_date API endpoints. To install/upgrade use:

pip install --upgrade pytvmaze


david wrote 8 years ago: 1

That was a pretty quick update, nice! :)

srob650 wrote 8 years ago: 1

david wrote:
That was a pretty quick update, nice! :)

Since your endpoints are so clean and easy to work with :) Only took 6 lines of code. Keep up the awesome work!

srob650 wrote 8 years ago: 1

UPDATE: Python show object now uses embedded episodes so that it only makes one tvmaze API call to get show info + episodes list. To install/upgrade use:

pip install --upgrade pytvmaze

srob650 wrote 8 years ago: 1

UPDATE: Added Python 3 support. To install/upgrade use:

pip install --upgrade pytvmaze

srob650 wrote 8 years ago: 1

UPDATE: Added new "akas" endpoint. Embedding akas already automatically works with any endpoint that supports embedding. To install/upgrade use:

pip install --upgrade pytvmaze

srob650 wrote 8 years ago: 1

MAJOR UPDATE: Version 1.1.0:

- More specific error messages

- Major file re-structuring of the API

- Added fuzzy search matching to help with shows that have the same name. See the readme on the GitHub page for an example of how this works.

---------

To install/upgrade, use:

pip install --upgrade pytvmaze

srob650 wrote 8 years ago: 1

UPDATE: Version 1.1.3

- Handle edge cases where fuzzymatch was returning incorrect shows

---------

To install/upgrade, use:

pip install --upgrade pytvmaze

srob650 wrote 8 years ago: 1

UPDATE: Version 1.2.0

- Easier iteration over Season() and Episode() objects directly from the Show() object (more info on this in the readme on GitHub)

---------

To install/upgrade, use:

pip install --upgrade pytvmaze

liiight wrote 8 years ago: 1

@srob650 i guess this is a good place to talk to you as any other :)

Before I submit another PR, I find it kinda weird that some show search result in data and other in show object. Why is that?
I want to get Show object via tvdb_id or tvrage_id, and currently I have to run that lookup, retreive maze_id and then use it in get_shows.

Also, I don't think using 'print' in a library is a good idea. I pushed a PR to use custom exceptions, but fuzzysearch still has some print. You should consider logging instead.

srob650 wrote 8 years ago: 1

Hey liiight,

Firstly, thanks for your contributions so far!

Let me give you some of my story to help you understand where pytvmaze is at right now. I am a 100% self-taught programmer as a hobby only, my day job has absolutely nothing to do with programming. I really love it, and have been teaching myself for the past 3 years or so, but without a formal education there's definitely many things you may think are basic that I just simply haven't had exposure to, and there are definitely advanced programming concepts that I don't understand. That is partially why I wanted to make the pytvmaze project open source on GitHub, so that A) others could benefit from it and B) hopefully better programmers than me can help me out and I can learn from them! This is the first programming project I've done that isn't just for me, so you are witnessing my baby-steps really :)

As far as your direct questions go, I did struggle in the beginning with wondering how much of the data should be able to create objects, and part of that is simply because my own personal use case doesn't require more than is currently there (another reason open source is good, to help me see outside my own needs). I have always had it in the back of my head that I would make Person objects at some point but haven't gotten there yet, but I like the idea of the tvrage and tvdb id's creating objects automatically.

For printing, I honestly just didn't know that printing is bad practice in a library, so thank you for your PR with the Exceptions module, custom exceptions and logging are two subjects where I have zero experience and I didn't want to attempt them and fail in a public library where it could screw other peoples projects up :)

Going forward, as I think I've already shown, I'm super open to suggestions, feedback, and your own additions to make things better for everyone. If you feel inspired to help me out with the logging aspect as a print replacement that would be awesome, and I can definitely handle the easier object creation via tvdb/rage id's and creating a Person class. If you don't have time don't worry about it, either I will eventually learn that stuff or someone else will come in and help out, gotta love GitHub!

liiight wrote 8 years ago: 1

all good dude, I'll continue our conversation in github. Sorry for the super short reply, I'm a little busy today, but just wanted to let you know I read it all.

Talk to you soon

srob650 wrote 8 years ago: 1

No worries, sorry for the super LONG reply, hah.

srob650 wrote 8 years ago: 1

Major update: Version 1.3.0

- Python API officially stable

- Added custom exceptions (thanks to @liiight)

- Updated get_show() method to require specific parameters instead of a loose string

- Changed the way matching with qualifiers works

- See readme on GitHub

---------

To install/upgrade, use:

pip install --upgrade pytvmaze


MichaelDeBoey wrote 8 years ago: 1

srob650 wrote:
Major update: Version 1.3.0
- Python API officially stable
- Added custom exceptions (thanks to @liiight)
- Updated get_show() method to require specific parameters instead of a loose string
- Changed the way matching with qualifiers works
- See readme on GitHub
---------
To install/upgrade, use:
pip install --upgrade pytvmaze

You're doing great :-)

I'd like to contact you, but GitHub removed the private messaging :/
Is it possible in any way? Facebook? mail? ...?

srob650 wrote 8 years ago: 1

MichaelDeBoey wrote:
You're doing great :-)
I'd like to contact you, but GitHub removed the private messaging :/
Is it possible in any way? Facebook? mail? ...?

Thanks! No pm's here either I guess, you could pm me on reddit at the same name

Try 30 days of free premium.