Package: cyrating
python-cyratingA python wrapper for Cyratinghttps://www.cyrating.com.InstallationpipinstallcyratingThen in your application root directory use the following command to set up your configuration including your Cyrating token which is provided in your user interface:echo-e"[cyrating]\ntoken: cyratingtoken">cyrating.iniUsage example>>>importcyrating>>>cr=cyrating.init()The init method takes into account 2 optional parameters:token: the Cyrating tokenproxies: the list of proxies to use when making a request. Seerequests docsfor more informationAdditional methods listed below are availableMethodDescriptionmain_companyreturns the structure of the main companyentitiesreturns a list of entitiessuppliersreturns a list of supplierscompetitorsreturns a list of competitorsdomainsreturns a list of domains for a companyassetsreturns a list of assets for a given companytechnologiesreturns a list of identified technologies for a given companyset_tagssets tags to a given domain (require admin privileges)factsreturns the results of best practices controlseventsreturns a list of active reputation eventscertificatereturns a certificate of a given companymembersreturns a list of members, including child subscriptions' ones (require admin privileges)rating_historyreturns a list of the last 52 ratings numbers for a given companyscopereturns a list of the last 52 scopes (domain names) taking into account for rating of a given companyscope_updatesreturns a list of the last scope updates including added and removed domainsExamplesGet info of the main companyThe method main_company returns a company identified as the main company.>>>cr.main_company()[...]Get the list of entitiesThe method entities returns the list of companies identified as entities.>>>cr.entities()[...]Get the list of suppliersThe method suppliers returns the list of companies identified as suppliers.>>>cr.suppliers()[...]Get the list of competitorsThe method competitors returns the list of companies identified as competitors.>>>cr.suppliers()[...]Tag a domain or an AS NumberThe method set_tags affects a list of tags to a domain name or an AS Number. All assets related with this domain name or with this AS Number will be updated too.>>>cr.set_tags('example.com',['tag1','tag2'])[...]>>>cr.set_tags('ASXXXXX',['tag3'])[...]Get the list of assetsThe method assets returns a list of assets with tags and type attributes. Each key of this dictionary represents an asset and is linked to the following attributes:asset: the asset nametype: type of the asset, may be 'domain', 'host' or 'ip'country: geolocation data for IP assets onlyentities: list of entities linked with the asset. Entities are the ones included in the subscription.tags: list of tags linked with the assetrelated: list of assets linked with the assetdomains: list of domains linked with the asset>>>cr.assets(main_company)[...]Get the list of detected technologiesThe method technologies returns a list of detected technologies for a given company.assetsparameter is optional and is needed to provide tags associationEach item of the detected technologies includes the following attributes:name: name of the detected technologycategory: name of the technology categoryasset: name of the asset supporting the detected technologydomain: domain name / AS Number linked with the assetentities: list of entities linked with the asset. Entities are the ones included in the subscription.tags: list of tags linked with the asset>>>main_company=cr.main_company()>>>cr.technologies(main_company,assets=cr.assets(main_company))[...]Get the results of best practices controlsThe method facts returns the results of best practices controls.assetsparameter is optional and is needed to provide tags association.extra_filteris also an optional to filter results server-side.Each item of the results includes the following attributes:domain: domain name / AS Number linked with the assetcategory: name of the best practice's categoryentities: list of entities linked with the asset. Entities are the ones included in the subscription.tags: list of tags linked with the assettype: type of the asset, may be 'domain', 'host' or 'ip'name: name of the resourceresults: raw results of the controlgrade: unitary score of the controlimpact: impact on rating of controls which lead to a downgrade.>>>main_company=cr.main_company()>>>cr.facts(main_company,assets=cr.assets(main_company))[...]Get the list of active reputation eventsThe method events returns a list of active reputation events.assetsparameter is optional and is needed to provide tags association.An active reputation event includes the following attributes:name: name of the asset concernedcategory: name of the reputation's categorydomains: list of domains / AS Numbers linked with the assetentities: list of entities linked with the asset. Entities are the ones included in the subscription.tags: list of tags linked with the assettype: type of the asset, may be 'domain', 'host' or 'ip'source: a dictionary with the tag and the url of the reputation sourceoccurrences: dates of occurrences of the eventscore: deprecated, replaced by impactimpact: impact on rating of the company. Please note that Cyrating algorithm streamlines this score by resource and reputation's category>>>main_company=cr.main_company()>>>cr.events(main_company,assets=cr.assets(main_company))[...]Returns certificate of a given company>>>main_company=cr.main_company()>>>cr.certificate(main_company)Save the certificate of a given company to a file>>>main_company=cr.main_company()>>>cr.certificate(main_company,filename='Cyrating - Certificate of{}.pdf'.format(main_company['name']))Get the list of members>>>cr.members()[...]Get a list of the last 52 ratings for a given company>>>main_company=cr.main_company()>>>cr.rating_history(main_company)[...]Get a list of the last 52 scopes for a given companyThe method scope returns a list of the last 52 scopes for a givencompany. A scope is a list of domain names taking into account for rating of a given companyA scope includes the following attribute:domainnames: list of domains names supporting our rating>>>main_company=cr.main_company()>>>cr.scope(main_company)[...]Get a list of scope updatesAn additional method is available to get scope updates for a given company including added domains and removed domains between several ratings.A scope includes the following attributes:added: domains added to a rating scoperemoved: domains removed from a rating scopedate: date of rating>>>main_company=cr.main_company()>>>scope=cr.scope(main_company)>>>updates=cr.scope_updates(scope)[...]RegressionAfter version 1.0.15, the method assets returns a list instead of a dictionaryMetaCyrating –@cyrating–hello@cyrating.comDistributed under the ISCL licence. SeeLICENSEfor more information.ContributingSend issues toissues@cyrating.com