Capylang
Capylang is a pretty simple language.
Regular Examples
from capylang import capy
mycapy = capy(id="MyCapy",printinst=True) # ID is for identification of Capylang Instances, and printinst prints the ID
print(mycapy.__doc__) # Returns help
a = 4
b = 3
print(str(mycapy.add(a,b))) # Prints 7 (also uses the add function)
print(str(mycapy.minus(a,b))) # Prints 1 (also uses the subtract function)
print(str(mycapy.multi(a,b))) # Prints 12 (also uses the multiply function)
print(str(mycapy.div(a,b))) # Prints 2.3 (average, also uses the divide function)
print(str(mycapy.hyp(a,b))) # It returns the hypotenuse of opp, and adj
print(str(mycapy.opp(a,b))) # Try this yourself for more info, check mycapy.__doc__
print(str(mycapy.adj(a,b))) # Try this yourself for more info, check mycapy.__doc__
Mean, Median, and Mode
import cpaylang
arr = [1,2,3,4,5]
# AIML means AI Machine Learning (AIML.)
capylang.aiml.mean(arr)
capylang.aiml.median(arr)
capylang.aiml.mode(arr)
Decorators (Make your own Capylang if you feel lazy or want to!)
import capylang
@capylang.decorators.add # Equivalent to mycapy.add
def myadd(a,b,c):
return a,b,c # The decorator does it all for ya.
print(myadd(1,2,3))
# Basicallly everything above. Add, minus, multi, div, hyp, opp, and adj. Fibonacci is here.
DateTime alternative
import capylang
date = "1/16/1921" # MM/DD/YYYY (January 16th 1921)
mydate = capylang.date.new(date)
print(mydate)
print(mydate.text())
#
Clearing on Terminals
import capylang
capylang.terminal.os_clear() # Clear with the os module
capylang.terminal.replit_clear() # Clear with the replit module
Fibonacci Sequence
from capylang import capy
# The fibonacci sequence function returns numbers in the fibonacci sequence, it contains 2 args:
# num_of_nums: the number of sequence numbers you'd like to generate (required)
# index: to return a specific number in the sequence (optional)
fibo = capy(printinst=True,id="Fibonacci Sequence")
print(fibo.nacci(num_of_nums=10,index=6))
Math string evaluation
# Coming in decorators soon.
from capylang import capy
eval = capy(printinst=True,id="Evaluation")
print(eval.calc("6/2*(1+2)")) # 9
Old, used to be deprecated, but revived capy.log
# Coming in decorators soon.
from capylang import capy
eval = capy(printinst=True,id="Evaluation")
eval.log("The prophecy is true!!!")
Did you know you could use "deprecated" syntax?
from capylang import capy
capy.log("You don't even need to initialize the module!")
String occurrences
import capylang
mystr = "I am an Apple."
mystr = capylang.string.init(mystr)
print(mystr.freq()["Apple."])
String occurrences to lower
import capylang
mystr = "I am an Apple."
mystr = capylang.string.init(mystr)
print(mystr.lowfreq()["apple."])
Binary searching in an array
import capylang
hi = [1,3,5,7,9]
print(capylang.capi.binary_search(hi,3)) # Returns the index of 3 in hi. Otherwise, returns None.
print(capylang.capi.binary_search(hi,-1)) # Returns None because -1 is not in the array.
Color sets
import capylang
print(capylang.color.set["classic"]) # ROYGBP
print(capylang.color.set["full"]) # ROYGBIV
print(capylang.color.set["full_bip"]) # ROYGBIP
# Useful for color sorting.
That's pretty much it for a basic tutorial of Capylang.
Metadata
Release files for capylang 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| capylang-2.2.0.tar.gz | 13.1 kB | Without provenance | Details for capylang-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| capylang-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for capylang-2.2.0-py3-none-any.whl |
Total release size: 20.1 kB
Release files / capylang-2.2.0.tar.gz
| Download URL | capylang-2.2.0.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
461289ee1e5884f41449debe6e3b66c46d417419a747e8d2c208da378a97c02f
|
|
BLAKE2b-256 checksum How to use checksums |
e59d1c16c1da9f1895e310e9dbda642f4dc36f7feea44e1817065d602e769bc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.8.12 Linux/5.15.0-1025-gcp
|
Release files / capylang-2.2.0-py3-none-any.whl
| Download URL | capylang-2.2.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c3a856714eb8d6382b8c54b11d445245bf429c2f619a834f1fdb356a251058e
|
|
BLAKE2b-256 checksum How to use checksums |
2311d4a4a1e1557ef92f1470b29f60ac5af5fc648394e9d7de91400f4a25c34d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.8.12 Linux/5.15.0-1025-gcp
|
Security for capylang 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.