No project description provided
Project description
akashic_records
akashic_records
is a Python library that dynamically generates functions using OpenAI code completion based on what is imported and how it is used.
Installation
To install the akashic_records library, you can use pip:
pip install akashic_records
Usage
To use the akashic_records
library, you need to import the function you want to generate. The library generates the function on the fly based on the name you import. For example, to generate a quicksort function, you can import the quick_sort function like this:
Since this library depends on [openai](https://github.com/openai/openai-python)
, you need to set your API key on start.
import openai
openai.api_key = '<YOUR_KEY>'
from akashic_records import quick_sort
# Use the generated function
arr = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]
result = quick_sort(arr)
print(result) # Output: [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]
This library (ab)uses type hints to give more information to the completion process.
import openai
openai.api_key = '<YOUR_KEY>'
from akashic_records import merge_sort
# Use the generated function
arr = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]
result: """
Sorts the input list using the mergesort algorithm.
Parameters:
-----------
arr : list
The input list to be sorted.
Returns:
--------
list
The sorted list.
""" = merge_sort(arr)
print(result) # Output: [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]
Wait, how did you do that?
The very neat sorcery package by Alex Hall.
What's with the name?
The name akashic_records
is inspired by the spiritual belief of the Akashic Records. In this belief, the Akashic Records are a repository all universal events, thoughts, words, emotions and intent ever to have occurred in the past, present, or future in terms of all entities and life forms.
This seemed fitting for a library that in some sense contains the implementation of "every function".
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
Built Distribution
Hashes for akashic_records-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74b09b17beced8fc4aef42e6f009adbede9c23e40aaff1197a77dfe4ca5e5b02 |
|
MD5 | 63f33cad92783df63641c695bbf8f7b5 |
|
BLAKE2b-256 | fa5ff2b50bae08edd9da4aee59244d528ddb198aef532b8e587c4f3c29da8e6a |