Skip to main content

Complex API.py

This the source code for the python module I have built/working on.

This module makes it easy to use my API

Currently, the API supports:

  • compiling the code(of different languages) and getting the output

  • getting a random post from a subreddit

  • getting the lyrics of a song

  • generating pixel art

  • getting the weather of a place

  • finding the length of a youtube playlist

  • getting a random inspirational text

  • getting a result of a calculation

  • converting hexadecimal to decimal(or denary)

  • converting decimal(or denary) to binary

Code snippets

In order to use the API, you need to first download this module (pip install Complex-API)

Compile API:

Example:

from Complex_API import complex_api
# run python
lang = "python"
code = '''
print('hello')
'''
print(complex_api.compile(lang=lang, code=code))
# run java
lang = "java"
code = '''
class Compiler{
    public static void main(String[] args){
        System.out.println("This works");
    }
}
'''
print(complex_api.compile(lang=lang, code=code))

Get all the supported languages here

Reddit API:

Example:

from Complex_API import complex_api
# example: name_of_subreddit = "meme"
name_of_subreddit = "name_of_a_valid_subreddit"
number_of_posts = 10 # number of posts to be returned
print(complex_api.reddit(limit=number_of_posts, subreddit=name_of_subreddit))

Lyrics API:

Example:

from Complex_API import complex_api
SongName = "name of song"
print(complex_api.lyrics(song=SongName))

Pixel Art:

Example:

from Complex_API import complex_api
text = "Hello gammer"
print(complex_api.ascii(text=text))

Weather API:

[Example:](https://API.jagthefriend.repl.co/temp=Cape Town+metric)

from Complex_API import complex_api
# example: place = Cape Town
place = "name of a place"
unit = "metric" # or imperial
print(complex_api.temp(place=place, unit=unit))

Youtube Playlist length finder:

Example:

from Complex_API import complex_api
# example URL: https://www.youtube.com/playlist?list=PL59LTecnGM1OGgddJzY-0r8vdqibi3S2H
# id = PL59LTecnGM1OGgddJzY-0r8vdqibi3S2H
play_list_link = "id"
print(complex_api.length(playlist=play_list_link))

Calculator:

Example:

from Complex_API import complex_api
formula = "6*9+6+9"
print(complex_api.calculator(formula=formula))

Inspire API:

Example:

from Complex_API import complex_api
print(complex_api.inspire())

Hexadecimal to Decimal(or Denary) converter:

Example:

from Complex_API import complex_api
formula = "A6B9C1D1E1"
print(complex_api.hex_to_denary(hex_code=formula))

Decimal(or Denary) to Binary converter:

Example:

from Complex_API import complex_api
formula = "45713" # any number
print(complex_api.binary_to_denary(binary=formula))

Talk to my chatbot:

Example:

from Complex_API import complex_api
text = "Hi" # any text
print(complex_api.ai(text=text))

If you find any bugs or have new ideas,

Feel free to raise a
new issue
Or a
pull request

Release files for Complex-API 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Complex-API 0.1.0
File Size Uploaded
Complex-API-0.1.0.tar.gz 4.0 kB Details

Release files / Complex-API-0.1.0.tar.gz

Download URL Complex-API-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aea05780ba3cf9e5b53e3e216b75efe4106ed5672bdeb35759e2875a9f1410de
BLAKE2b-256 checksum
How to use checksums
bfac5a09b02d522ce70a35b2e2220d8862d11c163c87a9ad00c9b5fed305838d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page