Skip to main content

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

akashic_records-0.1.0.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

akashic_records-0.1.0-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

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