Skip to main content

contextkit

Usage

Installation

pip install contextkit

Using

To get context from an LLM, use one of the helper functions to pull it.

If a function pulls a single context snippit it will return the text, if it return multiple it will return a dictionary.

import contextkit.read as rd

Read_X Functions

Each read_x function is designed to work with a single argument, which is the location of the resource. This typically means a URL or a file path.

rd.read_url('https://www.answer.ai/')[:200]
'Answer.AI\n\n  * __\n  * __\n\n# Answer.AI - Practical AI R&D\n\n##### Categories\n\nAll (33)\n\nai (20)\n\ncoding (5)\n\ncompany (2)\n\ncourses (1)\n\neducation (1)\n\ninterview (1)\n\nopen-source (14)\n\npolicy (4)\n\nproduct'

Other arguments are always optional, but can be useful at times. For example, the heavy argument in read_url allows you to do a heavy scrape with a contactless browser using playwrightnb.

rd.read_url('https://www.answer.ai/',heavy=True)[:200]
'Answer.AI\n\n  * __\n  * __\n\n# Answer.AI - Practical AI R&D\n\n##### Categories\n\nAll (33)\n\nai (20)\n\ncoding (5)\n\ncompany (2)\n\ncourses (1)\n\neducation (1)\n\ninterview (1)\n\nopen-source (14)\n\npolicy (4)\n\nproduct'

Many have been creates so far, such as

[o for o in dir(rd) if o.startswith('read_')]
['read_dir',
 'read_file',
 'read_gdoc',
 'read_gh_file',
 'read_gh_repo',
 'read_gist',
 'read_git_path',
 'read_google_sheet',
 'read_html',
 'read_pdf',
 'read_url',
 'read_yt_transcript']

Metadata

Release files for contextkit 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contextkit 0.0.10
File Size Uploaded
contextkit-0.0.10.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for contextkit 0.0.10
File Interpreter ABI Platform
contextkit-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / contextkit-0.0.10.tar.gz

Download URL contextkit-0.0.10.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
35e0ba2df8391dc872f4de2a2a08ca3917b202c1e2b64dc04e38b5f18abc305e
BLAKE2b-256 checksum
How to use checksums
1f37071f88505b101e51fd72824ba7331f845c0ff9be91593fa61add672bac0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / contextkit-0.0.10-py3-none-any.whl

Download URL contextkit-0.0.10-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f499a64c3d83945ee2f4061a8355cee14fea6d370ad48e08492a6ddd5ecaff7b
BLAKE2b-256 checksum
How to use checksums
480d512ed119d7285837f0d53e8f6300a8a943e980a0ae1e1ac37364265f9f4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page