Skip to content

Lib creation

TheAssassin edited this page Dec 10, 2020 · 14 revisions

How to create an ACPL library

Table of contents

  1. Things to know
  2. How to create your lib
  3. How to publish your lib

Things to know

First thing to know, your lib has to be coded in Python.

If you use any external Python library, tell me, make sure that the library will be installed by the user once he downloads the lib.

How to create your lib

First, you need to create a Python file. This Python file follows the following conventions :

  • It has to be a python file (extension .py)
  • The name has to be in lower case, without symbols or numbers except the underline character (_).

Your lib has a few elements to respect, in order for it to work. If you don't respect those rules, your lib won't work properly, or maybe won't work at all !

  • You have to import everything from recurrent_classes, by doing from recurrent_classes import *.
    • You need it for the ibs to work.
    • It gives you access to a lot of functions :
      • error(line_number:int, error_type:str, message=None, *args)
        • This function allows you to throw an error when something goes wrong, and this error will stop the program automatically.
        • line_number can be accessed with the variable line_numbers if you request it (see later)
        • error_type can be whatever you want, but I recommend a CamelCase name, easily recognizable.
        • message and *args are the message you want to send to the user, with a clear explanation of the error. You can also not add this message, and in that case, it will simply say that A error_type has been raised on line line_number.

How to publish your lib

First, join the ACPL official Discord server (link here).

Then, go in the channel #lib-submitting and do as following :

  • Introduce yourself
  • Present your lib
  • Upload the lib file And wait for my answer !

In most of the cases, the lib will be accepted and will be downloadable by anyone.

Clone this wiki locally