Skip to main content

The BitCCL scripting language compiler package

Project description


GitHub Workflow Status Codecov PyPI PyPI - Downloads

BitCCL is a BitcartCC scripting language used for automating checkout flow and more.

It is currently in alpha stage, being separated from the main BitcartCC repository.


BitCCL is basically Python, but:

  • Safe, with disabled import system
  • Robust, with many built-in functions
  • Optimized for running in BitcartCC environment

Language file extension is .bccl.


pip install -r requirements.txt
./compiler example.bitccl

Built-in functions

Current built-in functions list can be always seen in file.

Table of built-in functions:

Signature Description Return value Imports allowed
add_event_listener(event, func) Adds event listener func to be called when event is dispatched None :x:
@on(event) A decorator used for registering functions to be called when event is dispatched. Example: @on(ProductBought(1)) def func(): pass Wrapper function :x:
dispatch_event(event, *args, **kwargs) Dispatch event, optionally passing positional or named arguments to event handlers None :x:
template(name, data={}) Render template name, optionally passing data to it Template text on success, empty string("") otherwise :heavy_check_mark:
send_email(to, subject, text) Sends email to email address to, with subject and text. Uses email server configuration from config.json True on success, False otherwise :heavy_check_mark:
password(length=SECURE_PASSWORD_LENGTH) Generate cryptographically unique password of length if provided, otherwise uses safe enough length. Generated password :x:

Also a http client is available.

To send http request with it, use:


To send HTTP method (get, post, delete, patch, etc.) to url. You can also optionally pass additional query parameters (params argument), request body data (data argument), files (files argument), headers (headers argument), cookies (cookie argument) and more.

Here is how the most complex request might look like:

http.method(url, params={}, headers={}, cookies={}, auth=None, allow_redirects=True, cert="", verify=True, timeout=5.0)

All arguments except for url are optional.

After sending a request, you can retrieve response data:

If res is response got from calling http.method(...), then:

res.text will return text data from response (for example, html)

res.content will return binary data from response (for example, file contents)

res.json() will return json data from response (for example, when accessing different web APIs)

Response status code can be got as res.status_code.

For convenience, you are provided with http request codes to easily check if request is successful without remembering the numbers.

For example, http_codes.OK is status code 200 (success). So, to check if request has succeeded, you can check like so:

res = http.get("")
if res.status_code == http_codes.OK:

For additional information about built-in http client, you can read it's full documentation

Also, BitcartCC SDK is available to use.

To access coins without xpub to get transaction, fiat rate or anything else not requiring a wallet, you can access each coin by it's lowercase symbol, for example:


Note: running coins' commands require it's daemon running if you are not using BitCCL from BitcartCC deployment.

To perform operations requiring a wallet, use upper-case coin symbol, passing xpub/ypub/zpub/xprv/yprv/zprv/electrum seed in it:

coin = BTC(xpub="my xpub")
# or if using only once:
print(BTC(xpub="my xpub").balance())

Built-in events

Refer to

It is generated automatically from BitCCL code.

Plugin system

If using BitCCL programmatically, you can extend it's execution context with plugins.

Pass a list of plugin-like objects to run function, like so:

from bitccl import run

run("print(x)", plugins=[TestPlugin()])

Each plugin can be anything: class, object, module object, it must have two methods:

startup() method returning dictionary, which will be used to update execution context with new variables

shutdown(context) method which should perform a clean-up of injected variables if needed

Here's TestPlugin code from above's example:

class TestPlugin:
    def startup(self):
        return {"x": 5}

    def shutdown(self, context):


You can contribute to BitCCL language by suggesting new built-in functions and events to be added, as well as any ideas for improving it. Open an issue to suggest new features

Also see our contributing guidelines.

Copyright and License

Copyright (C) 2020 MrNaif2018

Licensed under the LGPLv3+

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitccl-0.0.5.tar.gz (15.0 kB view hashes)

Uploaded source

Built Distribution

bitccl-0.0.5-py3-none-any.whl (19.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page