Re: [Imdbpy-help] Errors running the module

2016-11-13 Thread Davide Alberani
On Sun, Nov 6, 2016 at 3:53 PM, Mohamed Oun  wrote:
>
> Okay Davide, so I managed to get it to work by switching to Ubuntu and 
> ditching windows entirely, kind of unorthodox haha.

:-)
Glad at least this is working.

> So now I want to split the votes distribution column into 10 different 
> columns, one for each number. How do you think that could be done?

Hmmm... do you really need to do it in the database?
After all, you can read it and split it in python or any other programming
language.

Anyway, you can surely create a series of 10 new columns in the title tables,
to store the single digits, but also in this case you have to parse each value,
identify the movie_id, split the votes distribution (with the substring function
present in most SQL servers) and store them.
Not so simple to do, but should work.


-- 
Davide Alberani   [PGP KeyID: 0x465BFD47]
http://www.mimante.net/

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help


Re: [Imdbpy-help] Errors running the module

2016-11-01 Thread Davide Alberani
Hi Mohamed,
I don't like the WARNING messages at all, to be honest.
I hope to be able to test it soon, but I fear it could take me some time.

Your code is mostly correct, but there's an important thing to check:
are you sure that the first result of a query for "breaking bad"
contains the key "runtime"?
Usually, only the single episodes contain such key, not the series itself.

If in doubt, always use bb.get('runtime')


Hope this helps,



On Mon, Oct 24, 2016 at 6:33 AM, Mohamed Oun  wrote:

> Hello, so the memory error was solved by restarting the machine. And I
> built the database, however, I'm not sure it's complete, as when trying it
> I get a lot of errors.
> Here's my code:
>
> from imdb import IMDb
>
> ia = IMDb('sql', uri='mysql://root:@localhost/imdb')
>> s_result = ia.search_movie('breaking bad')
>>
>> # Retrieves default information for the first result (a Movie object).
>> bb = s_result[0]
>> ia.update(bb)
>> # Print some information.
>> print bb['runtime']
>> print bb['rating']
>
> And here's what's thrown at me:
>
>> 2016-10-24 06:30:23,743 WARNING [imdbpy.parser.sql.aux]
>> C:\Python27\lib\site-packages\imdb\parser\sql\__init__.py:458: Unable to
>> fetch information for movieID 3768839: The object Title by the ID 3768839
>> does not exist
>> 2016-10-24 06:30:23,744 WARNING [imdbpy.parser.sql.aux]
>> C:\Python27\lib\site-packages\imdb\parser\sql\__init__.py:458: Unable to
>> fetch information for movieID 2823261: The object Title by the ID 2823261
>> does not exist
>> 2016-10-24 06:30:23,744 WARNING [imdbpy.parser.sql.aux]
>> C:\Python27\lib\site-packages\imdb\parser\sql\__init__.py:458: Unable to
>> fetch information for movieID 2739602: The object Title by the ID 2739602
>> does not exist
>> 2016-10-24 06:30:23,744 WARNING [imdbpy.parser.sql.aux]
>> C:\Python27\lib\site-packages\imdb\parser\sql\__init__.py:458: Unable to
>> fetch information for movieID 3558248: The object Title by the ID 3558248
>> does not exist
>> 2016-10-24 06:30:23,744 WARNING [imdbpy.parser.sql.aux]
>> C:\Python27\lib\site-packages\imdb\parser\sql\__init__.py:458: Unable to
>> fetch information for movieID 2819137: The object Title by the ID 2819137
>> does not exist
>> 2016-10-24 06:30:23,746 WARNING [imdbpy.parser.sql.aux]
>> C:\Python27\lib\site-packages\imdb\parser\sql\__init__.py:458: Unable to
>> fetch information for movieID 2810071: The object Title by the ID 2810071
>> does not exist
>> 2016-10-24 06:30:23,746 WARNING [imdbpy.parser.sql.aux]
>> C:\Python27\lib\site-packages\imdb\parser\sql\__init__.py:458: Unable to
>> fetch information for movieID 0: The object Title by the ID 0 does not exist
>> Traceback (most recent call last):
>>   File "E:/Dropbox/Learning/untitled/untitled.py", line 14, in 
>> print bb['runtime']
>>   File "C:\Python27\lib\site-packages\imdb\utils.py", line 1469, in
>> __getitem__
>> rawData = self.data[key]
>> KeyError: 'runtimes'
>
> Does this mean a problem in the module, or in the database, or my code?
> --
> *Best Regards, *
> *Mohamed Oun*
>
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Imdbpy-help mailing list
> Imdbpy-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/imdbpy-help
>
>


-- 
Davide Alberani   [PGP KeyID: 0x465BFD47]
http://www.mimante.net/
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help