generated from BastiTee/python-boilerplate
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
259 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
is_prime_time,is_prime_space,is_most_proposed,freq,airing_time_hour,title,genres,mean_row,mean_col,median_row,media_col,count | ||
False,False,False,0.008770245182766789,7,Equinox,Drama+Fantasy+Mystery+Thriller,4.275280898876405,4.044943820224719,4.0,4.0,178 | ||
False,False,False,0.0003200819409768901,11,Quicksand,Drama,18.833333333333332,6.366666666666666,16.5,3.0,30 | ||
False,False,False,0.00019204916458613405,13,World's Most Wanted,Documentary+Crime,4.475409836065574,7.060109289617486,3,5,183 | ||
False,False,False,0.00012803277639075603,15,No Gogó do Paulinho,Comedy,6.981132075471698,5.773584905660377,6,5,53 | ||
False,False,False,0.00019204916458613405,4,Who Killed Little Gregory?,Documentary+Crime,8.51063829787234,6.035460992907802,5,4,141 | ||
False,False,False,0.0008322130465399142,7,Mank,Biography+Comedy+Drama,5.504065040650406,6.959349593495935,5,4,123 | ||
False,False,False,0.0005761474937584022,5,Mowgli: Legend of the Jungle,Adventure+Drama+Fantasy,10.33673469387755,7.959183673469388,7.5,5.0,98 | ||
False,False,False,0.008898277959157545,9,The Midnight Sky,Drama+Fantasy+Sci-Fi+Thriller,5.123505976095617,2.3446215139442232,4.0,2.0,502 | ||
True,False,False,0.00025606555278151206,19,The Woods,Crime+Drama+Mystery+Thriller,5.431972789115647,4.329931972789115,4.0,4.0,294 | ||
False,False,False,0.014275654567569298,3,Tiny Pretty Things,Drama+Mystery+Thriller,4.34720908230842,3.975402081362346,4,4,1057 | ||
False,False,False,0.0015363933166890724,0,Elite,Crime+Drama+Thriller,6.655765920826162,5.981067125645439,6,4,581 | ||
False,False,False,0.012099097368926445,8,Cobra Kai,Action+Comedy+Drama+Sport,5.509635974304069,4.173447537473233,4.0,3.0,934 | ||
False,False,False,0.0016644260930798285,4,Sex Education,Comedy+Drama,7.865561694290976,6.867403314917127,7,5,543 | ||
False,False,False,0.0009602458229306702,14,Big Mouth,Animation+Comedy+Romance,6.944915254237288,4.262711864406779,5.0,4.0,472 | ||
False,False,False,0.0003840983291722681,12,Young Wallander,Crime+Drama+Mystery+Thriller,5.3628318584070795,7.300884955752212,4.0,4.0,226 | ||
False,False,False,0.0003840983291722681,17,Ragnarok,Drama+Fantasy,12.970588235294118,5.352941176470588,9.0,2.0,102 | ||
False,False,False,0.0014723769284936943,8,Mosul,Action+Drama+War,4.087947882736156,3.550488599348534,3,3,307 | ||
False,False,False,0.0006401638819537802,1,The Rain,Sci-Fi+Thriller,6.893305439330544,4.864016736401673,4.0,3.0,478 | ||
False,False,False,0.00012803277639075603,4,How to Sell Drugs Online (Fast),Comedy+Crime+Drama+Romance,7.2076502732240435,3.9644808743169397,5.0,3.0,366 | ||
False,False,False,0.0008962294347352923,11,Baby,Short+Drama,6.407960199004975,7.437810945273632,4,4,201 | ||
False,False,False,0.00044811471736764613,17,Top Boy,Crime+Drama+Thriller,9.069620253164556,5.284810126582278,7.0,5.0,158 | ||
False,False,False,0.0003840983291722681,18,Don't Listen,Horror+Thriller,5.047169811320755,5.235849056603773,4.0,4.0,106 | ||
False,False,False,0.00044811471736764613,17,The English Game,Drama+History+Sport,12.145348837209303,6.255813953488372,9.0,3.0,172 | ||
True,False,False,0.0008322130465399142,23,Suburra: Blood on Rome,Action+Crime,7.59144893111639,7.104513064133017,6,5,421 | ||
False,False,False,0.0014723769284936943,0,Barbarians,Action+Adventure+Drama+History,5.105732484076433,3.0063694267515926,4,2,785 | ||
False,False,False,0.00044811471736764613,7,The Valhalla Murders,Crime+Drama+Mystery+Thriller,16,6.423076923076923,14.5,4.0,52 | ||
False,True,False,0.026310735548300365,11,Bridgerton,Drama+Romance,3.855252918287938,1.332295719844358,4,1,1285 | ||
False,False,False,0.0029447538569873886,15,Cable Girls,Drama,5.551229508196721,3.9453551912568305,5.0,3.0,1464 | ||
True,False,False,0.00025606555278151206,19,High Seas,Crime+Drama+Mystery,14.829113924050633,8.227848101265822,9.0,4.0,158 | ||
True,False,False,0.0017924588694705845,19,Ma Rainey's Black Bottom,Drama+Music,4.298507462686567,6.149253731343284,4,5,67 | ||
True,False,False,0.004929261891044107,21,Rose Island,Adventure+Comedy+Drama,4.716666666666667,4.088095238095238,3.0,3.0,420 | ||
False,False,False,0.003008770245182767,7,Sweet Home,Drama+Fantasy+Horror+Thriller,4.252964426877471,2.5573122529644268,4,2,253 | ||
False,False,False,0.00025606555278151206,14,Vampires,Drama+Fantasy+Horror,8.941176470588236,2.0588235294117645,4,2,17 | ||
False,False,False,0.0010242622111260482,13,The Prom,Comedy+Drama+Musical,8.537313432835822,6.992537313432836,5.0,4.0,134 | ||
False,False,False,6.401638819537802e-05,17,After Life,Comedy+Drama,8.115702479338843,8.181818181818182,3,4,121 | ||
False,False,False,6.401638819537802e-05,2,White Lines,Drama+Mystery,6.3023255813953485,4.828488372093023,5.0,4.0,344 | ||
False,False,False,6.401638819537802e-05,7,The Eddy,Drama+Musical,5,7.025316455696203,5,4,79 | ||
False,True,False,0.012483195698098713,8,Pieces of a Woman,Drama,3.8505747126436782,5.272030651340996,4,3,261 | ||
False,False,False,0.012035080980731068,14,The Crown,Drama+History,4.279254264180881,2.436334787782626,4,2,2521 | ||
False,False,False,0.0021125408104474747,16,Offering to the Storm,Crime+Thriller,4.333333333333333,3.4482758620689653,3.0,2.0,174 | ||
True,False,False,0.0013443441521029385,19,The Legacy of the Bones,Crime+Thriller,6.169642857142857,6.723214285714286,3.0,5.0,112 | ||
True,False,False,0.0005121311055630241,22,The Hookup Plan,Comedy,7.443526170798898,3.4269972451790633,5,3,363 | ||
False,False,False,0.00019204916458613405,3,GIMS: On the Record,Documentary+Music,7.666666666666667,5.992592592592593,7,3,135 | ||
True,False,False,0.0028167210805966326,19,Money Heist,Action+Crime+Mystery+Thriller,4.767732962447845,3.5931849791376913,4.0,3.0,1438 | ||
False,False,False,0.003904999679918059,7,Virgin River,Drama+Romance,5.919034090909091,4.686079545454546,4.0,4.0,704 | ||
True,False,False,0.0005121311055630241,20,Winter on Fire: Ukraine's Fight for Freedom,Documentary,11.141176470588235,4.235294117647059,12,4,85 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta:__legacy__" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,2 @@ | ||
docutils~=0.16 | ||
lxml~=4.4.2 | ||
pip~=19.3.1 | ||
argparse~=1.4.0 | ||
configparser~=4.0.2 | ||
wheel~=0.33.6 | ||
cryptography~=2.8 | ||
typing~=3.7.4.3 | ||
filelock~=3.0.12 | ||
six~=1.12.0 | ||
packaging~=20.4 | ||
attrs~=19.3.0 | ||
future~=0.18.2 | ||
tqdm~=4.36.1 | ||
requests~=2.25.1 | ||
isort~=4.3.21 | ||
setuptools~=41.4.0 | ||
rfc3986~=1.4.0 | ||
urllib3~=1.25.7 | ||
wcwidth~=0.1.8 | ||
pexpect~=4.8.0 | ||
certifi~=2019.11.28 | ||
chardet~=3.0.4 | ||
idna~=2.8 | ||
pygments~=2.5.2 | ||
pillow~=7.0.0 | ||
sphinx~=3.2.1 | ||
simplejson~=3.17.0 | ||
pyparsing~=2.4.0 | ||
pycparser~=2.19 | ||
snowballstemmer~=2.0.0 | ||
virtualenv~=20.4.0 | ||
distlib~=0.3.1 | ||
appdirs~=1.4.3 | ||
bcrypt~=3.1.7 | ||
zipp~=3.1.0 | ||
requests~=2.25.1 | ||
munch~=2.5.0 | ||
sphinx-automodapi==0.13 | ||
sphinx-markdown-tables==0.0.15 | ||
sphinx-rtd-theme==0.5.0 | ||
sphinxcontrib-applehelp==1.0.2 | ||
sphinxcontrib-devhelp==1.0.2 | ||
sphinxcontrib-htmlhelp==1.0.3 | ||
sphinxcontrib-jsmath==1.0.1 | ||
sphinxcontrib-qthelp==1.0.3 | ||
sphinxcontrib-serializinghtml==1.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from munch import munchify | ||
|
||
from s4gpy.api.utils import expand_links | ||
|
||
|
||
class CompanyAPI: | ||
"""This class wraps the company-mapper api.""" | ||
|
||
def __init__(self, session): | ||
"""Initialize a new CompanyAPI. | ||
It works by inheriting from the session object of a S4GAPI. | ||
""" | ||
self.session = session | ||
|
||
def get_root(self): | ||
"""Get the root of the company mapping api""" | ||
|
||
"""return a list of companies links""" | ||
company_links = self.session.get("/").json() | ||
expand_links(self.session, company_links) | ||
return munchify(company_links) | ||
|
||
def get_companies(self): | ||
"""Get all the companies in the system""" | ||
return self.get_root().companies() | ||
|
||
def get_contents(self): | ||
"""Get all the contents in the systel""" | ||
return self.get_root().contents() | ||
|
||
def get_company(self, id): | ||
"""retreives information from a particular company, identified by its cc_code""" | ||
r = self.session.get(f"/company/{id}") | ||
if r.status_code > 299: | ||
return None | ||
company_links = r.json() | ||
expand_links(self.session, company_links) | ||
return munchify(company_links) | ||
|
||
def get_content(self, id): | ||
"""retreives information form a particular content, identified by its cc_code""" | ||
r = self.session.get(f"/content/{id}") | ||
if r.status_code > 299: | ||
return None | ||
content_links = r.json() | ||
expand_links(self.session, content_links) | ||
return munchify(content_links) | ||
|
||
def push_company(self, id, name, link): | ||
"""Publish a new company.""" | ||
self.session.post(f'/company/{id}', | ||
json={'name': name, 'link': link}) | ||
|
||
def push_content(self, id, company_names): | ||
"""Publish a new content associated with some company names.""" | ||
self.session.post(f'/content/{id}', | ||
json={'company_names': [name for name in company_names]}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from munch import munchify | ||
|
||
from s4gpy.api.utils import expand_links | ||
|
||
|
||
class NetflixAPI: | ||
"""This class wraps the netflix-api.""" | ||
|
||
def __init__(self, session): | ||
"""Initialize a new NetflixAPI. | ||
It works by inheriting from the session object of a S4GAPI. | ||
""" | ||
self.session = session | ||
|
||
def get_root(self): | ||
"""Publish or updated a new direct schedule.""" | ||
|
||
"""returns a list of users.""" | ||
netflix_links = self.session.get("/api/netflix").json() | ||
expand_links(self.session, netflix_links) | ||
return munchify(netflix_links) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.