KO
|
EN
gitlite — search
Search
#java
#nodejs
#python
#android
#cpp
#game
#hacktoberfest
#javascript
#react
#redux
#webpack
#php
hackerrank-sdk
★ 14
Open GitHub ↗
A python client for Hackerrank API
Download README (.md)
Explore Similar Repositories
zbn
:
安全编排与自动化响应平台
hackerrank-python-basic-skill-test
:
Contains solved programs for the HackerRank Python (Basics) Skill Test Certification 🎓.
Hackerrank_Python
:
Hackerrank problem solving using Python3
Coding_challenges
:
Solutions to some coding challenges written with Python
Hackerrank_solutions
:
Effective solutions to hackerrank.com practice problems in C++, python and SQL
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
hackerrank-sdk
?
Download (.md)
[](https://pypi.python.org/pypi/hackerrank-sdk) [](https://github.com/nikhilkumarsingh/hackerrank-sdk/blob/master/LICENSE.txt) hackerrank-sdk ============== An Unofficial Python Client that supports interaction with [HackerRank API](https://www.hackerrank.com/api/docs). This SDK provides integration with HackerRank API for compiling and running code in several languages. It can be accessed via a simple API key based authorization process.[Get your api-key from here](https://www.hackerrank.com/api/docs). 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 ```python 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: ```python 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: 