This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

hackerrank-sdk

An Unofficial Python Client for the HackerRank Code Checker API.

Use it as a code-compiler for any of the programming languages supported by hackerrank.

You will need an api-key to use the SDK.Get it here.

The code is Python 2, but Python 3 compatible.

Installation

Fast install:

pip install hackerrank-sdk

For a manual install get this package:

wget https://github.com/nikhilkumarsingh/hackerrank-sdk/archive/master.zip
unzip master.zip
rm master.zip
cd hackerrank-sdk-master

Install the package:

python setup.py install

Examples

from hackerrank.HackerRankAPI import HackerRankAPI

API_KEY = ''  #your API-KEY here

compiler = HackerRankAPI(api_key = API_KEY)

print compiler.supportedlanguages()     #prints a list of supported languages


source = '''print "hello"'''    #give your source code here

'''
Alternatively,you can copy existing files to source this way:
with open(file_name,'r') as f:
     source = f.read()
'''

result = compiler.run({'source': source,
                       'lang':'python'
                       })


print(result.output,result.time,result.memory,result.message)    #get different variables associated with the result

Testcases are passed as a list of strings.

Here is another example which shows how to give testcases to the compiler:

from hackerrank.HackerRankAPI import HackerRankAPI

API_KEY = ''  # Your API-KEY here

compiler = HackerRankAPI(api_key = API_KEY)

source ='''
N, M = map(int,raw_input().split())
for i in xrange(1,N,2):
    print (".|."*i).center(M,'-')

print "WELCOME".center(M,'-')
for i in xrange(N-2,-1,-2):
    print (".|."*i).center(M,'-')
'''

result = compiler.run({'source': source,
                       'lang':'python',
                       'testcases':["9 27"]
                       })

print(result.output[0])

Here is the output:

output

Release History

Release History

1.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
hackerrank-sdk-1.2.1.tar.gz (3.7 kB) Copy SHA256 Checksum SHA256 Source Sep 28, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting